2009/4/16 Roman Yakovenko <roman.yakove...@gmail.com>:

> !  test (deepcopy_tester.tester_t)  -  FAIL

>I would like to see the error. Basically that test checks that
>exception is raised in "copy.deepcopy" function.

Here you are:




140736560794048
140736560794032
140736560794016
FAIL

======================================================================
FAIL: test (__main__.tester_t)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 153, in test
    self.run_tests(pypp)
  File "deepcopy_tester.py", line 30, in run_tests
    self.failIfNotRaisesAny( copy.deepcopy,  items )
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 50, in failIfNotRaisesAny
    self.failUnless(was_exception, 'exception has not been raised
during execution.')
AssertionError: exception has not been raised during execution.





> !  test (virtual_inheritance_tester.tester_t)  -  ERROR

>The test is very simple, it checks that Py++ generates the right code.
>It is interesting to see the error.

That's the log of compilation errors you asked:




g++ -o virtual_inheritance.os -c -fPIC -I/usr/include/boost
-I/usr/include/python2.5 -I.
-I/home/mnowotka/pygccxml/pyplusplus_dev/unittests/data
virtual_inheritance.cpp
/usr/include/boost/python/class.hpp: In static member function 'static
void boost::python::detail::error::virtual_function_default<T,
Fn>::must_be_derived_class_member(const Default&) [with Default = void
(derived_wrapper::*)(), T = derived_wrapper, Fn = void (base::*)()]':
/usr/include/boost/python/class.hpp:565:   instantiated from 'void
boost::python::class_<T, X1, X2, X3>::def_default(const char*, Fn,
const Helper&, mpl_::bool_<true>) [with Fn = void (base::*)(), Helper
= boost::python::detail::def_helper<void (derived_wrapper::*)(),
boost::python::detail::not_specified,
boost::python::detail::not_specified,
boost::python::detail::not_specified>, W = derived_wrapper, X1 =
boost::python::bases<base, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_>, X2 = boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]'
/usr/include/boost/python/class.hpp:548:   instantiated from 'void
boost::python::class_<T, X1, X2, X3>::def_impl(T*, const char*, Fn,
const Helper&, ...) [with T = derived, Fn = void (base::*)(), Helper =
boost::python::detail::def_helper<void (derived_wrapper::*)(),
boost::python::detail::not_specified,
boost::python::detail::not_specified,
boost::python::detail::not_specified>, W = derived_wrapper, X1 =
boost::python::bases<base, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_>, X2 = boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]'
/usr/include/boost/python/class.hpp:608:   instantiated from 'void
boost::python::class_<T, X1, X2, X3>::def_maybe_overloads(const char*,
Fn, const A1&, ...) [with Fn = void (base::*)(), A1 = void
(derived_wrapper::*)(), W = derived_wrapper, X1 =
boost::python::bases<base, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_>, X2 = boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]'
/usr/include/boost/python/class.hpp:244:   instantiated from
'boost::python::class_<T, X1, X2, X3>& boost::python::class_<T, X1,
X2, X3>::def(const char*, A1, const A2&) [with A1 = void (base::*)(),
A2 = void (derived_wrapper::*)(), W = derived_wrapper, X1 =
boost::python::bases<base, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_,
mpl_::void_>, X2 = boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]'
virtual_inheritance.cpp:85:   instantiated from here
/usr/include/boost/python/class.hpp:146: error: pointer to member
conversion via virtual base 'base'
scons: *** [virtual_inheritance.os] Error 1
scons: building terminated because of errors.

ERROR

======================================================================
ERROR: test (__main__.tester_t)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 151, in test
    autoconfig.scons_config.compile( autoconfig.scons.cmd_build + '
--file=%s' % self.__generated_scons_file_name )
  File "/home/mnowotka/pygccxml/pyplusplus_dev/unittests/autoconfig.py",
line 95, in compile
    raise RuntimeError( "unable to compile extension. See output for
the errors." )
RuntimeError: unable to compile extension. See output for the errors.

----------------------------------------------------------------------
Ran 1 test in 2.188s





I think that it is worth to mention that I work on ubuntu 8.10.

>Please open ticket on SourceForge, so I could add this functionality
>before next release.

OK:
http://sourceforge.net/tracker/?func=detail&aid=2768337&group_id=118209&atid=684321

When could I expect next release? I guess you are busy.

>I committed new test:
>http://pygccxml.svn.sourceforge.net/viewvc/pygccxml?view=rev

OK, test passed but:

1. If I change run_tests method defined in std_pair_tester to:

 def run_tests( self, module):
        pairA = module.pair_less__int_comma__int__greater_(2,3)
        pairB = module.pair_less__int_comma__int__greater_(2,3)
        self.failUnless( pairA.first == pairB.first and pairA.second == 
pairB.second )
        self.failUnless( pairA == pairB )

I get:

Traceback (most recent call last):
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 153, in test
    self.run_tests(pypp)
  File "std_pair_tester.py", line 29, in run_tests
    self.failUnless( pairA == pairB )
AssertionError



2. When I add indexing_suite_version=2 parameter to __init__ in
std_pair_tester.py I get an error:

Traceback (most recent call last):
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 148, in test
    self._create_extension_source_file()
  File 
"/home/mnowotka/pygccxml/pyplusplus_dev/unittests/fundamental_tester_base.py",
line 105, in _create_extension_source_file
    , compiler=autoconfig.cxx_parsers_cfg.gccxml.compiler)
  File 
"/usr/lib/python2.5/site-packages/pyplusplus/module_builder/boost_python_builder.py",
line 95, in __init__
    , indexing_suite_version)
  File 
"/usr/lib/python2.5/site-packages/pyplusplus/module_builder/boost_python_builder.py",
line 149, in __parse_declarations
    for cls in global_ns.decls(decl_type=decls_package.class_declaration_t):
  File "/usr/lib/python2.5/site-packages/pygccxml/declarations/scopedef.py",
line 399, in decls
    , allow_empty=allow_empty)
  File "/usr/lib/python2.5/site-packages/pygccxml/declarations/scopedef.py",
line 377, in _find_multiple
    raise RuntimeError( "Multi declaration query returned 0 declarations." )
RuntimeError: Multi declaration query returned 0 declarations.





>The short version: if you cant select the desired class, than check it
>name first and than use it:

>mb = module_builder_t( ... )
>pair = mb.classes( lambda cls: cls.name.startswith( 'pair' ) )
>for p in pair:
>   print p.name

OK, so in my project I found classes names:

pair<std::string, double>
pair<std::string, int>

and included it:

mb.class_('pair<std::string, double>').include()
mb.class_('pair<std::string, int>').include()

Now, warnings dissapeared but in generated wrapper code file
"indexing_suite/pair.hpp" is not included (although I have
indexing_suite_version=2 set).
Luckily i don't get error like in std_pair_tester.py when using second
version of indexing suite.

So once again:
Why I want std::pair export to be handled by indexing suite v2?
1. Because I belive a pair exported with this package will pass the assertion:
   [(pairA.first == pairB.first && pairA.second == pairB.second) <==>
pairA == pairB]
2. It will be consistent with other STL containers wich are
automaticaly handled by py++ with indexing suite v2.

And last issue:
I don't understand why upgrading GCCXML version helped in
derived_from_deque test case. In such case generated wrapper code
should be different depending on GCCXML version. And code generated by
older version is so "strange" that it makes it possible to insert
derived class into vector but access to this inserted element is
impossible. This sounds suspiciously.




-- 
Regards,

Michał Nowotka
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to