diff options
author | jofret | 2007-04-27 06:47:30 +0000 |
---|---|---|
committer | jofret | 2007-04-27 06:47:30 +0000 |
commit | d4c521386b82ea3e29762a845bc4483f57bc056a (patch) | |
tree | c1b258c1346165dbd4179f5e6b322b2d07b96634 | |
parent | 0b52f43b5ceccad148877b3def021a41c46501c3 (diff) | |
download | scilab2c-d4c521386b82ea3e29762a845bc4483f57bc056a.tar.gz scilab2c-d4c521386b82ea3e29762a845bc4483f57bc056a.tar.bz2 scilab2c-d4c521386b82ea3e29762a845bc4483f57bc056a.zip |
[RELEASE] isEmpty functions ! (with simple low case name)
-rw-r--r-- | src/auxiliaryFunctions/includes/isempty.h (renamed from src/auxiliaryFunctions/includes/isEmpty.h) | 0 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/Makefile.am | 15 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/Makefile.in | 53 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/cisEmptya.c | 21 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/cisemptya.c | 9 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/disEmptya.c | 21 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/disemptya.c | 9 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/sisEmptya.c | 21 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/sisemptya.c | 9 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/testIsEmpty.c | 97 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/testIsEmpty.h | 32 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/zisEmptya.c | 21 | ||||
-rw-r--r-- | src/auxiliaryFunctions/isempty/zisemptya.c | 9 |
13 files changed, 162 insertions, 155 deletions
diff --git a/src/auxiliaryFunctions/includes/isEmpty.h b/src/auxiliaryFunctions/includes/isempty.h index 51ebce4b..51ebce4b 100644 --- a/src/auxiliaryFunctions/includes/isEmpty.h +++ b/src/auxiliaryFunctions/includes/isempty.h diff --git a/src/auxiliaryFunctions/isempty/Makefile.am b/src/auxiliaryFunctions/isempty/Makefile.am index a1b17d4f..0348ee2c 100644 --- a/src/auxiliaryFunctions/isempty/Makefile.am +++ b/src/auxiliaryFunctions/isempty/Makefile.am @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Fri Jan 5 10:19:16 2007 jofret -## Last update Fri Apr 20 16:15:11 2007 jofret +## Last update Thu Apr 26 11:10:23 2007 jofret ## ## Copyright INRIA 2007 ## @@ -32,19 +32,20 @@ HEAD = ../includes/isempty.h # Checking Part #### -check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ +check_INCLUDES = -I $(top_builddir)/auxiliaryFunctions/includes \ -I $(top_builddir)/type -check_PROGRAMS = testIsempty +check_PROGRAMS = testIsEmpty -TESTS = testIsempty +TESTS = testIsEmpty # # -*- Isempty Tests -*- # -testIsempty_SOURCES = testIsempty.c -testIsempty_CFLAGS = $(check_INCLUDES) -testIsempty_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ +testIsEmpty_SOURCES = testIsEmpty.c +testIsEmpty_CFLAGS = $(check_INCLUDES) +testIsEmpty_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ $(top_builddir)/lib/libFloatComplex.a \ $(top_builddir)/lib/libIsempty.a \ + $(top_builddir)/lib/libFind.a \ @LIBMATH@ diff --git a/src/auxiliaryFunctions/isempty/Makefile.in b/src/auxiliaryFunctions/isempty/Makefile.in index 30b272c6..ca3a0217 100644 --- a/src/auxiliaryFunctions/isempty/Makefile.in +++ b/src/auxiliaryFunctions/isempty/Makefile.in @@ -36,7 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = testIsempty$(EXEEXT) +check_PROGRAMS = testIsEmpty$(EXEEXT) subdir = auxiliaryFunctions/isempty DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,11 +65,11 @@ am__objects_2 = sisemptya.$(OBJEXT) disemptya.$(OBJEXT) \ cisemptya.$(OBJEXT) zisemptya.$(OBJEXT) am_libIsempty_a_OBJECTS = $(am__objects_1) $(am__objects_2) libIsempty_a_OBJECTS = $(am_libIsempty_a_OBJECTS) -am_testIsempty_OBJECTS = testIsempty-testIsempty.$(OBJEXT) -testIsempty_OBJECTS = $(am_testIsempty_OBJECTS) -testIsempty_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ +am_testIsEmpty_OBJECTS = testIsEmpty-testIsEmpty.$(OBJEXT) +testIsEmpty_OBJECTS = $(am_testIsEmpty_OBJECTS) +testIsEmpty_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ $(top_builddir)/lib/libFloatComplex.a \ - $(top_builddir)/lib/libIsempty.a + $(top_builddir)/lib/libIsempty.a $(top_builddir)/lib/libFind.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -77,8 +77,8 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libIsempty_a_SOURCES) $(testIsempty_SOURCES) -DIST_SOURCES = $(libIsempty_a_SOURCES) $(testIsempty_SOURCES) +SOURCES = $(libIsempty_a_SOURCES) $(testIsEmpty_SOURCES) +DIST_SOURCES = $(libIsempty_a_SOURCES) $(testIsEmpty_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -194,19 +194,20 @@ HEAD = ../includes/isempty.h #### # Checking Part #### -check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ +check_INCLUDES = -I $(top_builddir)/auxiliaryFunctions/includes \ -I $(top_builddir)/type -TESTS = testIsempty +TESTS = testIsEmpty # # -*- Isempty Tests -*- # -testIsempty_SOURCES = testIsempty.c -testIsempty_CFLAGS = $(check_INCLUDES) -testIsempty_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ +testIsEmpty_SOURCES = testIsEmpty.c +testIsEmpty_CFLAGS = $(check_INCLUDES) +testIsEmpty_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ $(top_builddir)/lib/libFloatComplex.a \ $(top_builddir)/lib/libIsempty.a \ + $(top_builddir)/lib/libFind.a \ @LIBMATH@ all: all-am @@ -281,9 +282,9 @@ libIsempty.a: $(libIsempty_a_OBJECTS) $(libIsempty_a_DEPENDENCIES) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -testIsempty$(EXEEXT): $(testIsempty_OBJECTS) $(testIsempty_DEPENDENCIES) - @rm -f testIsempty$(EXEEXT) - $(LINK) $(testIsempty_LDFLAGS) $(testIsempty_OBJECTS) $(testIsempty_LDADD) $(LIBS) +testIsEmpty$(EXEEXT): $(testIsEmpty_OBJECTS) $(testIsEmpty_DEPENDENCIES) + @rm -f testIsEmpty$(EXEEXT) + $(LINK) $(testIsEmpty_LDFLAGS) $(testIsEmpty_OBJECTS) $(testIsEmpty_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -294,7 +295,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cisemptya.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disemptya.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sisemptya.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testIsempty-testIsempty.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testIsEmpty-testIsEmpty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zisemptya.Po@am__quote@ .c.o: @@ -311,19 +312,19 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -testIsempty-testIsempty.o: testIsempty.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsempty_CFLAGS) $(CFLAGS) -MT testIsempty-testIsempty.o -MD -MP -MF "$(DEPDIR)/testIsempty-testIsempty.Tpo" -c -o testIsempty-testIsempty.o `test -f 'testIsempty.c' || echo '$(srcdir)/'`testIsempty.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testIsempty-testIsempty.Tpo" "$(DEPDIR)/testIsempty-testIsempty.Po"; else rm -f "$(DEPDIR)/testIsempty-testIsempty.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testIsempty.c' object='testIsempty-testIsempty.o' libtool=no @AMDEPBACKSLASH@ +testIsEmpty-testIsEmpty.o: testIsEmpty.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsEmpty_CFLAGS) $(CFLAGS) -MT testIsEmpty-testIsEmpty.o -MD -MP -MF "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo" -c -o testIsEmpty-testIsEmpty.o `test -f 'testIsEmpty.c' || echo '$(srcdir)/'`testIsEmpty.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo" "$(DEPDIR)/testIsEmpty-testIsEmpty.Po"; else rm -f "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testIsEmpty.c' object='testIsEmpty-testIsEmpty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsempty_CFLAGS) $(CFLAGS) -c -o testIsempty-testIsempty.o `test -f 'testIsempty.c' || echo '$(srcdir)/'`testIsempty.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsEmpty_CFLAGS) $(CFLAGS) -c -o testIsEmpty-testIsEmpty.o `test -f 'testIsEmpty.c' || echo '$(srcdir)/'`testIsEmpty.c -testIsempty-testIsempty.obj: testIsempty.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsempty_CFLAGS) $(CFLAGS) -MT testIsempty-testIsempty.obj -MD -MP -MF "$(DEPDIR)/testIsempty-testIsempty.Tpo" -c -o testIsempty-testIsempty.obj `if test -f 'testIsempty.c'; then $(CYGPATH_W) 'testIsempty.c'; else $(CYGPATH_W) '$(srcdir)/testIsempty.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testIsempty-testIsempty.Tpo" "$(DEPDIR)/testIsempty-testIsempty.Po"; else rm -f "$(DEPDIR)/testIsempty-testIsempty.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testIsempty.c' object='testIsempty-testIsempty.obj' libtool=no @AMDEPBACKSLASH@ +testIsEmpty-testIsEmpty.obj: testIsEmpty.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsEmpty_CFLAGS) $(CFLAGS) -MT testIsEmpty-testIsEmpty.obj -MD -MP -MF "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo" -c -o testIsEmpty-testIsEmpty.obj `if test -f 'testIsEmpty.c'; then $(CYGPATH_W) 'testIsEmpty.c'; else $(CYGPATH_W) '$(srcdir)/testIsEmpty.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo" "$(DEPDIR)/testIsEmpty-testIsEmpty.Po"; else rm -f "$(DEPDIR)/testIsEmpty-testIsEmpty.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testIsEmpty.c' object='testIsEmpty-testIsEmpty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsempty_CFLAGS) $(CFLAGS) -c -o testIsempty-testIsempty.obj `if test -f 'testIsempty.c'; then $(CYGPATH_W) 'testIsempty.c'; else $(CYGPATH_W) '$(srcdir)/testIsempty.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsEmpty_CFLAGS) $(CFLAGS) -c -o testIsEmpty-testIsEmpty.obj `if test -f 'testIsEmpty.c'; then $(CYGPATH_W) 'testIsEmpty.c'; else $(CYGPATH_W) '$(srcdir)/testIsEmpty.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) diff --git a/src/auxiliaryFunctions/isempty/cisEmptya.c b/src/auxiliaryFunctions/isempty/cisEmptya.c deleted file mode 100644 index 3d40e10f..00000000 --- a/src/auxiliaryFunctions/isempty/cisEmptya.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -** -*- C -*- -** -** cisEmptya.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Wed Feb 14 15:33:30 2007 jofret -** Last update Fri Feb 23 18:01:22 2007 jofret -** -** Copyright INRIA 2007 -*/ - -#include "isEmpty.h" -#include "find.h" - -bool cisEmptya(floatComplex* x, int size) { - if (cfinda(x, size) == NOT_FOUND) { - return true; - } - return false; -} diff --git a/src/auxiliaryFunctions/isempty/cisemptya.c b/src/auxiliaryFunctions/isempty/cisemptya.c index 3d40e10f..7c4b60e6 100644 --- a/src/auxiliaryFunctions/isempty/cisemptya.c +++ b/src/auxiliaryFunctions/isempty/cisemptya.c @@ -1,19 +1,18 @@ /* ** -*- C -*- ** -** cisEmptya.c +** cisemptya.c ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Wed Feb 14 15:33:30 2007 jofret -** Last update Fri Feb 23 18:01:22 2007 jofret +** Last update Fri Apr 27 08:58:40 2007 jofret ** ** Copyright INRIA 2007 */ -#include "isEmpty.h" -#include "find.h" +#include "isempty.h" -bool cisEmptya(floatComplex* x, int size) { +bool cisemptya(floatComplex* x, int size) { if (cfinda(x, size) == NOT_FOUND) { return true; } diff --git a/src/auxiliaryFunctions/isempty/disEmptya.c b/src/auxiliaryFunctions/isempty/disEmptya.c deleted file mode 100644 index 5871e1ca..00000000 --- a/src/auxiliaryFunctions/isempty/disEmptya.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -** -*- C -*- -** -** disEmptya.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Wed Feb 14 15:29:27 2007 jofret -** Last update Fri Feb 23 18:00:53 2007 jofret -** -** Copyright INRIA 2007 -*/ - -#include "isEmpty.h" -#include "find.h" - -bool disEmptya(double* x, int size) { - if (dfinda(x, size) == NOT_FOUND) { - return true; - } - return false; -} diff --git a/src/auxiliaryFunctions/isempty/disemptya.c b/src/auxiliaryFunctions/isempty/disemptya.c index 5871e1ca..821b944a 100644 --- a/src/auxiliaryFunctions/isempty/disemptya.c +++ b/src/auxiliaryFunctions/isempty/disemptya.c @@ -1,19 +1,18 @@ /* ** -*- C -*- ** -** disEmptya.c +** disemptya.c ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Wed Feb 14 15:29:27 2007 jofret -** Last update Fri Feb 23 18:00:53 2007 jofret +** Last update Fri Apr 27 08:58:55 2007 jofret ** ** Copyright INRIA 2007 */ -#include "isEmpty.h" -#include "find.h" +#include "isempty.h" -bool disEmptya(double* x, int size) { +bool disemptya(double* x, int size) { if (dfinda(x, size) == NOT_FOUND) { return true; } diff --git a/src/auxiliaryFunctions/isempty/sisEmptya.c b/src/auxiliaryFunctions/isempty/sisEmptya.c deleted file mode 100644 index e69a2fac..00000000 --- a/src/auxiliaryFunctions/isempty/sisEmptya.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -** -*- C -*- -** -** sisEmptya.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Wed Feb 14 14:59:33 2007 jofret -** Last update Fri Feb 23 18:00:31 2007 jofret -** -** Copyright INRIA 2007 -*/ - -#include "isEmpty.h" -#include "find.h" - -bool sisEmptya(float* x, int size) { - if (sfinda(x, size) == NOT_FOUND) { - return true; - } - return false; -} diff --git a/src/auxiliaryFunctions/isempty/sisemptya.c b/src/auxiliaryFunctions/isempty/sisemptya.c index e69a2fac..4040720e 100644 --- a/src/auxiliaryFunctions/isempty/sisemptya.c +++ b/src/auxiliaryFunctions/isempty/sisemptya.c @@ -1,19 +1,18 @@ /* ** -*- C -*- ** -** sisEmptya.c +** sisemptya.c ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Wed Feb 14 14:59:33 2007 jofret -** Last update Fri Feb 23 18:00:31 2007 jofret +** Last update Fri Apr 27 08:59:07 2007 jofret ** ** Copyright INRIA 2007 */ -#include "isEmpty.h" -#include "find.h" +#include "isempty.h" -bool sisEmptya(float* x, int size) { +bool sisemptya(float* x, int size) { if (sfinda(x, size) == NOT_FOUND) { return true; } diff --git a/src/auxiliaryFunctions/isempty/testIsEmpty.c b/src/auxiliaryFunctions/isempty/testIsEmpty.c index 041db1e2..b5e138e6 100644 --- a/src/auxiliaryFunctions/isempty/testIsEmpty.c +++ b/src/auxiliaryFunctions/isempty/testIsEmpty.c @@ -5,63 +5,119 @@ ** 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 +** Last update Fri Apr 27 09:00:55 2007 jofret ** ** Copyright INRIA 2007 */ -#include <stdio.h> - -#include "isEmpty.h" - -#define ERROR 51 +#include "testIsEmpty.h" int sisemptyaTest() { + int result = 0; + 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) { + if (sisemptya(empty, 5) == false) { printf("ERROR ! : Test Failed (empty array)\n"); - return ERROR; + result = ERROR; } + assert (sisemptya(empty, 5) == true); - if (sisEmptya(full, 5) == true) { + if (sisemptya(full, 5) == true) { printf("ERROR ! : Test Failed (non empty array)\n"); - return ERROR; + result = ERROR; } + assert(sisemptya(full, 5) == false); - return 0; + return result; } int disemptyaTest() { + int result = 0; + 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) { + if (disemptya(empty, 5) == false) { printf("ERROR ! : Test Failed (empty array)\n"); - return ERROR; + result = ERROR; } + assert(disemptya(empty, 5) == true); - if (disEmptya(full, 5) == true) { + if (disemptya(full, 5) == true) { printf("ERROR ! : Test Failed (non empty array)\n"); - return ERROR; + result = ERROR; } + assert(disemptya(full, 5) == false); - return 0; + return result; } int cisemptyaTest() { + int result = 0; printf(">> Float Complex array\n"); - return 0; + floatComplex empty[5] = {FloatComplex(0., 0.), + FloatComplex(0., 0.), + FloatComplex(0., 0.), + FloatComplex(0., 0.), + FloatComplex(0., 0.)}; + floatComplex full[5] = {FloatComplex(0.,1.), + FloatComplex(0., 2.), + FloatComplex(0., 3.), + FloatComplex(0., 0.), + FloatComplex(0., 0.)}; + + if (cisemptya(empty, 5) == false) { + printf("ERROR ! : Test Failed (empty array)\n"); + result = ERROR; + } + assert (cisemptya(empty, 5) == true); + + if (cisemptya(full, 5) == true) { + printf("ERROR ! : Test Failed (non empty array)\n"); + result = ERROR; + } + assert(cisemptya(full, 5) == false); + + + return result; } int zisemptyaTest() { + int result = 0; + printf(">> Double Complex array\n"); - return 0; + doubleComplex empty[5] = {DoubleComplex(0., 0.), + DoubleComplex(0., 0.), + DoubleComplex(0., 0.), + DoubleComplex(0., 0.), + DoubleComplex(0., 0.)}; + doubleComplex full[5] = {DoubleComplex(0.,1.), + DoubleComplex(0., 2.), + DoubleComplex(0., 3.), + DoubleComplex(0., 0.), + DoubleComplex(0., 0.)}; + + if (zisemptya(empty, 5) == false) { + printf("ERROR ! : Test Failed (empty array)\n"); + result = ERROR; + } + assert (zisemptya(empty, 5) == true); + + if (zisemptya(full, 5) == true) { + printf("ERROR ! : Test Failed (non empty array)\n"); + result = ERROR; + } + assert(zisemptya(full, 5) == false); + + + return result; } @@ -77,3 +133,8 @@ int testIsEmpty() { return (sisemptyaTestStatus + disemptyaTestStatus + cisemptyaTestStatus + zisemptyaTestStatus); } + +int main(void) { + assert(testIsEmpty() == 0); + return 0; +} diff --git a/src/auxiliaryFunctions/isempty/testIsEmpty.h b/src/auxiliaryFunctions/isempty/testIsEmpty.h new file mode 100644 index 00000000..545801ad --- /dev/null +++ b/src/auxiliaryFunctions/isempty/testIsEmpty.h @@ -0,0 +1,32 @@ +/* +** -*- C -*- +** +** testIsEmpty.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Wed Feb 14 16:07:57 2007 jofret +** Last update Fri Apr 27 08:59:49 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef __TESTISEMPTY_H__ +#define __TESTISEMPTY_H__ + +#include <stdio.h> +#include <assert.h> +#include "isempty.h" + +#define ERROR 51 + +int sisemptyaTest(void); + +int disemptyaTest(void); + +int cisemptyaTest(void); + +int zisemptyaTest(void); + +int testIsEmpty(void); + +#endif /* ! __TESTISEMPTY_H__ */ diff --git a/src/auxiliaryFunctions/isempty/zisEmptya.c b/src/auxiliaryFunctions/isempty/zisEmptya.c deleted file mode 100644 index 65617be3..00000000 --- a/src/auxiliaryFunctions/isempty/zisEmptya.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -** -*- C -*- -** -** zisEmptya.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Wed Feb 14 15:34:28 2007 jofret -** Last update Fri Feb 23 17:59:54 2007 jofret -** -** Copyright INRIA 2007 -*/ - -#include "isEmpty.h" -#include "find.h" - -bool zisEmptya(doubleComplex* x, int size) { - if (zfinda(x, size) == NOT_FOUND) { - return true; - } - return false; -} diff --git a/src/auxiliaryFunctions/isempty/zisemptya.c b/src/auxiliaryFunctions/isempty/zisemptya.c index 65617be3..3cdb8cf6 100644 --- a/src/auxiliaryFunctions/isempty/zisemptya.c +++ b/src/auxiliaryFunctions/isempty/zisemptya.c @@ -1,19 +1,18 @@ /* ** -*- C -*- ** -** zisEmptya.c +** zisemptya.c ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Wed Feb 14 15:34:28 2007 jofret -** Last update Fri Feb 23 17:59:54 2007 jofret +** Last update Fri Apr 27 09:01:49 2007 jofret ** ** Copyright INRIA 2007 */ -#include "isEmpty.h" -#include "find.h" +#include "isempty.h" -bool zisEmptya(doubleComplex* x, int size) { +bool zisemptya(doubleComplex* x, int size) { if (zfinda(x, size) == NOT_FOUND) { return true; } |