Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r62589:381e15c68488
Date: 2013-03-20 15:23 -0700
http://bitbucket.org/pypy/pypy/changeset/381e15c68488/
Log: object validity behavior tests
diff --git a/pypy/module/cppyy/test/datatypes.cxx
b/pypy/module/cppyy/test/datatypes.cxx
--- a/pypy/module/cppyy/test/datatypes.cxx
+++ b/pypy/module/cppyy/test/datatypes.cxx
@@ -224,3 +224,7 @@
cppyy_test_pod* get_global_pod() {
return g_pod;
}
+
+cppyy_test_pod* get_null_pod() {
+ return (cppyy_test_pod*)0;
+}
diff --git a/pypy/module/cppyy/test/datatypes.h
b/pypy/module/cppyy/test/datatypes.h
--- a/pypy/module/cppyy/test/datatypes.h
+++ b/pypy/module/cppyy/test/datatypes.h
@@ -225,3 +225,4 @@
bool is_global_pod(cppyy_test_pod* t);
void set_global_pod(cppyy_test_pod* t);
cppyy_test_pod* get_global_pod();
+cppyy_test_pod* get_null_pod();
diff --git a/pypy/module/cppyy/test/datatypes_LinkDef.h
b/pypy/module/cppyy/test/datatypes_LinkDef.h
--- a/pypy/module/cppyy/test/datatypes_LinkDef.h
+++ b/pypy/module/cppyy/test/datatypes_LinkDef.h
@@ -19,6 +19,7 @@
#pragma link C++ function is_global_pod(cppyy_test_pod*);
#pragma link C++ function set_global_pod(cppyy_test_pod*);
#pragma link C++ function get_global_pod();
+#pragma link C++ function get_null_pod();
#pragma link C++ global N;
#pragma link C++ global g_int;
diff --git a/pypy/module/cppyy/test/test_datatypes.py
b/pypy/module/cppyy/test/test_datatypes.py
--- a/pypy/module/cppyy/test/test_datatypes.py
+++ b/pypy/module/cppyy/test/test_datatypes.py
@@ -583,7 +583,21 @@
c.destruct()
- def test16_buffer_reshaping(self):
+ def test16_object_validity(self):
+ """Test object validity checking"""
+
+ from cppyy import gbl
+
+ d = gbl.cppyy_test_pod()
+
+ assert d
+ assert not not d
+
+ d2 = gbl.get_null_pod()
+
+ assert not d2
+
+ def test17_buffer_reshaping(self):
"""Test usage of buffer sizing"""
import cppyy
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit