diff options
author | jofret | 2007-04-18 16:49:46 +0000 |
---|---|---|
committer | jofret | 2007-04-18 16:49:46 +0000 |
commit | 4f602b826d6837aab7a833550e8fe3bf812ed05c (patch) | |
tree | 9fcb666ba8e9841930d7eb145a4bc09be5961673 /src/auxiliaryFunctions/find/testFind.c | |
parent | 44e9a135e22cb4ff584e39ac1585df9f22fa1ad4 (diff) | |
download | scilab2c-4f602b826d6837aab7a833550e8fe3bf812ed05c.tar.gz scilab2c-4f602b826d6837aab7a833550e8fe3bf812ed05c.tar.bz2 scilab2c-4f602b826d6837aab7a833550e8fe3bf812ed05c.zip |
Moving tests to each function.
Enable make check.
Diffstat (limited to 'src/auxiliaryFunctions/find/testFind.c')
-rw-r--r-- | src/auxiliaryFunctions/find/testFind.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/auxiliaryFunctions/find/testFind.c b/src/auxiliaryFunctions/find/testFind.c new file mode 100644 index 00000000..ee5b5edc --- /dev/null +++ b/src/auxiliaryFunctions/find/testFind.c @@ -0,0 +1,64 @@ +/* +** -*- C -*- +** +** testFind.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Wed Feb 14 15:50:15 2007 jofret +** Last update Fri Feb 23 18:09:45 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <stdio.h> + +#include "find.h" + +#define ERROR 42 + +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); +} |