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/isempty/testIsEmpty.c | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/auxiliaryFunctions/isempty/testIsEmpty.c (limited to 'src/auxiliaryFunctions/isempty/testIsEmpty.c') 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 +** +** Started on Wed Feb 14 16:07:57 2007 jofret +** Last update Fri Feb 23 18:09:19 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include + +#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); +} -- cgit