Test qt.opengl conversions. --> to head
/cl-smoke.qt.tests.asd
Ignoring non-repository paths: /cl-smoke.qt.tests.asd
Sat Apr 3 21:13:24 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test static member variable access using slot-value with a class object.
Sat Apr 3 14:52:50 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test slot-value for C++ attributes.
Sat Apr 3 14:50:36 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test qt.opengl conversions.
diff -rN -u old-qt.tests/cl-smoke.qt.tests.asd new-qt.tests/cl-smoke.qt.tests.asd
--- old-qt.tests/cl-smoke.qt.tests.asd 2014-10-30 08:00:50.000000000 +0100
+++ new-qt.tests/cl-smoke.qt.tests.asd 2014-10-30 08:00:50.000000000 +0100
@@ -4,7 +4,8 @@
:author "Tobias Rautenkranz"
:license "GPL with linking exception"
:description "Qt unit tests."
- :depends-on (:cl-smoke.qt.test :cl-smoke.qt.gui :FiveAM :trivial-garbage :cl-smoke.smoke)
+ :depends-on (:cl-smoke.qt.test :cl-smoke.qt.gui :cl-smoke.qt.opengl
+ :FiveAM :trivial-garbage :cl-smoke.smoke)
:components
((:module "src"
@@ -17,6 +18,7 @@
(:file "qlist" :depends-on ("tests"))
(:file "graphics-item" :depends-on ("tests"))
(:file "overload" :depends-on ("tests"))
+ (:file "opengl" :depends-on ("tests"))
(:file "gc" :depends-on ("tests" "object"))
(:file "variant" :depends-on ("tests"))
(:file "application" :depends-on ("tests"))
diff -rN -u old-qt.tests/src/opengl.lisp new-qt.tests/src/opengl.lisp
--- old-qt.tests/src/opengl.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.tests/src/opengl.lisp 2014-10-30 08:00:50.000000000 +0100
@@ -0,0 +1,24 @@
+(in-package :qt.tests)
+
+(5am:in-suite :qt.suite)
+
+(5am:test gluint
+ "GLuint conversion"
+ (qt:with-app ()
+ (let* ((texture (make-instance 'qt:pixmap))
+ (gl-widget (make-instance 'qt:glwidget))
+ (id (cxx:bind-texture gl-widget texture)))
+ (5am:is (typep id '(integer 0)))
+ (cxx:delete-texture gl-widget id))))
+
+
+(5am:test glint
+ "Test GLint and GLenum conversion."
+ (qt:with-app ()
+ (let* ((texture (make-instance 'qt:pixmap))
+ (target 3553) ;(cffi:foreign-enum-value '%gl:enum :texture-2d))
+ (format 6409) ;(cffi:foreign-enum-value '%gl:enum :rgba))
+ (gl-widget (make-instance 'qt:glwidget))
+ (id (cxx:bind-texture gl-widget texture target format)))
+ (5am:is (typep id '(integer 0)))
+ (cxx:delete-texture gl-widget id))))
diff -rN -u old-qt.tests/src/properties.lisp new-qt.tests/src/properties.lisp
--- old-qt.tests/src/properties.lisp 2014-10-30 08:00:50.000000000 +0100
+++ new-qt.tests/src/properties.lisp 2014-10-30 08:00:50.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)))))