diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2009-08-16 23:23:49 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2009-08-16 23:23:49 +0000 |
commit | 57e713f46b459f91fbf388088783014b76d50c9f (patch) | |
tree | a9853f15a7514cbb5955f21f3a11ac3ab0a89224 | |
parent | 82df087b8b6855294d903650feed73167b13aff4 (diff) | |
download | swig-57e713f46b459f91fbf388088783014b76d50c9f.tar.gz |
Fix testcase to minimal testing, most of it contained test code not relevant to std_vector.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11599 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | Examples/test-suite/octave/li_std_vector_runme.m | 155 |
1 files changed, 3 insertions, 152 deletions
diff --git a/Examples/test-suite/octave/li_std_vector_runme.m b/Examples/test-suite/octave/li_std_vector_runme.m index b9f33ee02..83d1f2cb0 100644 --- a/Examples/test-suite/octave/li_std_vector_runme.m +++ b/Examples/test-suite/octave/li_std_vector_runme.m @@ -1,160 +1,11 @@ li_std_vector iv = IntVector(4); -for i=0:4, +for i=0:3, iv(i) = i; endfor - x = average(iv); -y = average([1,2,3,4]); - -a = half([10,10.5,11,11.5]); - -dv = DoubleVector(10); -for i=0:10, - dv(i) = i/2.0; -endfor - -halve_in_place(dv); - - -bv = BoolVector(4); -bv(0)= 1; -bv(1)= 0; -bv(2)= 4; -bv(3)= 0; - -if (bv(0) != bv(2)) - error("bad std::vector<bool> mapping") -endif - -b = B(5); -va = VecA([b,None,b,b]); - -if (va(0).f(1) != 6) - error("bad std::vector<A*> mapping") -endif - -if (vecAptr(va) != 6) - error("bad std::vector<A*> mapping") -endif - -b.val = 7; -if (va(3).f(1) != 8) - error("bad std::vector<A*> mapping") -endif - - -ip = PtrInt(); -ap = new_ArrInt(10); - -ArrInt_setitem(ip,0,123); -ArrInt_setitem(ap,2,123); - -vi = IntPtrVector((ip,ap,None)); -if (ArrInt_getitem(vi[0],0) != ArrInt_getitem(vi[1],2)) - error("bad std::vector<int*> mapping") -endif - -delete_ArrInt(ap); - - -a = halfs([10,8,4,3]); - -v = IntVector(); -v(0:2) = [1,2]; -if (v(0) != 1 || v[1] != 2) - error("bad setslice") -endif - -if (v(0:-1)(0) != 1) - error("bad getslice") -endif - -if (v(0:-2).size() != 0) - error("bad getslice") - -v(0:1) = [2]; -if (v(0) != 2) - error("bad setslice") -endif - -v(1:) = [3]; -if (v(1) != 3) - error("bad setslice") -endif - -v(2:) = [3] -if (v(2) != 3) - error("bad setslice") -endif - -if (v(0:)(0) != v(0)) - error("bad getslice") -endif - - -v.erase(:) -if (v.size() != 0) - error("bad getslice") -endif - -v.erase(:) -if (v.size() != 0) - error("bad getslice") -endif - - - -v = vecStr({"hello ", "world"}); -if (v(0) != 'hello world') - error,"bad std::string+std::vector" -endif - - -pv = pyvector({1, "hello", (1,2)}); - -if (pv(1) != "hello") - error -endif - -iv = IntVector(5); -for i=0:5, - iv(i) = i +if (x != 1.5) + error("average failed"); endif - -iv(1:3) = []; -if (iv(1) != 3) - error -endif - -# Overloading checks -if (overloaded1(iv) != "vector<int>") - error -endif - -if (overloaded1(dv) != "vector<double>") - error -endif - -if (overloaded2(iv) != "vector<int>") - error -endif - -if (overloaded2(dv) != "vector<double>") - error -endif - -if (overloaded3(iv) != "vector<int> *") - error -endif - -if (overloaded3(None) != "vector<int> *") - error -endif - -if (overloaded3(100) != "int") - error -endif - |