From 4f602b826d6837aab7a833550e8fe3bf812ed05c Mon Sep 17 00:00:00 2001 From: jofret Date: Wed, 18 Apr 2007 16:49:46 +0000 Subject: Moving tests to each function. Enable make check. --- src/auxiliaryFunctions/find/testFind.c | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/auxiliaryFunctions/find/testFind.c (limited to 'src/auxiliaryFunctions/find/testFind.c') 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 +** +** Started on Wed Feb 14 15:50:15 2007 jofret +** Last update Fri Feb 23 18:09:45 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include + +#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); +} -- cgit