2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-25 18:32:24 +00:00

Yet another bug reported by Peter Bienstman is now fixed.

[SVN r13370]
This commit is contained in:
Dave Abrahams
2002-04-04 21:18:00 +00:00
parent 8de3571aa8
commit b601ba55d0
8 changed files with 356 additions and 235 deletions

View File

@@ -53,6 +53,7 @@ rule bpl-test ( name ? : files * )
bpl-test bienstman1 ;
bpl-test bienstman2 ;
bpl-test bienstman3 ;
bpl-test try : newtest.py m1.cpp m2.cpp ;
bpl-test builtin_converters : test_builtin_converters.py test_builtin_converters.cpp ;
bpl-test test_pointer_adoption ;

View File

@@ -1,5 +1,6 @@
'''
>>> import bienstman1_ext
>>> from bienstman1_ext import *
>>> # from Numeric import *
'''
def run(args = None):
import sys

View File

@@ -1,5 +1,5 @@
'''
>>> import bienstman1_ext.py
>>> import bienstman2_ext
'''
def run(args = None):
import sys

33
test/bienstman3.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/mpl/type_list.hpp>
struct V
{
virtual void f() = 0;
};
struct B
{
B(const V&) {}
};
BOOST_PYTHON_MODULE_INIT(bienstman3_ext)
{
using namespace boost::python;
using boost::mpl::type_list;
module m("bienstman3_ext");
m
.add(
class_<V, boost::noncopyable>("V")
)
.add(
class_<B>("B")
.def_init(type_list<const V&>())
)
;
}

15
test/bienstman3.py Normal file
View File

@@ -0,0 +1,15 @@
'''
>>> from bienstman3_ext import *
'''
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = args
return doctest.testmod(sys.modules.get(__name__))
if __name__ == '__main__':
print "running..."
import sys
sys.exit(run()[0])