[pygccxml-commit] SF.net SVN: pygccxml:[1699] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2009-04-08 21:10:48
|
Revision: 1699
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1699&view=rev
Author: roman_yakovenko
Date: 2009-04-08 21:10:42 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
adding new test case
Modified Paths:
--------------
pyplusplus_dev/unittests/test_all.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/derive_from_deque_to_be_exported.hpp
pyplusplus_dev/unittests/derive_from_deque_tester.py
Added: pyplusplus_dev/unittests/data/derive_from_deque_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/derive_from_deque_to_be_exported.hpp (rev 0)
+++ pyplusplus_dev/unittests/data/derive_from_deque_to_be_exported.hpp 2009-04-08 21:10:42 UTC (rev 1699)
@@ -0,0 +1,45 @@
+// 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 __derive_from_deque_to_be_exported_hpp__
+#define __derive_from_deque_to_be_exported_hpp__
+
+#include <iostream>
+#include <vector>
+#include <deque>
+
+
+struct A{
+ A(int a, int b)
+ : a_(a),b_(b)
+ {}
+
+ int a_;
+ int b_;
+
+ int compute(){return a_ + b_;}
+};
+
+struct C : A{
+
+ C(int a, int b)
+ : A(a,b)
+ {}
+};
+
+namespace pyplusplus{ namespace aliases{
+
+ typedef std::deque< C > CDeque;
+ void instantiate( std::deque<C> d){
+ }
+} }
+
+struct F : public std::deque<C>
+{
+ F(){}
+ int dlugosc() {return this->size();}
+};
+
+#endif//__derive_from_deque_to_be_exported_hpp__
Added: pyplusplus_dev/unittests/derive_from_deque_tester.py
===================================================================
--- pyplusplus_dev/unittests/derive_from_deque_tester.py (rev 0)
+++ pyplusplus_dev/unittests/derive_from_deque_tester.py 2009-04-08 21:10:42 UTC (rev 1699)
@@ -0,0 +1,45 @@
+# 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
+from pygccxml import declarations
+from pyplusplus import module_builder
+
+
+class tester_t(fundamental_tester_base.fundamental_tester_base_t):
+ EXTENSION_NAME = 'derive_from_deque'
+
+ def __init__( self, *args ):
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
+ self
+ , tester_t.EXTENSION_NAME
+ , indexing_suite_version=2
+ , *args)
+
+ def customize(self, mb):
+ pass
+ #~ mb.class_( 'deque<C>' ).include()
+
+
+ def run_tests( self, module):
+ c = module.C( 1,2)
+ f = module.F()
+ f.append(c)
+ c2 = f[0]
+ self.failUnless( c2.a_ == c.a_ and c2.b_ == c.b_ )
+
+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()
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2009-03-03 13:57:49 UTC (rev 1698)
+++ pyplusplus_dev/unittests/test_all.py 2009-04-08 21:10:42 UTC (rev 1699)
@@ -113,6 +113,7 @@
import indexing_suites_v2_bug_tester
import virtual_inheritance_tester
import indexing_suite_v1_tester
+import derive_from_deque_tester
#import ogre_generate_tester
testers = [
@@ -215,7 +216,8 @@
, refee_refer_tester
, indexing_suites_v2_bug_tester
, virtual_inheritance_tester
- , indexing_suite_v1_tester
+ , indexing_suite_v1_tester
+ , derive_from_deque_tester
# , ogre_generate_tester too much time
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|