/ src /
/src/object.lisp
1 (in-package :qt.tests)
2
3 (5am:in-suite :qt.suite)
4
5 (5am:test test-children
6 "Test QList<Object*> to sequence conversion."
7 (let ((object (make-instance 'qt:object)))
8 (5am:is (= 0 (length (cxx:children object))))
9 (let ((children (mapcar #'(lambda (parent)
10 (make-instance 'qt:object :args (list parent)))
11 (list object object object))))
12 (5am:is (= (length children)
13 (length (cxx:children object))))
14 (dolist (c children)
15 (5am:is (find c (cxx:children object)))))))
16
17 (defclass my-multi-object (qt:object qt:graphics-item)
18 ()
19 (:metaclass cxx:class))
20
21 (5am:test multi-object
22 "Tests a custom object that has two C++ superclasses."
23 (let ((object (make-instance 'my-multi-object)))
24 (5am:is (string= "" (cxx:object-name object)))
25 (5am:is (= qt:graphics-item.+user-type+
26 (cxx:type object)))))