diff options
-rw-r--r-- | src/auxiliaryFunctions/find/testFind.c | 64 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/testIsEmpty.c | 79 |
2 files changed, 143 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); +} diff --git a/src/auxiliaryFunctions/isempty/testIsEmpty.c b/src/auxiliaryFunctions/isempty/testIsEmpty.c new file mode 100644 index 00000000..041db1e2 --- /dev/null +++ b/src/auxiliaryFunctions/isempty/testIsEmpty.c @@ -0,0 +1,79 @@ +/* +** -*- C -*- +** +** testIsEmpty.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Wed Feb 14 16:07:57 2007 jofret +** Last update Fri Feb 23 18:09:19 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <stdio.h> + +#include "isEmpty.h" + +#define ERROR 51 + +int sisemptyaTest() { + printf(">> Float array\n"); + float empty[5] = {0., 0., 0., 0., 0.}; + float full[5] = {1., 2., 3., 0., 0.}; + + if (sisEmptya(empty, 5) == false) { + printf("ERROR ! : Test Failed (empty array)\n"); + return ERROR; + } + + if (sisEmptya(full, 5) == true) { + printf("ERROR ! : Test Failed (non empty array)\n"); + return ERROR; + } + + return 0; +} + +int disemptyaTest() { + printf(">> Double array\n"); + + double empty[5] = {0., 0., 0., 0., 0.}; + double full[5] = {1., 2., 3., 0., 0.}; + + if (disEmptya(empty, 5) == false) { + printf("ERROR ! : Test Failed (empty array)\n"); + return ERROR; + } + + if (disEmptya(full, 5) == true) { + printf("ERROR ! : Test Failed (non empty array)\n"); + return ERROR; + } + + return 0; +} + +int cisemptyaTest() { + printf(">> Float Complex array\n"); + + return 0; +} + +int zisemptyaTest() { + printf(">> Double Complex array\n"); + return 0; +} + + +int testIsEmpty() { + int sisemptyaTestStatus, disemptyaTestStatus = 0; + int cisemptyaTestStatus, zisemptyaTestStatus = 0; + printf("\n>>>> IsEmpty Tests\n"); + sisemptyaTestStatus = sisemptyaTest(); + disemptyaTestStatus = disemptyaTest(); + cisemptyaTestStatus = cisemptyaTest(); + zisemptyaTestStatus = zisemptyaTest(); + + return (sisemptyaTestStatus + disemptyaTestStatus + + cisemptyaTestStatus + zisemptyaTestStatus); +} |