diff --git a/build/vc60.mak b/build/vc60.mak index d527fdbb..7cd463c2 100644 --- a/build/vc60.mak +++ b/build/vc60.mak @@ -102,8 +102,8 @@ tst: $(PYEXE) tst_noncopyable.py $(PYEXE) tst_ivect1.py $(PYEXE) tst_dvect1.py - $(PYEXE) tst_ivect2.py - $(PYEXE) tst_dvect2.py + $(PYEXE) tst_ivect2.py --broken-auto-ptr + $(PYEXE) tst_dvect2.py --broken-auto-ptr clean: del *.obj diff --git a/example/tst_dvect2.py b/example/tst_dvect2.py index 868c107d..539e0b88 100644 --- a/example/tst_dvect2.py +++ b/example/tst_dvect2.py @@ -1,4 +1,4 @@ -def f(): +def f(broken_auto_ptr): import dvect import ivect # @@ -9,13 +9,19 @@ def f(): print '1. auto_ptr_value_ivect_as_tuple' print ivect.auto_ptr_value_ivect_as_tuple(aiv) print '2. auto_ptr_value_ivect_as_tuple' - print ivect.auto_ptr_value_ivect_as_tuple(aiv) + if (not broken_auto_ptr): + print ivect.auto_ptr_value_ivect_as_tuple(aiv) + else: + print None # adv = dvect.dvect_as_auto_ptr(dv) print '1. auto_ptr_value_dvect_as_tuple' print ivect.auto_ptr_value_dvect_as_tuple(adv) print '2. auto_ptr_value_dvect_as_tuple' - print ivect.auto_ptr_value_dvect_as_tuple(adv) + if (not broken_auto_ptr): + print ivect.auto_ptr_value_dvect_as_tuple(adv) + else: + print None # siv = dvect.ivect_as_shared_ptr(iv) print '1. shared_ptr_value_ivect_as_tuple' @@ -79,7 +85,14 @@ def f(): if (__name__ == "__main__"): import sys, string + broken_auto_ptr = 0 n = 1 - if (len(sys.argv) > 1): n = string.atoi(sys.argv[1]) + if (len(sys.argv) > 1): + if (sys.argv[1] == "--broken-auto-ptr"): + broken_auto_ptr = 1 + if (len(sys.argv) > 2): + n = string.atoi(sys.argv[2]) + else: + n = string.atoi(sys.argv[1]) for i in xrange(n): - f() + f(broken_auto_ptr) diff --git a/example/tst_ivect2.py b/example/tst_ivect2.py index 0db6903d..6ffd2826 100644 --- a/example/tst_ivect2.py +++ b/example/tst_ivect2.py @@ -1,4 +1,4 @@ -def f(): +def f(broken_auto_ptr): import ivect import dvect # @@ -9,13 +9,19 @@ def f(): print '1. auto_ptr_value_dvect_as_tuple' print dvect.auto_ptr_value_dvect_as_tuple(adv) print '2. auto_ptr_value_dvect_as_tuple' - print dvect.auto_ptr_value_dvect_as_tuple(adv) + if (not broken_auto_ptr): + print dvect.auto_ptr_value_dvect_as_tuple(adv) + else: + print None # aiv = ivect.ivect_as_auto_ptr(iv) print '1. auto_ptr_value_ivect_as_tuple' print dvect.auto_ptr_value_ivect_as_tuple(aiv) print '2. auto_ptr_value_ivect_as_tuple' - print dvect.auto_ptr_value_ivect_as_tuple(aiv) + if (not broken_auto_ptr): + print dvect.auto_ptr_value_ivect_as_tuple(aiv) + else: + print None # sdv = ivect.dvect_as_shared_ptr(dv) print '1. shared_ptr_value_dvect_as_tuple' @@ -79,7 +85,14 @@ def f(): if (__name__ == "__main__"): import sys, string + broken_auto_ptr = 0 n = 1 - if (len(sys.argv) > 1): n = string.atoi(sys.argv[1]) + if (len(sys.argv) > 1): + if (sys.argv[1] == "--broken-auto-ptr"): + broken_auto_ptr = 1 + if (len(sys.argv) > 2): + n = string.atoi(sys.argv[2]) + else: + n = string.atoi(sys.argv[1]) for i in xrange(n): - f() + f(broken_auto_ptr)