diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/auxiliaryFunctions/type/Makefile.am | 15 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/Makefile.in | 84 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/ctypea.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/ctypes.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/dtypea.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/dtypes.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/stypea.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/stypes.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/testType.c | 155 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/testType.h | 41 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/ztypea.c | 1 | ||||
-rw-r--r-- | src/auxiliaryFunctions/type/ztypes.c | 1 |
12 files changed, 203 insertions, 100 deletions
diff --git a/src/auxiliaryFunctions/type/Makefile.am b/src/auxiliaryFunctions/type/Makefile.am index 40b5bf3d..32f7553d 100644 --- a/src/auxiliaryFunctions/type/Makefile.am +++ b/src/auxiliaryFunctions/type/Makefile.am @@ -11,22 +11,13 @@ ## libType_la_CFLAGS = -I ../../type \ - -I ../includes + -I ../includes instdir = $(top_builddir)/lib pkglib_LTLIBRARIES = libType.la -libType_la_SOURCES = $(HEAD) $(SRC) - -SRC = stypes.c \ - dtypes.c \ - ctypes.c \ - ztypes.c \ - stypea.c \ - dtypea.c \ - ctypea.c \ - ztypea.c +libType_la_SOURCES = $(HEAD) HEAD = ../includes/type.h @@ -34,7 +25,7 @@ HEAD = ../includes/type.h # Checking Part #### -check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ +check_INCLUDES = -I $(top_builddir)/auxiliaryFunctions/includes \ -I $(top_builddir)/type check_PROGRAMS = testType diff --git a/src/auxiliaryFunctions/type/Makefile.in b/src/auxiliaryFunctions/type/Makefile.in index cea00e6d..a31d6547 100644 --- a/src/auxiliaryFunctions/type/Makefile.in +++ b/src/auxiliaryFunctions/type/Makefile.in @@ -54,10 +54,7 @@ pkglibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(pkglib_LTLIBRARIES) libType_la_LIBADD = am__objects_1 = -am__objects_2 = libType_la-stypes.lo libType_la-dtypes.lo \ - libType_la-ctypes.lo libType_la-ztypes.lo libType_la-stypea.lo \ - libType_la-dtypea.lo libType_la-ctypea.lo libType_la-ztypea.lo -am_libType_la_OBJECTS = $(am__objects_1) $(am__objects_2) +am_libType_la_OBJECTS = $(am__objects_1) libType_la_OBJECTS = $(am_libType_la_OBJECTS) libType_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libType_la_CFLAGS) \ @@ -196,26 +193,17 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libType_la_CFLAGS = -I ../../type \ - -I ../includes + -I ../includes instdir = $(top_builddir)/lib pkglib_LTLIBRARIES = libType.la -libType_la_SOURCES = $(HEAD) $(SRC) -SRC = stypes.c \ - dtypes.c \ - ctypes.c \ - ztypes.c \ - stypea.c \ - dtypea.c \ - ctypea.c \ - ztypea.c - +libType_la_SOURCES = $(HEAD) HEAD = ../includes/type.h #### # Checking Part #### -check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ +check_INCLUDES = -I $(top_builddir)/auxiliaryFunctions/includes \ -I $(top_builddir)/type @@ -308,14 +296,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-ctypea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-ctypes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-dtypea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-dtypes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-stypea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-stypes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-ztypea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libType_la-ztypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testType-testType.Po@am__quote@ .c.o: @@ -339,62 +319,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -libType_la-stypes.lo: stypes.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-stypes.lo -MD -MP -MF $(DEPDIR)/libType_la-stypes.Tpo -c -o libType_la-stypes.lo `test -f 'stypes.c' || echo '$(srcdir)/'`stypes.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-stypes.Tpo $(DEPDIR)/libType_la-stypes.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stypes.c' object='libType_la-stypes.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-stypes.lo `test -f 'stypes.c' || echo '$(srcdir)/'`stypes.c - -libType_la-dtypes.lo: dtypes.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-dtypes.lo -MD -MP -MF $(DEPDIR)/libType_la-dtypes.Tpo -c -o libType_la-dtypes.lo `test -f 'dtypes.c' || echo '$(srcdir)/'`dtypes.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-dtypes.Tpo $(DEPDIR)/libType_la-dtypes.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dtypes.c' object='libType_la-dtypes.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-dtypes.lo `test -f 'dtypes.c' || echo '$(srcdir)/'`dtypes.c - -libType_la-ctypes.lo: ctypes.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-ctypes.lo -MD -MP -MF $(DEPDIR)/libType_la-ctypes.Tpo -c -o libType_la-ctypes.lo `test -f 'ctypes.c' || echo '$(srcdir)/'`ctypes.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-ctypes.Tpo $(DEPDIR)/libType_la-ctypes.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctypes.c' object='libType_la-ctypes.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-ctypes.lo `test -f 'ctypes.c' || echo '$(srcdir)/'`ctypes.c - -libType_la-ztypes.lo: ztypes.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-ztypes.lo -MD -MP -MF $(DEPDIR)/libType_la-ztypes.Tpo -c -o libType_la-ztypes.lo `test -f 'ztypes.c' || echo '$(srcdir)/'`ztypes.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-ztypes.Tpo $(DEPDIR)/libType_la-ztypes.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ztypes.c' object='libType_la-ztypes.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-ztypes.lo `test -f 'ztypes.c' || echo '$(srcdir)/'`ztypes.c - -libType_la-stypea.lo: stypea.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-stypea.lo -MD -MP -MF $(DEPDIR)/libType_la-stypea.Tpo -c -o libType_la-stypea.lo `test -f 'stypea.c' || echo '$(srcdir)/'`stypea.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-stypea.Tpo $(DEPDIR)/libType_la-stypea.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stypea.c' object='libType_la-stypea.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-stypea.lo `test -f 'stypea.c' || echo '$(srcdir)/'`stypea.c - -libType_la-dtypea.lo: dtypea.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-dtypea.lo -MD -MP -MF $(DEPDIR)/libType_la-dtypea.Tpo -c -o libType_la-dtypea.lo `test -f 'dtypea.c' || echo '$(srcdir)/'`dtypea.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-dtypea.Tpo $(DEPDIR)/libType_la-dtypea.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dtypea.c' object='libType_la-dtypea.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-dtypea.lo `test -f 'dtypea.c' || echo '$(srcdir)/'`dtypea.c - -libType_la-ctypea.lo: ctypea.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-ctypea.lo -MD -MP -MF $(DEPDIR)/libType_la-ctypea.Tpo -c -o libType_la-ctypea.lo `test -f 'ctypea.c' || echo '$(srcdir)/'`ctypea.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-ctypea.Tpo $(DEPDIR)/libType_la-ctypea.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctypea.c' object='libType_la-ctypea.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-ctypea.lo `test -f 'ctypea.c' || echo '$(srcdir)/'`ctypea.c - -libType_la-ztypea.lo: ztypea.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -MT libType_la-ztypea.lo -MD -MP -MF $(DEPDIR)/libType_la-ztypea.Tpo -c -o libType_la-ztypea.lo `test -f 'ztypea.c' || echo '$(srcdir)/'`ztypea.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libType_la-ztypea.Tpo $(DEPDIR)/libType_la-ztypea.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ztypea.c' object='libType_la-ztypea.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libType_la_CFLAGS) $(CFLAGS) -c -o libType_la-ztypea.lo `test -f 'ztypea.c' || echo '$(srcdir)/'`ztypea.c - testType-testType.o: testType.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testType_CFLAGS) $(CFLAGS) -MT testType-testType.o -MD -MP -MF $(DEPDIR)/testType-testType.Tpo -c -o testType-testType.o `test -f 'testType.c' || echo '$(srcdir)/'`testType.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testType-testType.Tpo $(DEPDIR)/testType-testType.Po diff --git a/src/auxiliaryFunctions/type/ctypea.c b/src/auxiliaryFunctions/type/ctypea.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/ctypea.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/ctypes.c b/src/auxiliaryFunctions/type/ctypes.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/ctypes.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/dtypea.c b/src/auxiliaryFunctions/type/dtypea.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/dtypea.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/dtypes.c b/src/auxiliaryFunctions/type/dtypes.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/dtypes.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/stypea.c b/src/auxiliaryFunctions/type/stypea.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/stypea.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/stypes.c b/src/auxiliaryFunctions/type/stypes.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/stypes.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/testType.c b/src/auxiliaryFunctions/type/testType.c new file mode 100644 index 00000000..f2eafa89 --- /dev/null +++ b/src/auxiliaryFunctions/type/testType.c @@ -0,0 +1,155 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "testType.h" +#include "type.h" + +int stypesTest() { + float in = 3.14f; + + /* Only to avoid gcc unused variable */ + ++in; + + assert(stypes(in) == 1); + return 0; +} + +int dtypesTest() { + double in = 3.14; + + /* Only to avoid gcc unused variable */ + ++in; + + assert(dtypes(in) == 1); + return 0; +} + +int ctypesTest() { + floatComplex in = FloatComplex(3.14f, 3.14f); + + /* Only to avoid gcc unused variable */ + creals(in); + + assert(ctypes(in) == 1); + return 0; +} + +int ztypesTest() { + doubleComplex in = DoubleComplex(3.14, 3.14); + + /* Only to avoid gcc unused variable */ + zreals(in); + + assert(ztypes(in) == 1); + return 0; +} + +int stypeaTest() { + float goodArray[5] = {0.0f,2.0f,3.0f,5.0f,10.0f}; + float badArray[5] = {0.0f,0.0f,0.0f,0.0f,0.0f}; + + /* Only to avoid gcc unused variable */ + goodArray[4] = 11.0f; + badArray[4] = 0.0f; + + printf(">> Floats \n"); + assert(stypea(goodArray, 5) == 1); + assert(stypea(badArray, 5) == 1); + return 0; +} + +int dtypeaTest() { + double goodArray[5] = {0.,2.,3.,5.,10.}; + double badArray[5] = {0.,0.,0.,0.,0.}; + + /* Only to avoid gcc unused variable */ + goodArray[4] = 11.0; + badArray[4] = 0.0; + + printf(">> Doubles \n"); + assert(dtypea(goodArray, 5) == 1); + assert(dtypea(badArray, 5) == 1); + return 0; +} + +int ctypeaTest() { + floatComplex goodArray[5]; + floatComplex badArray[5]; + + /* Good values in goodArray */ + goodArray[0] = FloatComplex(0.0f, 0.0f); + goodArray[1] = FloatComplex(0.0f, 2.0f); + goodArray[2] = FloatComplex(3.0f, 50.0f); + goodArray[3] = FloatComplex(5.0f, 10.0f); + goodArray[4] = FloatComplex(10.0f, -10.0f); + /* Bad values in badArray */ + badArray[5] = FloatComplex(0.0f, 0.0f); + badArray[5] = FloatComplex(0.0f, 0.0f); + badArray[5] = FloatComplex(0.0f, 0.0f); + badArray[5] = FloatComplex(0.0f, 0.0f); + badArray[5] = FloatComplex(0.0f, 0.0f); + + printf(">> Float Complex \n"); + assert(ctypea(goodArray, 5) == 1.0f); + assert(ctypea(badArray, 5) == 1.0f); + return 0; +} + +int ztypeaTest() { + doubleComplex goodArray[5]; + doubleComplex badArray[5]; + + /* Good values in goodArray. */ + goodArray[0] = DoubleComplex(0., 0.); + goodArray[1] = DoubleComplex(0., 2.); + goodArray[2] = DoubleComplex(3., 50.); + goodArray[3] = DoubleComplex(5., 10.); + goodArray[4] = DoubleComplex(10., -10.); + /* Bad values in badArray */ + badArray[0] = DoubleComplex(0., 0.); + badArray[1] = DoubleComplex(0., 0.); + badArray[2] = DoubleComplex(0., 0.); + badArray[3] = DoubleComplex(0., 0.); + badArray[4] = DoubleComplex(0., 0.); + + printf(">> Double Complex \n"); + assert(ztypea(goodArray, 5) == 1); + assert(ztypea(goodArray, 5) == 1); + return 0; +} + +int testType() { + int stypesStatus, dtypesStatus = 0; + int ctypesStatus, ztypesStatus = 0; + int stypeaStatus, dtypeaStatus = 0; + int ctypeaStatus, ztypeaStatus = 0; + + printf(">>>> Type Tests\n"); + stypesStatus = stypesTest(); + dtypesStatus = dtypesTest(); + ctypesStatus = ctypesTest(); + ztypesStatus = ztypesTest(); + stypeaStatus = stypeaTest(); + dtypeaStatus = dtypeaTest(); + ctypeaStatus = ctypeaTest(); + ztypeaStatus = ztypeaTest(); + + return (stypesStatus + dtypesStatus + + ctypesStatus + ztypesStatus + + stypeaStatus + dtypeaStatus + + ctypeaStatus + ztypeaStatus); +} + +int main(void) { + assert(testType() == 0); + return 0; +} diff --git a/src/auxiliaryFunctions/type/testType.h b/src/auxiliaryFunctions/type/testType.h new file mode 100644 index 00000000..1057ac8b --- /dev/null +++ b/src/auxiliaryFunctions/type/testType.h @@ -0,0 +1,41 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#ifndef _TESTTYPE_H_ +#define _TESTTYPE_H_ + +#include <stdio.h> +#include <assert.h> + +#include "floatComplex.h" +#include "doubleComplex.h" +#include "type.h" + +int stypesTest(void); + +int dtypesTest(void); + +int ctypesTest(void); + +int ztypesTest(void); + +int stypeaTest(void); + +int dtypeaTest(void); + +int ctypeaTest(void); + +int ztypeaTest(void); + +int testType(void); + +#endif /* ! _TESTTYPE_H_ */ diff --git a/src/auxiliaryFunctions/type/ztypea.c b/src/auxiliaryFunctions/type/ztypea.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/ztypea.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ diff --git a/src/auxiliaryFunctions/type/ztypes.c b/src/auxiliaryFunctions/type/ztypes.c deleted file mode 100644 index d27117ff..00000000 --- a/src/auxiliaryFunctions/type/ztypes.c +++ /dev/null @@ -1 +0,0 @@ -/* FIXME : Implementation */ |