summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimon2008-07-04 11:16:59 +0000
committersimon2008-07-04 11:16:59 +0000
commit3813a171f1e87c2225ac1e78340a9e1ba1b3bfb8 (patch)
tree1d72b10a9e456d57923ff2f7d0e2b12d77a667b4
parent971c703d0ed71d4b21a86d78ab79042ae0df5f8f (diff)
downloadscilab2c-3813a171f1e87c2225ac1e78340a9e1ba1b3bfb8.tar.gz
scilab2c-3813a171f1e87c2225ac1e78340a9e1ba1b3bfb8.tar.bz2
scilab2c-3813a171f1e87c2225ac1e78340a9e1ba1b3bfb8.zip
added test for display
-rw-r--r--src/string/disp/Makefile.am13
-rw-r--r--src/string/disp/Makefile.in83
-rw-r--r--src/string/disp/testDisp.c106
3 files changed, 138 insertions, 64 deletions
diff --git a/src/string/disp/Makefile.am b/src/string/disp/Makefile.am
index 0d8d5d85..d7464a91 100644
--- a/src/string/disp/Makefile.am
+++ b/src/string/disp/Makefile.am
@@ -39,17 +39,14 @@ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \
$(top_builddir)/type/libFloatComplex.la \
$(top_builddir)/string/disp/libDisp.la
-check_PROGRAMS = testFloatDisp testDoubleDisp
+check_PROGRAMS = testDisp
-TESTS = testFloatDisp testDoubleDisp
+TESTS = testDisp
#
# -*- Dispine Tests -*-
#
-testFloatDisp_SOURCES = testDisp.h testFloatDisp.c
-testFloatDisp_CFLAGS = $(check_INCLUDES)
-testFloatDisp_LDADD = $(check_LDADD)
+testDisp_SOURCES = testDisp.c
+testDisp_CFLAGS = $(check_INCLUDES)
+testDisp_LDADD = $(check_LDADD)
-testDoubleDisp_SOURCES = testDisp.h testDoubleDisp.c
-testDoubleDisp_CFLAGS = $(check_INCLUDES)
-testDoubleDisp_LDADD = $(check_LDADD)
diff --git a/src/string/disp/Makefile.in b/src/string/disp/Makefile.in
index 5815dbf8..d9918de7 100644
--- a/src/string/disp/Makefile.in
+++ b/src/string/disp/Makefile.in
@@ -32,8 +32,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = testFloatDisp$(EXEEXT) testDoubleDisp$(EXEEXT)
-TESTS = testFloatDisp$(EXEEXT) testDoubleDisp$(EXEEXT)
+check_PROGRAMS = testDisp$(EXEEXT)
+TESTS = testDisp$(EXEEXT)
subdir = string/disp
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -62,18 +62,12 @@ libDisp_la_OBJECTS = $(am_libDisp_la_OBJECTS)
libDisp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libDisp_la_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_testDoubleDisp_OBJECTS = testDoubleDisp-testDoubleDisp.$(OBJEXT)
-testDoubleDisp_OBJECTS = $(am_testDoubleDisp_OBJECTS)
-testDoubleDisp_DEPENDENCIES = $(check_LDADD)
-testDoubleDisp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleDisp_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_testFloatDisp_OBJECTS = testFloatDisp-testFloatDisp.$(OBJEXT)
-testFloatDisp_OBJECTS = $(am_testFloatDisp_OBJECTS)
-testFloatDisp_DEPENDENCIES = $(check_LDADD)
-testFloatDisp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatDisp_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_testDisp_OBJECTS = testDisp-testDisp.$(OBJEXT)
+testDisp_OBJECTS = $(am_testDisp_OBJECTS)
+testDisp_DEPENDENCIES = $(check_LDADD)
+testDisp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(testDisp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
@@ -86,10 +80,8 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(libDisp_la_SOURCES) $(testDoubleDisp_SOURCES) \
- $(testFloatDisp_SOURCES)
-DIST_SOURCES = $(libDisp_la_SOURCES) $(testDoubleDisp_SOURCES) \
- $(testFloatDisp_SOURCES)
+SOURCES = $(libDisp_la_SOURCES) $(testDisp_SOURCES)
+DIST_SOURCES = $(libDisp_la_SOURCES) $(testDisp_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -233,12 +225,9 @@ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \
#
# -*- Dispine Tests -*-
#
-testFloatDisp_SOURCES = testDisp.h testFloatDisp.c
-testFloatDisp_CFLAGS = $(check_INCLUDES)
-testFloatDisp_LDADD = $(check_LDADD)
-testDoubleDisp_SOURCES = testDisp.h testDoubleDisp.c
-testDoubleDisp_CFLAGS = $(check_INCLUDES)
-testDoubleDisp_LDADD = $(check_LDADD)
+testDisp_SOURCES = testDisp.c
+testDisp_CFLAGS = $(check_INCLUDES)
+testDisp_LDADD = $(check_LDADD)
all: all-am
.SUFFIXES:
@@ -308,12 +297,9 @@ clean-checkPROGRAMS:
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
-testDoubleDisp$(EXEEXT): $(testDoubleDisp_OBJECTS) $(testDoubleDisp_DEPENDENCIES)
- @rm -f testDoubleDisp$(EXEEXT)
- $(testDoubleDisp_LINK) $(testDoubleDisp_OBJECTS) $(testDoubleDisp_LDADD) $(LIBS)
-testFloatDisp$(EXEEXT): $(testFloatDisp_OBJECTS) $(testFloatDisp_DEPENDENCIES)
- @rm -f testFloatDisp$(EXEEXT)
- $(testFloatDisp_LINK) $(testFloatDisp_OBJECTS) $(testFloatDisp_LDADD) $(LIBS)
+testDisp$(EXEEXT): $(testDisp_OBJECTS) $(testDisp_DEPENDENCIES)
+ @rm -f testDisp$(EXEEXT)
+ $(testDisp_LINK) $(testDisp_OBJECTS) $(testDisp_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -329,8 +315,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libDisp_la-sdisps.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libDisp_la-zdispa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libDisp_la-zdisps.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleDisp-testDoubleDisp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatDisp-testFloatDisp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDisp-testDisp.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -409,33 +394,19 @@ libDisp_la-zdispa.lo: zdispa.c
@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) $(libDisp_la_CFLAGS) $(CFLAGS) -c -o libDisp_la-zdispa.lo `test -f 'zdispa.c' || echo '$(srcdir)/'`zdispa.c
-testDoubleDisp-testDoubleDisp.o: testDoubleDisp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleDisp_CFLAGS) $(CFLAGS) -MT testDoubleDisp-testDoubleDisp.o -MD -MP -MF $(DEPDIR)/testDoubleDisp-testDoubleDisp.Tpo -c -o testDoubleDisp-testDoubleDisp.o `test -f 'testDoubleDisp.c' || echo '$(srcdir)/'`testDoubleDisp.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleDisp-testDoubleDisp.Tpo $(DEPDIR)/testDoubleDisp-testDoubleDisp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleDisp.c' object='testDoubleDisp-testDoubleDisp.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) $(testDoubleDisp_CFLAGS) $(CFLAGS) -c -o testDoubleDisp-testDoubleDisp.o `test -f 'testDoubleDisp.c' || echo '$(srcdir)/'`testDoubleDisp.c
-
-testDoubleDisp-testDoubleDisp.obj: testDoubleDisp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleDisp_CFLAGS) $(CFLAGS) -MT testDoubleDisp-testDoubleDisp.obj -MD -MP -MF $(DEPDIR)/testDoubleDisp-testDoubleDisp.Tpo -c -o testDoubleDisp-testDoubleDisp.obj `if test -f 'testDoubleDisp.c'; then $(CYGPATH_W) 'testDoubleDisp.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleDisp.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleDisp-testDoubleDisp.Tpo $(DEPDIR)/testDoubleDisp-testDoubleDisp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleDisp.c' object='testDoubleDisp-testDoubleDisp.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) $(testDoubleDisp_CFLAGS) $(CFLAGS) -c -o testDoubleDisp-testDoubleDisp.obj `if test -f 'testDoubleDisp.c'; then $(CYGPATH_W) 'testDoubleDisp.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleDisp.c'; fi`
-
-testFloatDisp-testFloatDisp.o: testFloatDisp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatDisp_CFLAGS) $(CFLAGS) -MT testFloatDisp-testFloatDisp.o -MD -MP -MF $(DEPDIR)/testFloatDisp-testFloatDisp.Tpo -c -o testFloatDisp-testFloatDisp.o `test -f 'testFloatDisp.c' || echo '$(srcdir)/'`testFloatDisp.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatDisp-testFloatDisp.Tpo $(DEPDIR)/testFloatDisp-testFloatDisp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatDisp.c' object='testFloatDisp-testFloatDisp.o' libtool=no @AMDEPBACKSLASH@
+testDisp-testDisp.o: testDisp.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDisp_CFLAGS) $(CFLAGS) -MT testDisp-testDisp.o -MD -MP -MF $(DEPDIR)/testDisp-testDisp.Tpo -c -o testDisp-testDisp.o `test -f 'testDisp.c' || echo '$(srcdir)/'`testDisp.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDisp-testDisp.Tpo $(DEPDIR)/testDisp-testDisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDisp.c' object='testDisp-testDisp.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) $(testFloatDisp_CFLAGS) $(CFLAGS) -c -o testFloatDisp-testFloatDisp.o `test -f 'testFloatDisp.c' || echo '$(srcdir)/'`testFloatDisp.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDisp_CFLAGS) $(CFLAGS) -c -o testDisp-testDisp.o `test -f 'testDisp.c' || echo '$(srcdir)/'`testDisp.c
-testFloatDisp-testFloatDisp.obj: testFloatDisp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatDisp_CFLAGS) $(CFLAGS) -MT testFloatDisp-testFloatDisp.obj -MD -MP -MF $(DEPDIR)/testFloatDisp-testFloatDisp.Tpo -c -o testFloatDisp-testFloatDisp.obj `if test -f 'testFloatDisp.c'; then $(CYGPATH_W) 'testFloatDisp.c'; else $(CYGPATH_W) '$(srcdir)/testFloatDisp.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatDisp-testFloatDisp.Tpo $(DEPDIR)/testFloatDisp-testFloatDisp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatDisp.c' object='testFloatDisp-testFloatDisp.obj' libtool=no @AMDEPBACKSLASH@
+testDisp-testDisp.obj: testDisp.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDisp_CFLAGS) $(CFLAGS) -MT testDisp-testDisp.obj -MD -MP -MF $(DEPDIR)/testDisp-testDisp.Tpo -c -o testDisp-testDisp.obj `if test -f 'testDisp.c'; then $(CYGPATH_W) 'testDisp.c'; else $(CYGPATH_W) '$(srcdir)/testDisp.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDisp-testDisp.Tpo $(DEPDIR)/testDisp-testDisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDisp.c' object='testDisp-testDisp.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) $(testFloatDisp_CFLAGS) $(CFLAGS) -c -o testFloatDisp-testFloatDisp.obj `if test -f 'testFloatDisp.c'; then $(CYGPATH_W) 'testFloatDisp.c'; else $(CYGPATH_W) '$(srcdir)/testFloatDisp.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDisp_CFLAGS) $(CFLAGS) -c -o testDisp-testDisp.obj `if test -f 'testDisp.c'; then $(CYGPATH_W) 'testDisp.c'; else $(CYGPATH_W) '$(srcdir)/testDisp.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
diff --git a/src/string/disp/testDisp.c b/src/string/disp/testDisp.c
new file mode 100644
index 00000000..8ac9735e
--- /dev/null
+++ b/src/string/disp/testDisp.c
@@ -0,0 +1,106 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan Simon
+ *
+ * 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 "disp.h"
+#include <assert.h>
+
+#define SIZE 10000
+
+/*
+** \float scalars displaying test
+*/
+static void sdispaTest (void) {
+
+ int i = 0 ;
+ float tabF[SIZE] ;
+
+ for ( i = 0 ; i < SIZE ; ++i)
+ {
+ tabF[i] = (float) rand () ;
+ }
+
+ sdispa ( tabF, SIZE );
+}
+
+/*
+** \double scalars displaying test
+*/
+
+static void ddispaTest (void) {
+
+ int i = 0 ;
+ double tabD[SIZE] ;
+
+ for ( i = 0 ; i < SIZE ; ++i)
+ {
+ tabD[i] = (double) rand () ;
+ }
+
+ ddispa ( tabD, SIZE ) ;
+
+}
+
+
+/*
+** \float complexes displaying test
+*/
+static void cdispaTest (void) {
+
+ int i = 0 ;
+ floatComplex tabF[SIZE] ;
+
+ for ( i = 0 ; i < SIZE ; ++i)
+ {
+ tabF[i] = FloatComplex ((float) rand (), (float) rand());
+ }
+
+ cdispa ( tabF, SIZE ) ;
+}
+
+
+
+/*
+** \double complexes displaying test
+*/
+static void zdispaTest (void) {
+
+ int i = 0 ;
+ doubleComplex tabD[SIZE] ;
+
+ for ( i = 0 ; i < SIZE ; ++i)
+ {
+ tabD[i] = DoubleComplex ((double) rand (), (double) rand());
+ }
+
+ zdispa ( tabD, SIZE ) ;
+
+}
+
+
+
+static int testDisp (void) {
+
+ printf("\n>>>> Disp Tests\n");
+ sdispaTest();
+ ddispaTest();
+ cdispaTest();
+ zdispaTest();
+
+ return 0;
+}
+
+
+int main(void) {
+ assert(testDisp() == 0);
+ return 0;
+}