Test static member variable access using slot-value with a class object.
Annotate for file /src/properties.lisp
2009-04-02 tobias 1 (in-package :qt.tests)
22:17:02 ' 2
' 3 (5am:in-suite :qt.suite)
' 4
2009-04-06 tobias 5 (5am:test property-list
11:50:14 ' 6 "Test properties"
' 7 (5am:is (= 1 (length (qt:class-properties (find-class 'qt:object)))))
2009-06-11 tobias 8 (5am:is (= 1 (length (qt:properties (make-instance 'qt:object))))))
2009-04-02 tobias 9
22:17:02 ' 10 (5am:test (property :depends-on qstring)
' 11 "Tests get and set property string"
' 12 (let ((o (make-instance 'qt:object)))
' 13 (5am:is (eql t (qt:property-p o "objectName")))
2009-07-22 tobias 14 (5am:is (eql t (qt:property-p o :object-name)))
2009-04-02 tobias 15
2009-07-22 tobias 16 (setf (qt:property o :object-name) "fooBar")
22:22:47 ' 17 (5am:is (string= (qt:property o :object-name) "fooBar"))
2009-04-02 tobias 18 (5am:is (string= (qt:property o "objectName") "fooBar"))
2009-04-08 tobias 19 (5am:is (string= (cxx:object-name o) "fooBar"))
2009-04-02 tobias 20
22:17:02 ' 21 (5am:is (eql nil (qt:property-p o 'foo)))
' 22 (setf (qt:property o 'foo) "bar")
2009-05-27 tobias 23 (5am:is (= 2 (length (qt:properties o))))
17:28:53 ' 24 (5am:is (member 'foo (qt:properties o)))
2009-05-31 tobias 25 (5am:is (eq t (qt:property-p o 'foo)))
17:36:58 ' 26 (5am:is (string= (qt:property o 'foo) "bar"))
' 27
' 28 (qt:remove-property o 'foo)
' 29 (5am:is (eq nil (qt:property-p o 'foo)))))
2009-04-02 tobias 30
22:17:02 ' 31
' 32 (5am:test property-int
' 33 "Test get and set property integer"
' 34 (let ((o (make-instance 'qt:object)))
' 35 (5am:for-all ((integer (5am:gen-integer)))
' 36 (setf (qt:property o 'foo-bar) integer)
' 37 (5am:is (= integer (qt:property o 'foo-bar))))))
2010-04-03 tobias 38 (5am:test attributes
12:52:50 ' 39 "Test C++ attribute access with slot-* functions."
' 40 (let ((o (make-instance 'qt:object)))
' 41 (5am:is (slot-boundp o :static-meta-object))
2010-04-03 tobias 42 (5am:is (slot-boundp (find-class 'qt:object) :static-meta-object))
2010-04-03 tobias 43 (5am:is (string= "QObject"
12:52:50 ' 44 (cxx:class-name
' 45 (slot-value o :static-meta-object))))
2010-04-03 tobias 46 (5am:is (string= "QObject"
19:13:24 ' 47 (cxx:class-name
' 48 (slot-value (find-class 'qt:object)
' 49 :static-meta-object))))
2010-04-03 tobias 50 (5am:signals error
12:52:50 ' 51 (setf (slot-value o :static-meta-object)
' 52 (cffi:null-pointer))))
' 53 (let ((data (make-instance 'qt:shared-data)))
' 54 (5am:is (slot-boundp data :ref))
' 55 (5am:for-all ((value (5am:gen-integer :min -255 :max 255)))
' 56 (setf (slot-value data :ref) value)
' 57 (5am:is (cxx:= (slot-value data :ref) value)))))
' 58