fix some issue and two test-suit:simple_array, li_math

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11503 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2009-08-05 10:59:06 +00:00
commit 756f2645ce
17 changed files with 223 additions and 83 deletions

View file

@ -24,4 +24,8 @@
%constant int iconst = 37;
%constant double fconst = 3.14;
void constant_test(const int x) {
printf("%i", x);
}

View file

@ -1,24 +1,28 @@
// loader the *.so
exec loader.sce;
exec example.sce;
printf("ICONST = %i (should be 42)\n", example.ICONST);
printf("FCONST = %f (should be 2.1828)\n",example. FCONST);
printf("CCONST = %c (should be ''x'')\n", example.CCONST);
printf("CCONST2 = %s (this should be on a new line)\n", example.CCONST2);
printf("SCONST = %s (should be ''Hello World'')\n", example.SCONST);
printf("SCONST2 = %s (should be "'""Hello World"""')\n", example.SCONST2);
printf("EXPR = %f (should be 48.5484)\n",example.EXPR);
printf("iconst = %i (should be 37)\n", example.iconst);
printf("fconst = %f (should be 3.14)\n", example.fconst);
printf("ICONST = %i (should be 42)\n", ICONST);
printf("FCONST = %f (should be 2.1828)\n", FCONST);
printf("CCONST = %c (should be ''x'')\n", CCONST);
printf("CCONST2 = %s (this should be on a new line)\n", CCONST2);
printf("SCONST = %s (should be ''Hello World'')\n", SCONST);
printf("SCONST2 = %s (should be "'""Hello World"""')\n", SCONST2);
printf("EXPR = %f (should be 48.5484)\n", EXPR);
printf("iconst = %i (should be 37)\n", iconst);
printf("fconst = %f (should be 3.14)\n", fconst);
try
printf("EXTERN = %s (Arg! This should not printf(anything)\n", example.EXTERN);
printf("EXTERN = %s (Arg! This should not printf(anything)\n", EXTERN);
catch
printf("EXTERN is not defined (good)\n");
end
try
printf("FOO = %i (Arg! This should not printf(anything)\n", example.FOO);
printf("FOO = %i (Arg! This should not printf(anything)\n", FOO);
catch
printf("FOO is not defined (good)\n");
end
constant_test(iconst);
exit

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce;
// loader the *.so
exec loader.sce;
@ -13,7 +10,7 @@ printf("The gcd of %d and %d is %d\n",x,y,g);
// Call our fact() function
x=5;
g=fact(x);
printf("The fact of %d is %d",x,g);
printf("The fact of %d is %d\n",x,g);
// Manipulate the Foo global variable
@ -26,12 +23,6 @@ Foo_set (3.1415926);
// See if the change took effect
printf("Foo = %f\n", Foo_get());
//Call our gcd() function to test the contract conditon
x=-42;
y=105;
g=gcd(x,y);
printf("The gcd of %d and %d is %d\n",x,y,g);
exit

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce;
// loader the *.so
exec loader.sce;

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce;
// loader the *.so
exec loader.sce;

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce
// loader the *.so
exec loader.sce

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce
// loader the *.so
exec loader.sce

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce;
// loader the *.so
exec loader.sce;
@ -20,7 +17,7 @@ Foo_get()
Foo_set(3.1415926)
// See if the change took effect
Foo_get()
if Foo_get() <> 3.1415926 then pause,end
exit

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce
//loader the *.so
exec loader.sce

View file

@ -1,6 +1,3 @@
// builder the *.so
exec example_builder.sce
//loader the *.so
exec loader.sce