[pygccxml-commit] SF.net SVN: pygccxml:[1688] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-02-17 19:30:55
|
Revision: 1688 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1688&view=rev Author: roman_yakovenko Date: 2009-02-17 19:30:51 +0000 (Tue, 17 Feb 2009) Log Message: ----------- adding new test cases Added Paths: ----------- pyplusplus_dev/unittests/data/indexing_suite_v1_to_be_exported.hpp pyplusplus_dev/unittests/data/virtual_inheritance_to_be_exported.hpp pyplusplus_dev/unittests/indexing_suite_v1_tester.py pyplusplus_dev/unittests/virtual_inheritance_tester.py Added: pyplusplus_dev/unittests/data/indexing_suite_v1_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/indexing_suite_v1_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/indexing_suite_v1_to_be_exported.hpp 2009-02-17 19:30:51 UTC (rev 1688) @@ -0,0 +1,23 @@ +// Copyright 2004-2008 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __indexing_suite_v1__to_be_exported_hpp__ +#define __indexing_suite_v1__to_be_exported_hpp__ + +#include <vector> +#include "boost/shared_ptr.hpp" + +typedef std::vector< boost::shared_ptr< unsigned short* > > ushort_sptr_ptr_t; + +inline ushort_sptr_ptr_t get_empty(){ + ushort_sptr_ptr_t x; + typedef unsigned short ushort; + ushort * y = new ushort(5); + ushort ** yy = new ushort*( y ); + x.push_back( boost::shared_ptr< unsigned short* >( yy ) ); + return x; +} + +#endif//__indexing_suite_v1__to_be_exported_hpp__ Added: pyplusplus_dev/unittests/data/virtual_inheritance_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/virtual_inheritance_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/virtual_inheritance_to_be_exported.hpp 2009-02-17 19:30:51 UTC (rev 1688) @@ -0,0 +1,17 @@ +// Copyright 2004-2008 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __virtual_inheritance_to_be_exported_hpp__ +#define __virtual_inheritance_to_be_exported_hpp__ + +struct base{ + virtual void do_smth() {} +}; + +struct derived : virtual public base +{ +}; + +#endif//__virtual_inheritance_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/indexing_suite_v1_tester.py =================================================================== --- pyplusplus_dev/unittests/indexing_suite_v1_tester.py (rev 0) +++ pyplusplus_dev/unittests/indexing_suite_v1_tester.py 2009-02-17 19:30:51 UTC (rev 1688) @@ -0,0 +1,49 @@ +# Copyright 2004-2008 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys +import unittest +import autoconfig +from pyplusplus import utils +import fundamental_tester_base +from pygccxml import declarations +from pyplusplus import module_builder +from pyplusplus.module_builder import call_policies + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'indexing_suite_v1' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , indexing_suite_version=1 + , *args ) + self.files = [] + + def customize( self, mb ): + v = mb.class_( lambda x: x.name.startswith( 'vector' ) ) + v.exclude() + + def run_tests(self, module): + x = module.get_empty() + try: + for i in x: + print i + self.fail( "TypeError exception was not raised" ) + except TypeError: + pass + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() Added: pyplusplus_dev/unittests/virtual_inheritance_tester.py =================================================================== --- pyplusplus_dev/unittests/virtual_inheritance_tester.py (rev 0) +++ pyplusplus_dev/unittests/virtual_inheritance_tester.py 2009-02-17 19:30:51 UTC (rev 1688) @@ -0,0 +1,33 @@ +# Copyright 2004-2008 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys +import unittest +import fundamental_tester_base + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'virtual_inheritance' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + + def run_tests( self, module): + pass + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |