Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54868 - sandbox-branches/bhy/py3k/libs/python/test
From: divinekid_at_[hidden]
Date: 2009-07-10 13:36:08


Author: bhy
Date: 2009-07-10 13:36:07 EDT (Fri, 10 Jul 2009)
New Revision: 54868
URL: http://svn.boost.org/trac/boost/changeset/54868

Log:
fix map_indexing_suite test case
Text files modified:
   sandbox-branches/bhy/py3k/libs/python/test/a_map_indexing_suite.cpp | 8 ++++++++
   sandbox-branches/bhy/py3k/libs/python/test/map_indexing_suite.py | 2 +-
   2 files changed, 9 insertions(+), 1 deletions(-)

Modified: sandbox-branches/bhy/py3k/libs/python/test/a_map_indexing_suite.cpp
==============================================================================
--- sandbox-branches/bhy/py3k/libs/python/test/a_map_indexing_suite.cpp (original)
+++ sandbox-branches/bhy/py3k/libs/python/test/a_map_indexing_suite.cpp 2009-07-10 13:36:07 EDT (Fri, 10 Jul 2009)
@@ -48,7 +48,11 @@
 
   static void* convertible(PyObject* obj_ptr)
   {
+#if PY_VERSION_HEX >= 0x03000000
+ if (!PyLong_Check(obj_ptr)) return 0;
+#else
     if (!PyInt_Check(obj_ptr)) return 0;
+#endif
     return obj_ptr;
   }
 
@@ -60,7 +64,11 @@
         (boost::python::converter::rvalue_from_python_storage< A >*)
         data)-> storage.bytes;
 
+#if PY_VERSION_HEX >= 0x03000000
+ new (storage) A((int)PyLong_AsLong(obj_ptr));
+#else
     new (storage) A((int)PyInt_AsLong(obj_ptr));
+#endif
     data->convertible = storage;
   }
 };

Modified: sandbox-branches/bhy/py3k/libs/python/test/map_indexing_suite.py
==============================================================================
--- sandbox-branches/bhy/py3k/libs/python/test/map_indexing_suite.py (original)
+++ sandbox-branches/bhy/py3k/libs/python/test/map_indexing_suite.py 2009-07-10 13:36:07 EDT (Fri, 10 Jul 2009)
@@ -197,7 +197,7 @@
>>> tm["kimpo"] = X("bbb")
>>> print_xmap(tm)
 [ (joel, aaa) (kimpo, bbb) ]
->>> for el in tm:
+>>> for el in tm: #doctest: +NORMALIZE_WHITESPACE
 ... print el.key(),
 ... dom = el.data()
 joel kimpo


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk