Updates for the new smokegenerator. --> to head
Sat Apr 3 21:13:24 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test static member variable access using slot-value with a class object.
Sat Apr 3 14:52:50 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test slot-value for C++ attributes.
Sat Apr 3 14:50:36 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test qt.opengl conversions.
Sat Feb 20 22:06:45 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test (qt:value (qt:make-variant qt:+green+))
Sat Feb 20 19:06:27 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test overload resolution exact match for long and ulong.
Mon Jan 25 22:13:40 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test QGraphicsScene::setItem
Mon Jan 25 19:51:13 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test QList translation
Sat Jan 23 23:18:13 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test to QVector<QPoint> translation.
Sun Jan 10 09:57:03 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* ASDF & modular smoke.
Sun Dec 13 13:45:36 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support ASDF instead of Mudballs.
Wed Sep 2 14:02:23 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test Lisp to QList<QVariant> and test user conversion sequence for return values.
Sun Aug 30 16:18:04 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test multiple C++ superclasses.
Thu Aug 27 10:41:11 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Updates for the new smokegenerator.
* workaround missing default arguments for QTest::mouseClick
* test const correctness.
diff -rN -u old-qt.tests/cl-smoke.qt.tests.asd new-qt.tests/cl-smoke.qt.tests.asd
--- old-qt.tests/cl-smoke.qt.tests.asd 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/cl-smoke.qt.tests.asd 2014-10-18 14:43:28.000000000 +0200
@@ -0,0 +1,35 @@
+(defsystem :cl-smoke.qt.tests
+ :name :cl-smoke.qt.tests
+ :version (0 0 1)
+ :author "Tobias Rautenkranz"
+ :license "GPL with linking exception"
+ :description "Qt unit tests."
+ :depends-on (:cl-smoke.qt.test :cl-smoke.qt.gui :cl-smoke.qt.opengl
+ :FiveAM :trivial-garbage :cl-smoke.smoke)
+
+ :components
+ ((:module "src"
+ :components
+ ((:file "package")
+ (:file "tests" :depends-on ("package"))
+ (:file "qbytearray" :depends-on ("tests"))
+ (:file "qstring" :depends-on ("tests"))
+ (:file "qvector" :depends-on ("tests"))
+ (:file "qlist" :depends-on ("tests"))
+ (:file "graphics-item" :depends-on ("tests"))
+ (:file "overload" :depends-on ("tests"))
+ (:file "opengl" :depends-on ("tests"))
+ (:file "gc" :depends-on ("tests" "object"))
+ (:file "variant" :depends-on ("tests"))
+ (:file "application" :depends-on ("tests"))
+ (:file "signal-slot" :depends-on ("tests"))
+ (:file "operators" :depends-on ("tests"))
+ (:file "undo" :depends-on ("tests"))
+ (:file "abort" :depends-on ("tests"))
+ (:file "object" :depends-on ("tests"))
+ (:file "thread" :depends-on ("tests"))
+ (:file "properties" :depends-on ("tests"))
+ (:file "click" :depends-on ("tests"))))))
+
+(defmethod perform ((operation test-op) (c (eql (find-system :cl-smoke.qt.tests))))
+ (funcall (intern (string :run) (string :qt.tests))))
diff -rN -u old-qt.tests/qt.tests.mbd new-qt.tests/qt.tests.mbd
--- old-qt.tests/qt.tests.mbd 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/qt.tests.mbd 1970-01-01 01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
-
-(in-package :sysdef-user)
-
-(define-system :qt.tests ()
- (:version 0 0 1)
- (:documentation "Qt unit tests.")
- (:author "Tobias Rautenkranz")
- (:license "GPL with linking exception")
- (:needs :qt :qt.test :FiveAM :trivial-garbage)
- (:uses-macros-from :smoke)
- (:components
- ("src" module
- (:components
- "package"
- ("tests" (:needs "package"))
- ("qbytearray" (:needs "tests"))
- ("qstring" (:needs "tests"))
- ("overload" (:needs "tests"))
- ("gc" (:needs "tests"))
- ("variant" (:needs "tests"))
- ("application" (:needs "tests"))
- ("signal-slot" (:needs "tests"))
- ("operators" (:needs "tests"))
- ("undo" (:needs "tests"))
- ("abort" (:needs "tests"))
- ("object" (:needs "tests"))
- ("thread" (:needs "tests"))
- ("properties" (:needs "tests"))
- ("click" (:needs "tests"))))))
diff -rN -u old-qt.tests/src/abort.lisp new-qt.tests/src/abort.lisp
--- old-qt.tests/src/abort.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/abort.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -80,3 +80,11 @@
(cxx:start timer 0)
(qt:core-application.process-events))
(5am:is (eq t continued-p)))))
+
+
+(5am:test msg-handler
+ "Test catching Q_ASSERTS."
+ (5am:signals error
+ (qt:qt-assert ":qt.tests msg-handler test assert"
+ "abort.lisp"
+ -1)))
diff -rN -u old-qt.tests/src/application.lisp new-qt.tests/src/application.lisp
--- old-qt.tests/src/application.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/application.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -11,11 +11,13 @@
(if core-p
(qt:with-core-app ()
(5am:is (eql t (qt:app-p)))
- (5am:is (typep (qt:app) (find-class 'qt:core-application)))
+ (5am:is (string= "QCoreApplication"
+ (cxx:class-name (cxx:meta-object (qt:app)))))
(setf (cxx:object-name (qt:app)) "core-app")) ;; test for memfault
(qt:with-app ()
(5am:is (eql t (qt:app-p)))
- (5am:is (typep (qt:app) (find-class 'qt:application)))
+ (5am:is (string= "QApplication"
+ (cxx:class-name (cxx:meta-object (qt:app)))))
(setf (cxx:object-name (qt:app)) "app")))
(unless nested
(5am:is (eql nil (qt:app-p)))))))
diff -rN -u old-qt.tests/src/click.lisp new-qt.tests/src/click.lisp
--- old-qt.tests/src/click.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/click.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -20,9 +20,11 @@
(5am:is (string= "Hello World" (cxx:text widget)))
(5am:is (= 0 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
+ (qt:test.mouse-click widget qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 1 click-count))
- (qt:test.mouse-click widget qt:+right-button+)
+ (qt:test.mouse-click widget qt:+right-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 1 click-count)))))
(5am:test (click-test-bool :depends-on click-test)
@@ -35,9 +37,11 @@
(5am:is (eql nil checked))
(incf click-count)))
(5am:is (= 0 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
+ (qt:test.mouse-click widget qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 1 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
+ (qt:test.mouse-click widget qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 2 click-count)))))
(5am:test (click-test-bool-this :depends-on click-test)
@@ -52,7 +56,9 @@
(5am:is (eq widget object))
(incf click-count))))
(5am:is (= 0 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
+ (qt:test.mouse-click widget qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 1 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
+ (qt:test.mouse-click widget qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 2 click-count)))))
diff -rN -u old-qt.tests/src/gc.lisp new-qt.tests/src/gc.lisp
--- old-qt.tests/src/gc.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/gc.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -1,7 +1,6 @@
(in-package :qt.tests)
(5am:in-suite :qt.suite)
-
;;; The GC stuff depends on (gc :full t) to collect the consed objects.
;;; Sometimes calling GC twice helps in SBCL.
@@ -11,15 +10,14 @@
It is not required that every instance is gc'ed, since this rarely happens
and is not a bug."
(let ((objects nil))
- (dotimes (x 10)
+ (dotimes (x 30)
(let ((object (make-instance class)))
(push (make-weak-pointer object)
objects)))
(dotimes (x 2)
(gc :full t))
- (5am:is (eql t
- (some #'(lambda (o) (null (weak-pointer-value o)))
- objects)))))
+ (5am:is (eq t (some #'(lambda (o) (null (weak-pointer-value o)))
+ objects)))))
(defclass lisp-object ()
((a :initform (make-array '(1000 1000) :initial-element 3))
@@ -39,6 +37,10 @@
"Test garbage collection of a QObject."
(test-gc 'qt:object))
+(5am:test gc-multi-object
+ "Test garbage collection of a custom object that has two C++ superclasses."
+ (test-gc 'my-multi-object))
+
(defclass my-gc-object (qt:object)
()
(:metaclass cxx:class))
@@ -125,9 +127,11 @@
(5am:test (ownership-transfer-no-wrapper :depends-on gc-lisp-child)
"Test ownership transfer of a QObject without a wrapper."
(let ((grand-parent (make-instance 'qt:object)))
+ (setf (cxx:object-name grand-parent) "grand parent")
(let* ((parent (make-instance 'qt:object :args (list grand-parent)))
(object (make-instance 'my-object :args (list parent))))
- (declare (ignore object)))
+ (setf (cxx:object-name parent) "parent"
+ (cxx:object-name object) "child"))
(gc :full t)
(qt:core-application.send-posted-events)
(gc :full t)
@@ -135,14 +139,12 @@
(5am:is (member (find-class 'my-object)
(loop for c across (cxx:children grand-parent) append
(map 'list #'class-of
- (cxx:children c)))))))
+ (cxx:children c)))))))
-
(5am:test (gc-non-smoke-object :depends-on gc-lisp-child)
"Test adding a child to a non smoke object."
(qt:with-app ()
- (let ((model (make-instance 'qt:string-list-model
- :args (list #("a" "b" "c"))))
+ (let ((model (make-instance 'qt:string-list-model :arg0 #("a" "b" "c")))
(view (make-instance 'qt:list-view))
(counter 0))
(setf (cxx:model view) model)
@@ -151,6 +153,8 @@
#'(lambda (selected deselected)
(declare (ignore selected deselected))
(incf counter)))
+ (cxx:destroyed (cxx:selection-model view)
+ (cxx:selection-model view))
(gc :full t)
(qt:core-application.send-posted-events)
(gc :full t)
diff -rN -u old-qt.tests/src/graphics-item.lisp new-qt.tests/src/graphics-item.lisp
--- old-qt.tests/src/graphics-item.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/src/graphics-item.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -0,0 +1,18 @@
+(in-package :qt.tests)
+
+(5am:in-suite :qt.suite)
+
+(5am:test set-graphics-item
+ "Ownership transfer for QGraphicsScene::setItem."
+ (qt:with-app ()
+ (let ((scene (make-instance 'qt:graphics-scene)))
+ (let ((item (make-instance 'qt:graphics-item)))
+ (cxx:set-tool-tip item "Foo")
+ (cxx:add-item scene item))
+ (tg:gc :full t)
+ (tg:gc :full t)
+ (5am:is (= 1 (length (cxx:items scene))))
+ (5am:is (string= "Foo"
+ (cxx:tool-tip (elt (cxx:items scene) 0))))
+ ;; FIXME delete QGraphicsScene before the QApplication is deleted
+ (smoke::delete-object scene))))
diff -rN -u old-qt.tests/src/object.lisp new-qt.tests/src/object.lisp
--- old-qt.tests/src/object.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/object.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -13,3 +13,14 @@
(length (cxx:children object))))
(dolist (c children)
(5am:is (find c (cxx:children object)))))))
+
+(defclass my-multi-object (qt:object qt:graphics-item)
+ ()
+ (:metaclass cxx:class))
+
+(5am:test multi-object
+ "Tests a custom object that has two C++ superclasses."
+ (let ((object (make-instance 'my-multi-object)))
+ (5am:is (string= "" (cxx:object-name object)))
+ (5am:is (= qt:graphics-item.+user-type+
+ (cxx:type object)))))
diff -rN -u old-qt.tests/src/opengl.lisp new-qt.tests/src/opengl.lisp
--- old-qt.tests/src/opengl.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/src/opengl.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -0,0 +1,24 @@
+(in-package :qt.tests)
+
+(5am:in-suite :qt.suite)
+
+(5am:test gluint
+ "GLuint conversion"
+ (qt:with-app ()
+ (let* ((texture (make-instance 'qt:pixmap))
+ (gl-widget (make-instance 'qt:glwidget))
+ (id (cxx:bind-texture gl-widget texture)))
+ (5am:is (typep id '(integer 0)))
+ (cxx:delete-texture gl-widget id))))
+
+
+(5am:test glint
+ "Test GLint and GLenum conversion."
+ (qt:with-app ()
+ (let* ((texture (make-instance 'qt:pixmap))
+ (target 3553) ;(cffi:foreign-enum-value '%gl:enum :texture-2d))
+ (format 6409) ;(cffi:foreign-enum-value '%gl:enum :rgba))
+ (gl-widget (make-instance 'qt:glwidget))
+ (id (cxx:bind-texture gl-widget texture target format)))
+ (5am:is (typep id '(integer 0)))
+ (cxx:delete-texture gl-widget id))))
diff -rN -u old-qt.tests/src/overload.lisp new-qt.tests/src/overload.lisp
--- old-qt.tests/src/overload.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/overload.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -26,7 +26,7 @@
(defmethod cxx:data ((list my-list-model) index role)
(incf (counter list))
(if (< (cxx:row index) 2)
- (qt:make-variant (cxx:row index))
+ (cxx:row index) ;; cl-smoke converts to the required qt:variant
(qt:make-variant)))
(defmethod cxx:row-count ((list my-list-model) parent)
diff -rN -u old-qt.tests/src/package.lisp new-qt.tests/src/package.lisp
--- old-qt.tests/src/package.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/package.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -1,3 +1,3 @@
(defpackage :qt.tests
- (:use :cl :trivial-garbage :bordeaux-threads)
+ (:use :cl :trivial-garbage :bordeaux-threads :cxx-support)
(:export :run))
diff -rN -u old-qt.tests/src/properties.lisp new-qt.tests/src/properties.lisp
--- old-qt.tests/src/properties.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/properties.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -35,3 +35,24 @@
(5am:for-all ((integer (5am:gen-integer)))
(setf (qt:property o 'foo-bar) integer)
(5am:is (= integer (qt:property o 'foo-bar))))))
+
+(5am:test attributes
+ "Test C++ attribute access with slot-* functions."
+ (let ((o (make-instance 'qt:object)))
+ (5am:is (slot-boundp o :static-meta-object))
+ (5am:is (slot-boundp (find-class 'qt:object) :static-meta-object))
+ (5am:is (string= "QObject"
+ (cxx:class-name
+ (slot-value o :static-meta-object))))
+ (5am:is (string= "QObject"
+ (cxx:class-name
+ (slot-value (find-class 'qt:object)
+ :static-meta-object))))
+ (5am:signals error
+ (setf (slot-value o :static-meta-object)
+ (cffi:null-pointer))))
+ (let ((data (make-instance 'qt:shared-data)))
+ (5am:is (slot-boundp data :ref))
+ (5am:for-all ((value (5am:gen-integer :min -255 :max 255)))
+ (setf (slot-value data :ref) value)
+ (5am:is (cxx:= (slot-value data :ref) value)))))
diff -rN -u old-qt.tests/src/qbytearray.lisp new-qt.tests/src/qbytearray.lisp
--- old-qt.tests/src/qbytearray.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/qbytearray.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -8,7 +8,22 @@
(5am:test bytearray
"Test string <-> QByteArray."
+ (5am:for-all ((string (5am:gen-one-element "" "Foo" "bar" "öäü" "1234")))
+ (5am:is (string= string
+ (cxx:data (make-instance 'qt:byte-array
+ :arg0 string)))))
+ #-openmcl ;; FIXME utf-8 problems with Clozure cl?
(5am:for-all ((string (5am:gen-string)))
(5am:is (string= string
(cxx:data (make-instance 'qt:byte-array
- :args (list string)))))))
+ :arg0 string))))))
+
+(5am:test const-bytearray
+ "Test const QByteArray."
+ ;; Const operator[] returns a char, but the non const version a QByteRef.
+ ;; Using this to test constnes overload resolution.
+ (let ((const-array (qt:operator+ (make-instance 'qt:byte-array :arg0 "a")
+ (make-instance 'qt:byte-array :arg0 "b"))))
+ (5am:is (typep (cxx:operator[] (make-instance 'qt:byte-array :arg0 "a") 0)
+ 'qt:byte-ref))
+ (5am:is (eql #\a (cxx:operator[] const-array 0)))))
diff -rN -u old-qt.tests/src/qlist.lisp new-qt.tests/src/qlist.lisp
--- old-qt.tests/src/qlist.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/src/qlist.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -0,0 +1,11 @@
+(in-package :qt.tests)
+
+(5am:in-suite :qt.suite)
+
+(5am:test variant-list
+ "QList<Variant>"
+ (let ((variants (vector (qt:make-variant "foo"))))
+ (5am:is (every #'cxx:=
+ variants
+ (cxx:to-list (qt:make-variant variants))))))
+
diff -rN -u old-qt.tests/src/qvector.lisp new-qt.tests/src/qvector.lisp
--- old-qt.tests/src/qvector.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/src/qvector.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -0,0 +1,41 @@
+(in-package :qt.tests)
+
+(5am:in-suite :qt.suite)
+
+(5am:test qvector-qpoint
+ "Tests to QVector<QPoint> translation."
+ (let* ((points
+ (map 'vector #'(lambda (coords)
+ (make-instance 'qt:point :arg0 (first coords)
+ :arg1 (rest coords)))
+ '((9 . 8) (7 . 6) (5 . 4))))
+ (polygon (make-instance 'qt:polygon :arg0 points)))
+ (dotimes (i (length points))
+ (5am:is (= (cxx:x (aref points i))
+ (cxx:x (cxx:point polygon i))))
+ (5am:is (= (cxx:y (aref points i))
+ (cxx:y (cxx:point polygon i))))))
+ ;; Free the allocated QVector<QPoint>
+ (tg:gc :full t))
+
+(5am:test qvector-double
+ "Test QVector<double> <-> Lisp translation."
+ (5am:for-all ((pattern (5am:gen-one-element #()
+ #(1d0 2d0)
+ #(3.1415926d0 -10d0 1d10 0d0))))
+ (let ((pen (make-instance 'qt:pen))) ;; set-dash-pattern only works once!?
+ (cxx:set-dash-pattern pen pattern)
+ (5am:is (equalp pattern (cxx:dash-pattern pen))))))
+
+(5am:test qvector-uint
+ "Test QVector<unsigned int> <-> Lisp translation."
+ (let ((image (make-instance 'qt:image
+ :args (list 10 10 qt:image.+format-indexed8+)))
+ (colors (map 'vector
+ #'qt:q-rgb
+ '(1 2 44 55 255)
+ '(4 6 23 43 12)
+ '(5 0 23 12 123))))
+ (5am:is (equalp #() (cxx:color-table image)))
+ (cxx:set-color-table image colors)
+ (5am:is (equalp colors (cxx:color-table image)))))
diff -rN -u old-qt.tests/src/signal-slot.lisp new-qt.tests/src/signal-slot.lisp
--- old-qt.tests/src/signal-slot.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/signal-slot.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -15,7 +15,7 @@
(5am:test (emit-int-signal :depends-on with-app)
"Emits a signal with a C++ integer argument to a C++ slot."
- (qt:with-core-app ()
+ (qt:with-app ()
(let ((my-signal (qt:make-signal))
(label (make-instance 'qt:label)))
(qt:connect my-signal (qt:get-slot label "setNum(int)"))
@@ -25,7 +25,7 @@
(5am:test (emit-float-signal :depends-on with-app)
"Emits a signal with a C++ integer argument to a C++ slot."
- (qt:with-core-app ()
+ (qt:with-app ()
(let ((my-signal (qt:make-signal))
(label (make-instance 'qt:label)))
(qt:connect my-signal (qt:get-slot label "setNum(double)"))
@@ -152,13 +152,15 @@
(qt:connect (qt:get-signal button "clicked()")
(qt:get-slot signal-mapper "map()"))
(cxx:set-mapping signal-mapper button button)
-
- (qt:connect (qt:get-signal signal-mapper "mapped(QObject*)")
+ ;; button is a QWidget thus it's mapped(QWidget*) and not
+ ;; mapped(QObject*)
+ (qt:connect (qt:get-signal signal-mapper "mapped(QWidget*)")
#'(lambda (object)
(5am:is (eq button object))
(incf click-count)))
(5am:is (= 0 click-count))
- (qt:test.mouse-click button qt:+left-button+)
+ (qt:test.mouse-click button qt:+left-button+
+ 0 (make-instance 'qt:point) -1)
(5am:is (= 1 click-count)))))
(5am:test receive-by-value
diff -rN -u old-qt.tests/src/variant.lisp new-qt.tests/src/variant.lisp
--- old-qt.tests/src/variant.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/src/variant.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -39,3 +39,23 @@
(let ((variant (qt:make-variant)))
(5am:is (= 1 (setf (qt:value variant) 1)))
(5am:is (= 1 (qt:value variant)))))
+
+(5am:test variant-list
+ (let ((list (qt:make-variant (map 'vector #'qt:make-variant
+ '(1 "asdf" #\a)))))
+ (5am:is (string= "QVariantList"
+ (cxx:type-name list)))))
+
+(5am:test exact-int-type-match
+ "Test overload resolution exact match long vs. int."
+ (5am:is (enum= qt:variant.+uint+
+ (cxx:type (qt:make-variant 1))))
+ (5am:is (enum= qt:variant.+int+
+ (cxx:type (qt:make-variant -1)))))
+ ;; on 32 bit sizeof(long) == sizeof(int) thus not test for that.
+
+(5am:test variant-color
+ "Test QColor variant."
+ (let ((color (make-instance 'qt:color :arg0 qt:+green+)))
+ (5am:is (string= (cxx:name color)
+ (cxx:name (qt:value (qt:make-variant color)))))))
diff -rN -u old-qt.tests/test.lisp new-qt.tests/test.lisp
--- old-qt.tests/test.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/test.lisp 2014-10-18 14:43:28.000000000 +0200
@@ -1,25 +1,9 @@
#|
exec -a "$0" sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options "$@"
-# do not use --script to allow loading mudballs with ${HOME}/.sbclrc
# Used for testing on darcs record.
|#
-
-(in-package :sysdef-user)
-
-(defun load-sysdef (pathname system)
- (load pathname)
- (setf (mb.sysdef::pathname-of (find-system system)) pathname))
-
-(defun load-sysdef-file (system-name)
- "Loads a mbd file in the current directory."
- (load-sysdef (make-pathname :defaults *default-pathname-defaults*
- :name (string-downcase system-name)
- :type "mbd")
- system-name))
-
-(load-sysdef-file :qt.tests)
-(mb:clean :qt.tests)
-(mb:test :qt.tests)
+(asdf:operate 'asdf:load-op :cl-smoke.qt.tests)
+(asdf:operate 'asdf:test-op :cl-smoke.qt.tests)
(sb-ext:quit)
diff -rN -u old-qt.tests/tests/test.lisp new-qt.tests/tests/test.lisp
--- old-qt.tests/tests/test.lisp 2014-10-18 14:43:28.000000000 +0200
+++ new-qt.tests/tests/test.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-(in-package :qt.tests)
-
-(run)