Skip to content

Commit cb7a790

Browse files
author
roman_yakovenko
committed
add new tester to check infinite loop
1 parent 2b4d02e commit cb7a790

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

unittests/data/indexing_suites2.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ namespace pyplusplus{ namespace aliases{
8585
typedef std::vector<indexing_suites2::item_t*> items_ptr_t;
8686
}}
8787

88+
namespace infinite_loop{
89+
std::map< std::string, int > test_infinite_loop();
90+
}
91+
8892
#endif//__indexing_suites2_to_be_exported_hpp__

unittests/find_container_traits_tester.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ def test_from_ogre( self ):
6565
x = 'map<std::string, bool (*)(std::string&, Ogre::MaterialScriptContext&), std::less<std::string>, std::allocator<std::pair<std::string const, bool (*)(std::string&, Ogre::MaterialScriptContext&)> > >'
6666
ct = declarations.find_container_traits( x )
6767
y = ct.remove_defaults( x )
68-
68+
69+
def test_infinite_loop(self):
70+
rt = self.global_ns.free_fun( 'test_infinite_loop' ).return_type
71+
map_traits = declarations.find_container_traits( rt )
72+
self.failUnless( map_traits is declarations.map_traits )
73+
elem = map_traits.element_type( rt )
74+
self.failUnless( elem.decl_string == 'int' )
75+
6976
def create_suite():
7077
suite = unittest.TestSuite()
7178
suite.addTest( unittest.makeSuite(tester_t))

0 commit comments

Comments
 (0)