Sat Apr 3 21:13:24 CEST 2010 Tobias Rautenkranz * Test static member variable access using slot-value with a class object. Sat Apr 3 14:52:50 CEST 2010 Tobias Rautenkranz * Test slot-value for C++ attributes. diff -rN -u old-qt.tests/src/properties.lisp new-qt.tests/src/properties.lisp --- old-qt.tests/src/properties.lisp 2014-11-17 16:04:58.000000000 +0100 +++ new-qt.tests/src/properties.lisp 2014-11-17 16:04:58.000000000 +0100 @@ -35,3 +35,24 @@ (5am:for-all ((integer (5am:gen-integer))) (setf (qt:property o 'foo-bar) integer) (5am:is (= integer (qt:property o 'foo-bar)))))) + +(5am:test attributes + "Test C++ attribute access with slot-* functions." + (let ((o (make-instance 'qt:object))) + (5am:is (slot-boundp o :static-meta-object)) + (5am:is (slot-boundp (find-class 'qt:object) :static-meta-object)) + (5am:is (string= "QObject" + (cxx:class-name + (slot-value o :static-meta-object)))) + (5am:is (string= "QObject" + (cxx:class-name + (slot-value (find-class 'qt:object) + :static-meta-object)))) + (5am:signals error + (setf (slot-value o :static-meta-object) + (cffi:null-pointer)))) + (let ((data (make-instance 'qt:shared-data))) + (5am:is (slot-boundp data :ref)) + (5am:for-all ((value (5am:gen-integer :min -255 :max 255))) + (setf (slot-value data :ref) value) + (5am:is (cxx:= (slot-value data :ref) value)))))