Updates for the new smokegenerator.
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/src/click.lisp new-qt.tests/src/click.lisp
--- old-qt.tests/src/click.lisp 2014-10-30 07:02:48.000000000 +0100
+++ new-qt.tests/src/click.lisp 2014-10-30 07:02:48.000000000 +0100
@@ -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-30 07:02:48.000000000 +0100
+++ new-qt.tests/src/gc.lisp 2014-10-30 07:02:48.000000000 +0100
@@ -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.
@@ -125,9 +124,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 +136,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 +150,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/qbytearray.lisp new-qt.tests/src/qbytearray.lisp
--- old-qt.tests/src/qbytearray.lisp 2014-10-30 07:02:48.000000000 +0100
+++ new-qt.tests/src/qbytearray.lisp 2014-10-30 07:02:48.000000000 +0100
@@ -12,3 +12,11 @@
(5am:is (string= string
(cxx:data (make-instance 'qt:byte-array
:args (list string)))))))
+
+(5am:test const-bytearray
+ "Test const QByteArray."
+ (let ((const-array (qt:operator+ (make-instance 'qt:byte-array)
+ (make-instance 'qt:byte-array))))
+ (5am:is (typep (cxx:operator[] (make-instance 'qt:byte-array) 0)
+ 'qt:byte-ref))
+ (5am:is (eql #\Null (cxx:operator[] const-array 0)))))
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-30 07:02:48.000000000 +0100
+++ new-qt.tests/src/signal-slot.lisp 2014-10-30 07:02:48.000000000 +0100
@@ -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