Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r62765:9cbb25a33305
Date: 2013-03-25 11:56 -0700
http://bitbucket.org/pypy/pypy/changeset/9cbb25a33305/

Log:    add test for operator int/long/float converter

diff --git a/pypy/module/cppyy/test/test_advancedcpp.py 
b/pypy/module/cppyy/test/test_advancedcpp.py
--- a/pypy/module/cppyy/test/test_advancedcpp.py
+++ b/pypy/module/cppyy/test/test_advancedcpp.py
@@ -591,6 +591,23 @@
         assert len(a) == 1
         assert a[0].m_i == 42
 
-       # a[0] = gbl.ref_tester(33)
-       # assert len(a) == 1
-       # assert a[0].m_i == 33
+        # TODO:
+        # a[0] = gbl.ref_tester(33)
+        # assert len(a) == 1
+        # assert a[0].m_i == 33
+
+    def test19_math_converters(self):
+        """Test operator int/long/double incl. typedef"""
+
+        from cppyy import gbl
+
+        a = gbl.some_convertible()
+        a.m_i = 1234
+        a.m_d = 4321.
+
+        assert int(a)  == 1234
+        assert int(a)  == a.m_i
+        assert long(a) == a.m_i
+
+        assert float(a) == 4321.
+        assert float(a) == a.m_d
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to