-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from sharplispers/develop
Improve tests and enable extensions
- Loading branch information
Showing
13 changed files
with
145 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
/manual/clx.info | ||
/manual/clx.info-1 | ||
/manual/clx.info-2 | ||
*.lx64fsl | ||
/manual/clx.tps | ||
/manual/clx.tp | ||
/manual/clx.toc | ||
/manual/clx.pdf | ||
/manual/clx.log | ||
/manual/clx.fns | ||
/manual/clx.fn | ||
/manual/clx.aux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
(fiasco:define-test-package (#:xlib-test-displays :in xlib-test:xlib-all-tests) | ||
(:documentation "Tests for `3. Displays' section of the manual.")) | ||
(in-package #:xlib-test-displays) | ||
|
||
;;; Manual notes: | ||
;;; | ||
;;; - xlib:display-error-handler documentation has broken reference "See | ||
;;; <undefined> [Errors], page <undefined>"; | ||
|
||
;;; This test will fail the day "FOO" extension is written. | ||
(deftest display-protocol () | ||
"Opens display, checks its attributes and closes it." | ||
(let ((display (xlib:open-default-display))) | ||
(is (null (xlib:query-extension display "FOO"))) | ||
(is (typep (xlib:display-authorization-data display) 'vector)) | ||
(is (typep (xlib:display-authorization-name display) 'string)) | ||
(is (typep (xlib:display-bitmap-format display) 'xlib:bitmap-format)) | ||
(is (typep (xlib:display-byte-order display) '(member :lsbfirst :msbfirst))) | ||
(is (typep (xlib:display-display display) 'integer)) | ||
(is (typep (xlib:display-error-handler display) '(or function symbol))) | ||
(is (typep (xlib:display-image-lsb-first-p display) 'boolean)) | ||
(multiple-value-bind (min-keycode max-keycode) (xlib:display-keycode-range display) | ||
(is (typep min-keycode 'xlib:card8)) | ||
(is (typep max-keycode 'xlib:card8)) | ||
(is (= min-keycode (xlib:display-min-keycode display))) | ||
(is (= max-keycode (xlib:display-max-keycode display)))) | ||
(let ((max-request-size (xlib:display-max-request-length display))) | ||
(is (>= max-request-size 4096)) | ||
(is (typep max-request-size 'xlib:card16))) | ||
(is (typep (xlib:display-motion-buffer-size display) 'xlib:card32)) | ||
(is (typep (xlib:display-nscreens display) 'integer)) | ||
(is (xlib:display-p display)) | ||
(is (not (xlib:display-p :not-a-display))) | ||
(is (every #'xlib:pixmap-format-p (xlib:display-pixmap-formats display))) | ||
;; display-plist | ||
(finishes (setf (getf (xlib:display-plist display) :foo) :bar)) | ||
(is (eql :bar (getf (xlib:display-plist display) :foo))) | ||
(finishes (remf (xlib:display-plist display) :foo)) | ||
(is (eql nil (getf (xlib:display-plist display) :foo))) | ||
(multiple-value-bind (major minor) (xlib:display-protocol-version display) | ||
(is (typep minor 'xlib:card16)) | ||
(is (typep major 'xlib:card16)) | ||
(is (= minor (xlib:display-protocol-minor-version display))) | ||
(is (= major (xlib:display-protocol-major-version display)))) | ||
(is (typep (xlib:display-resource-id-base display) 'xlib:resource-id)) | ||
(is (typep (xlib:display-resource-id-mask display) 'xlib:resource-id)) | ||
(is (every #'xlib:screen-p (xlib:display-roots display))) | ||
(multiple-value-bind (name release) (xlib:display-vendor display) | ||
(is (typep name 'string)) | ||
(is (typep release 'xlib:card32)) | ||
(is (string= name (xlib:display-vendor-name display))) | ||
(is (= release (xlib:display-release-number display)))) | ||
(is (typep (xlib:display-xid display) '(or function symbol))) | ||
;; dummy test | ||
(let ((count 0)) | ||
(finishes (setf (xlib:display-after-function display) | ||
(lambda (display) | ||
(declare (ignore display)) | ||
(incf count))) | ||
(xlib:with-display (display) | ||
(xlib:query-extension display "FOO") | ||
(xlib:display-finish-output display) | ||
(xlib:query-extension display "FOO") | ||
(xlib:display-force-output display))) | ||
(is (<= 2 count))) | ||
(is (null (xlib:close-display display))) | ||
;; We can't query closed display. | ||
(signals xlib:closed-display (xlib:query-extension display "FOO")))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
(defpackage :xlib-test | ||
(:use :common-lisp) | ||
(:export :run-all-tests | ||
:define-test-suite | ||
:xlib-all-tests)) | ||
(defpackage #:xlib-test | ||
(:use :cl) | ||
(:export #:run-all-tests #:xlib-test #:xlib-all-tests)) | ||
(in-package #:xlib-test) | ||
|
||
(fiasco:defsuite (xlib-all-tests :bind-to-package #:xlib-test)) |
This file was deleted.
Oops, something went wrong.