[pygccxml-commit] SF.net SVN: pygccxml: [509] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-09-03 10:55:20
|
Revision: 509 http://svn.sourceforge.net/pygccxml/?rev=509&view=rev Author: roman_yakovenko Date: 2006-09-03 03:55:07 -0700 (Sun, 03 Sep 2006) Log Message: ----------- adding basic unit test for FT functionality Added Paths: ----------- pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp pyplusplus_dev/unittests/function_transformations_tester.py Added: pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp 2006-09-03 10:55:07 UTC (rev 509) @@ -0,0 +1,35 @@ +// Copyright 2004 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 __function_transformations_to_be_exported_hpp__ +#define __function_transformations_to_be_exported_hpp__ + +namespace ft{ + +struct image_t{ + + image_t( unsigned int& h, unsigned int& w ) + : m_height( h ) + , m_width( w ) + {} + + void get_size( unsigned int& h, unsigned int& w ){ + h = m_height; + w = m_width; + } + + unsigned int m_width; + unsigned int m_height; + +}; + +inline void +get_image_size( image_t& img, unsigned int& h, unsigned int& w ){ + img.get_size( h, w ); +} + +} + +#endif//__function_transformations_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/function_transformations_tester.py =================================================================== --- pyplusplus_dev/unittests/function_transformations_tester.py (rev 0) +++ pyplusplus_dev/unittests/function_transformations_tester.py 2006-09-03 10:55:07 UTC (rev 509) @@ -0,0 +1,38 @@ +# Copyright 2004 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 = 'function_transformations' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + image = mb.class_( "image_t" ) + pass + + def run_tests(self, module): + img = module.image_t( 2, 6) + h,w = img.get_size() + self.failUnless( h == 2 and w == 6 ) + +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. |