Test ownership transfer of qt:connect to a no Smoke QObject instance.
Mon Jul 27 21:28:28 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test ownership transfer of qt:connect to a no Smoke QObject instance.
hunk ./src/click.lisp 11
- (kde::with-kde ("hello" "hello-world" "0.0.1")
- (let ((widget (make-instance 'my-widget))
- (click-count 0))
- (qt:connect (qt:get-signal widget "clicked()")
- #'(lambda ()
- (incf click-count)))
- [_$_]
- (cxx:set-text widget "Click Me")
+ (kde:with-kde ("hello" "hello-world" "0.0.1")
+ (let ((widget (make-instance 'my-widget))
+ (click-count 0))
+ (qt:connect (qt:get-signal widget "clicked()")
+ #'(lambda ()
+ (incf click-count)))
+ [_$_]
+ (cxx:set-text widget "Click Me")
hunk ./src/click.lisp 20
- (5am:is (= 0 click-count))
- (qt:test.mouse-click widget qt:+left-button+)
- (5am:is (= 1 click-count)))))
+ (5am:is (= 0 click-count))
+ (qt:test.mouse-click widget qt:+left-button+)
+ (5am:is (= 1 click-count)))))
hunk ./src/tests.lisp 9
- (5am:explain! results)
- (unless (5am:results-status results)
- (error "Testsuite :kde.suite failed."))))
+ (5am:explain! results)
+ (unless (5am:results-status results)
+ (error "Testsuite :kde.suite failed."))))
+
+(5am:test connect-to-non-smoke-qobject
+ "Test ownership transfer to a no Smoke QObject instance."
+ (kde:with-kde ("test" "test" "1")
+ (let* ((window (make-instance 'kde:push-button))
+ (action-collection (make-instance 'kde:action-collection
+ :arg0 window))
+ (counter 0)
+ (action (kde:make-standard-action kde:standard-action.+open+
+ action-collection
+ #'(lambda () (incf counter)))))
+ (tg:gc :full t)
+ (tg:gc :full t)
+ (5am:is (= 0 counter))
+ (cxx:activate action qt:action.+trigger+)
+ (5am:is (= 1 counter)))))
+ [_$_]