diff --git a/test/test_map_plain.py b/test/test_map_plain.py index 3495081a..b492578b 100644 --- a/test/test_map_plain.py +++ b/test/test_map_plain.py @@ -20,7 +20,7 @@ '''>>> from testnonlinear import * >>> setTrace(0) ->>> m = Map() # std::map +>>> m = Map() # std::map >>> m["hello"] = 1 # Insert entry >>> print m["hello"] # Lookup entry 1 diff --git a/test/testlinear.cpp b/test/testlinear.cpp index ba1c427a..2663cbee 100755 --- a/test/testlinear.cpp +++ b/test/testlinear.cpp @@ -16,7 +16,7 @@ // $Id$ // -#include "IntWrapper.hpp" +#include "int_wrapper.hpp" #include #include @@ -32,22 +32,23 @@ #include #include -bool IntWrapper::gIntWrapperTrace = true; -unsigned IntWrapper::ourObjectCounter = 0; +// More messiness from not having a separate int_wrapper.cpp file +bool int_wrapper::our_trace_flag = true; +unsigned int_wrapper::our_object_counter = 0; -boost::python::indexing::iterator_pair getArray() +boost::python::indexing::iterator_pair getArray() { - static IntWrapper array[] = { - IntWrapper(8), IntWrapper(6), IntWrapper(4), IntWrapper(2) - , IntWrapper(1), IntWrapper(3), IntWrapper(5) - , IntWrapper(7), IntWrapper(0) }; + static int_wrapper array[] = { + int_wrapper(8), int_wrapper(6), int_wrapper(4), int_wrapper(2) + , int_wrapper(1), int_wrapper(3), int_wrapper(5) + , int_wrapper(7), int_wrapper(0) }; - return boost::python::indexing::iterator_pair + return boost::python::indexing::iterator_pair (boost::python::indexing::begin(array) , boost::python::indexing::end(array)); } -std::string repr (IntWrapper const &i) +std::string repr (int_wrapper const &i) { std::stringstream temp; temp << i; @@ -56,12 +57,12 @@ std::string repr (IntWrapper const &i) BOOST_PYTHON_MODULE(testlinear) { - boost::python::implicitly_convertible (); + boost::python::implicitly_convertible (); - boost::python::def ("setTrace", &IntWrapper::setTrace); + boost::python::def ("setTrace", &int_wrapper::setTrace); - boost::python::class_ ("IntWrapper", boost::python::init()) - .def ("increment", &IntWrapper::increment) + boost::python::class_ ("int_wrapper", boost::python::init()) + .def ("increment", &int_wrapper::increment) .def ("__repr__", repr) .def ("__cmp__", compare) ; @@ -73,20 +74,20 @@ BOOST_PYTHON_MODULE(testlinear) .def ("reserve", &Container1::reserve) ; - typedef std::list Container2; + typedef std::list Container2; boost::python::class_("List") .def (boost::python::indexing::container_suite()); - typedef boost::python::indexing::iterator_pair Container3; + typedef boost::python::indexing::iterator_pair Container3; boost::python::class_ - ("Array", boost::python::init()) + ("Array", boost::python::init()) .def (boost::python::indexing::container_suite()); boost::python::def ("getArray", getArray); - typedef std::vector Container4; + typedef std::vector Container4; // Returning internal references to elements of a vector is // dangerous! The references can be invalidated by inserts or @@ -95,7 +96,7 @@ BOOST_PYTHON_MODULE(testlinear) .def (boost::python::indexing::container_suite ::with_policies (boost::python::return_internal_reference<>())); - typedef boost::python::indexing::container_proxy< std::vector > + typedef boost::python::indexing::container_proxy< std::vector > Container5; boost::python::class_("Vector_proxy") diff --git a/test/testnonlinear.cpp b/test/testnonlinear.cpp index 1c9ca60f..0101708a 100755 --- a/test/testnonlinear.cpp +++ b/test/testnonlinear.cpp @@ -15,7 +15,7 @@ // $Id$ // -#include "IntWrapper.hpp" +#include "int_wrapper.hpp" #include #include @@ -28,10 +28,11 @@ #include #include -bool IntWrapper::gIntWrapperTrace = true; -unsigned IntWrapper::ourObjectCounter = 0; +// More messiness from not having a separate int_wrapper.cpp file +bool int_wrapper::our_trace_flag = true; +unsigned int_wrapper::our_object_counter = 0; -std::string repr (IntWrapper const &i) +std::string repr (int_wrapper const &i) { std::stringstream temp; temp << i; @@ -40,17 +41,17 @@ std::string repr (IntWrapper const &i) BOOST_PYTHON_MODULE(testnonlinear) { - boost::python::implicitly_convertible (); + boost::python::implicitly_convertible (); - boost::python::def ("setTrace", &IntWrapper::setTrace); + boost::python::def ("setTrace", &int_wrapper::setTrace); - boost::python::class_ ("IntWrapper", boost::python::init()) - .def ("increment", &IntWrapper::increment) + boost::python::class_ ("int_wrapper", boost::python::init()) + .def ("increment", &int_wrapper::increment) .def ("__repr__", repr) .def ("__cmp__", compare) ; - typedef std::map Container1; + typedef std::map Container1; typedef std::set Container2; #if !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION