[pypy-commit] pypy reflex-support: add a few more ROOT-based tests for completeness

wlav noreply at buildbot.pypy.org
Wed Mar 20 23:51:59 CET 2013


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r62590:bae554d4296a
Date: 2013-03-20 15:50 -0700
http://bitbucket.org/pypy/pypy/changeset/bae554d4296a/

Log:	add a few more ROOT-based tests for completeness

diff --git a/pypy/module/cppyy/test/test_cint.py b/pypy/module/cppyy/test/test_cint.py
--- a/pypy/module/cppyy/test/test_cint.py
+++ b/pypy/module/cppyy/test/test_cint.py
@@ -470,3 +470,40 @@
 
         assert not t2
 
+    def test05_element_access(self):
+        """Test access to elements in matrix and array objects."""
+
+        from cppyy import gbl
+
+        N = 3
+        v = gbl.TVectorF(N)
+        m = gbl.TMatrixD(N, N)
+
+        for i in range(N):
+            assert v[i] == 0.0
+
+            for j in range(N):
+                assert m[i][j] == 0.0
+
+    def test06_static_function_call( self ):
+        """Test call to static function."""
+
+        import cppyy
+        TROOT, gROOT = cppyy.gbl.TROOT, cppyy.gbl.gROOT
+
+        c1 = TROOT.Class()
+        assert not not c1
+
+        c2 = gROOT.Class()
+
+        assert c1 == c2
+
+        old = gROOT.GetDirLevel()
+        TROOT.SetDirLevel(2)
+        assert 2 == gROOT.GetDirLevel()
+        gROOT.SetDirLevel(old)
+
+        old = TROOT.GetDirLevel()
+        gROOT.SetDirLevel(3)
+        assert 3 == TROOT.GetDirLevel()
+        TROOT.SetDirLevel(old)


More information about the pypy-commit mailing list