diff options
author | jofret | 2007-02-14 16:58:30 +0000 |
---|---|---|
committer | jofret | 2007-02-14 16:58:30 +0000 |
commit | ae8310fe8cafd7672eeb6d835220beed26a12dea (patch) | |
tree | 560144eb52b3b7045ad739909d7607ef5e55b7c8 | |
parent | 5fcd2352aa1dd7a7b22fd37e9e529a8414bf30e1 (diff) | |
download | scilab2c-ae8310fe8cafd7672eeb6d835220beed26a12dea.tar.gz scilab2c-ae8310fe8cafd7672eeb6d835220beed26a12dea.tar.bz2 scilab2c-ae8310fe8cafd7672eeb6d835220beed26a12dea.zip |
Adding missing tests files.
Must have been linked earlier with the "Sign" lib.
Correct the mistake.
-rw-r--r-- | src/test/Makefile | 3 | ||||
-rw-r--r-- | src/test/testFind.c | 65 | ||||
-rw-r--r-- | src/test/testIsEmpty.c | 19 |
3 files changed, 86 insertions, 1 deletions
diff --git a/src/test/Makefile b/src/test/Makefile index f4f1c9c9..c2d27c79 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Wed Feb 14 16:59:45 2007 jofret +## Last update Wed Feb 14 18:00:48 2007 jofret ## ## Copyright INRIA 2006 ## @@ -20,6 +20,7 @@ LIBS = -lm \ -lCos -lCosh \ -lSin -lSinh \ -lTan -lTanh \ + -lSign \ -lExp \ -lFind \ -lIsEmpty diff --git a/src/test/testFind.c b/src/test/testFind.c new file mode 100644 index 00000000..f6084512 --- /dev/null +++ b/src/test/testFind.c @@ -0,0 +1,65 @@ +/* +** -*- C -*- +** +** testFind.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Wed Feb 14 15:50:15 2007 jofret +** Last update Wed Feb 14 17:08:08 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <stdio.h> +#include "notFound.h" + +#define ERROR 42 + +int sfinda(float*, int); + +int sfindaTest() { + printf(">> Floats \n"); + float goodArray[5] = {0.,2.,3.,5.,10.}; + float badArray[5] = {0.,0.,0.,0.,0.}; + if (sfinda(goodArray, 5) != 1) { + printf("ERROR ! : Test Failed (non empty array)\n"); + return ERROR; + } + if (sfinda(badArray, 5) != NOT_FOUND) { + printf("ERROR ! : Test Failed (empty array)\n"); + return ERROR; + } + return 0; +} + +int dfindaTest() { + printf(">> Doubles \n"); + /* FIXME : Implement some test here ... */ + return 0; +} + +int cfindaTest() { + printf(">> Float Complex \n"); + /* FIXME : Implement some test here ... */ + return 0; +} + +int zfindaTest() { + printf(">> Double Complex \n"); + /* FIXME : Implement some test here ... */ + return 0; +} + +int testFind() { + int sfindaStatus, dfindaStatus = 0; + int cfindaStatus, zfindaStatus = 0; + + printf(">>>> Find Tests\n"); + sfindaStatus = sfindaTest(); + dfindaStatus = dfindaTest(); + cfindaStatus = cfindaTest(); + zfindaStatus = zfindaTest(); + + return (sfindaStatus + dfindaStatus + + cfindaStatus + zfindaStatus); +} diff --git a/src/test/testIsEmpty.c b/src/test/testIsEmpty.c new file mode 100644 index 00000000..123376a6 --- /dev/null +++ b/src/test/testIsEmpty.c @@ -0,0 +1,19 @@ +/* +** -*- C -*- +** +** testIsEmpty.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Wed Feb 14 16:07:57 2007 jofret +** Last update Wed Feb 14 17:31:54 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <stdio.h> + +int testIsEmpty() { + printf("\n>>>> IsEmpty Tests\n"); + /* FIXME : Implement some test here ... */ + return 0; +} |