Test multiple C++ superclasses.
Sun Aug 30 16:18:04 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test multiple C++ superclasses.
diff -rN -u old-qt.tests/qt.tests.mbd new-qt.tests/qt.tests.mbd
--- old-qt.tests/qt.tests.mbd 2014-10-30 07:02:46.000000000 +0100
+++ new-qt.tests/qt.tests.mbd 2014-10-30 07:02:46.000000000 +0100
@@ -17,7 +17,7 @@
("qbytearray" (:needs "tests"))
("qstring" (:needs "tests"))
("overload" (:needs "tests"))
- ("gc" (:needs "tests"))
+ ("gc" (:needs "tests" "object"))
("variant" (:needs "tests"))
("application" (:needs "tests"))
("signal-slot" (:needs "tests"))
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:46.000000000 +0100
+++ new-qt.tests/src/gc.lisp 2014-10-30 07:02:46.000000000 +0100
@@ -16,9 +16,8 @@
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))
@@ -38,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))
diff -rN -u old-qt.tests/src/object.lisp new-qt.tests/src/object.lisp
--- old-qt.tests/src/object.lisp 2014-10-30 07:02:46.000000000 +0100
+++ new-qt.tests/src/object.lisp 2014-10-30 07:02:46.000000000 +0100
@@ -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)))))