Updates for the new smokegenerator.
Annotate for file /src/click.lisp
2009-04-02 tobias 1 (in-package :qt.tests)
22:17:02 ' 2
' 3 (5am:in-suite :qt.suite)
' 4
' 5 (defclass click-test-widget (qt:push-button)
' 6 ()
' 7 (:metaclass cxx:class))
' 8
' 9 (5am:test (click-test :depends-on with-app)
' 10 "Test clicking a button."
2009-07-01 tobias 11 (qt:with-app ()
2009-04-02 tobias 12 (let ((widget (make-instance 'click-test-widget))
22:17:02 ' 13 (click-count 0))
' 14 (qt:connect (qt:get-signal widget "clicked()")
' 15 #'(lambda ()
2009-04-08 tobias 16 (5am:is (eq widget (qt:sender)))
2009-04-02 tobias 17 (incf click-count)))
2009-07-01 tobias 18
2009-04-02 tobias 19 (cxx:set-text widget "Hello World")
22:17:02 ' 20 (5am:is (string= "Hello World" (cxx:text widget)))
' 21
' 22 (5am:is (= 0 click-count))
2009-08-27 tobias 23 (qt:test.mouse-click widget qt:+left-button+
08:41:11 ' 24 0 (make-instance 'qt:point) -1)
2009-04-02 tobias 25 (5am:is (= 1 click-count))
2009-08-27 tobias 26 (qt:test.mouse-click widget qt:+right-button+
08:41:11 ' 27 0 (make-instance 'qt:point) -1)
2009-04-02 tobias 28 (5am:is (= 1 click-count)))))
22:17:02 ' 29
' 30 (5am:test (click-test-bool :depends-on click-test)
' 31 "Test clicking a button (bool argument)."
2009-07-01 tobias 32 (qt:with-app ()
2009-04-02 tobias 33 (let ((widget (make-instance 'click-test-widget))
22:17:02 ' 34 (click-count 0))
' 35 (qt:connect (qt:get-signal widget "clicked(bool)")
' 36 #'(lambda (checked)
2009-04-08 tobias 37 (5am:is (eql nil checked))
2009-04-02 tobias 38 (incf click-count)))
22:17:02 ' 39 (5am:is (= 0 click-count))
2009-08-27 tobias 40 (qt:test.mouse-click widget qt:+left-button+
08:41:11 ' 41 0 (make-instance 'qt:point) -1)
2009-04-02 tobias 42 (5am:is (= 1 click-count))
2009-08-27 tobias 43 (qt:test.mouse-click widget qt:+left-button+
08:41:11 ' 44 0 (make-instance 'qt:point) -1)
2009-04-02 tobias 45 (5am:is (= 2 click-count)))))
22:17:02 ' 46
2009-06-05 tobias 47 (5am:test (click-test-bool-this :depends-on click-test)
07:52:01 ' 48 "Test clicking a button (bool argument) for a function with this argument."
2009-07-01 tobias 49 (qt:with-app ()
2009-06-05 tobias 50 (let ((widget (make-instance 'click-test-widget))
07:52:01 ' 51 (click-count 0))
' 52 (qt:connect (qt:get-signal widget "clicked(bool)")
' 53 (qt:get-slot widget
' 54 #'(lambda (object checked)
' 55 (5am:is (eq nil checked))
' 56 (5am:is (eq widget object))
' 57 (incf click-count))))
' 58 (5am:is (= 0 click-count))
2009-08-27 tobias 59 (qt:test.mouse-click widget qt:+left-button+
08:41:11 ' 60 0 (make-instance 'qt:point) -1)
2009-06-05 tobias 61 (5am:is (= 1 click-count))
2009-08-27 tobias 62 (qt:test.mouse-click widget qt:+left-button+
08:41:11 ' 63 0 (make-instance 'qt:point) -1)
2009-06-05 tobias 64 (5am:is (= 2 click-count)))))