Add tests + small modifications

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12402 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Vincent Couvert 2011-01-28 13:14:32 +00:00
commit 454b1c8ab6
12 changed files with 241 additions and 1 deletions

View file

@ -0,0 +1,65 @@
exec("swigtest.start", -1);
try
foo = new_Foo();
catch
swigtesterror();
end
if Foo_x_get(foo)<>0 then swigtesterror(); end
if typeof(Foo_x_get(foo))<>"constant" then swigtesterror(); end
if Foo_y_get(foo)<>0 then swigtesterror(); end
if typeof(Foo_y_get(foo))<>"constant" then swigtesterror(); end
if Foo_z_get(foo)<>0 then swigtesterror(); end
if typeof(Foo_z_get(foo))<>"constant" then swigtesterror(); end
if Foo_f_get(foo)<>uint32(0) then swigtesterror(); end
if typeof(Foo_f_get(foo))<>"uint32" then swigtesterror(); end
if Foo_seq_get(foo)<>uint32(0) then swigtesterror(); end
if typeof(Foo_seq_get(foo))<>"uint32" then swigtesterror(); end
try
Foo_x_set(foo, 5);
catch
swigtesterror();
end
if Foo_x_get(foo)<>5 then swigtesterror(); end
try
Foo_y_set(foo, 5);
catch
swigtesterror();
end
if Foo_y_get(foo)<>5 then swigtesterror(); end
try
Foo_f_set(foo, 5);
catch
swigtesterror();
end
if Foo_y_get(foo)<>uint32(5) then swigtesterror(); end
try
Foo_z_set(foo, 13);
catch
swigtesterror();
end
if Foo_z_get(foo)<>13 then swigtesterror(); end
try
Foo_seq_set(foo, 3);
catch
swigtesterror();
end
if Foo_seq_get(foo)<>uint32(3) then swigtesterror(); end
try
delete_Foo(foo);
catch
swigtesterror();
end
exec("swigtest.quit", -1);