diff options
-rw-r--r-- | src/elementaryFunctions/sin/Makefile.am | 23 | ||||
-rw-r--r-- | src/elementaryFunctions/sin/Makefile.in | 142 | ||||
-rw-r--r-- | src/elementaryFunctions/sin/testSin.c | 64 | ||||
-rw-r--r-- | src/elementaryFunctions/sin/testSin.h | 27 | ||||
-rw-r--r-- | src/elementaryFunctions/sinh/Makefile.am | 23 | ||||
-rw-r--r-- | src/elementaryFunctions/sinh/Makefile.in | 142 | ||||
-rw-r--r-- | src/elementaryFunctions/sinh/testSinh.c | 64 | ||||
-rw-r--r-- | src/elementaryFunctions/sinh/testSinh.h | 27 | ||||
-rw-r--r-- | src/elementaryFunctions/sqrt/testSqrt.c | 64 | ||||
-rw-r--r-- | src/elementaryFunctions/sqrt/testSqrt.h | 27 | ||||
-rw-r--r-- | src/elementaryFunctions/tan/Makefile.am | 23 | ||||
-rw-r--r-- | src/elementaryFunctions/tan/Makefile.in | 142 | ||||
-rw-r--r-- | src/elementaryFunctions/tan/testTan.c | 64 | ||||
-rw-r--r-- | src/elementaryFunctions/tan/testTan.h | 27 | ||||
-rw-r--r-- | src/elementaryFunctions/tanh/Makefile.am | 25 | ||||
-rw-r--r-- | src/elementaryFunctions/tanh/Makefile.in | 142 | ||||
-rw-r--r-- | src/elementaryFunctions/tanh/testTanh.c | 91 | ||||
-rw-r--r-- | src/elementaryFunctions/tanh/testTanh.h | 39 |
18 files changed, 1112 insertions, 44 deletions
diff --git a/src/elementaryFunctions/sin/Makefile.am b/src/elementaryFunctions/sin/Makefile.am index 8efd6ab1..8bc00b9f 100644 --- a/src/elementaryFunctions/sin/Makefile.am +++ b/src/elementaryFunctions/sin/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 Sun Mar 25 20:57:34 2007 bruno +## Last update Wed Apr 18 16:50:03 2007 jofret ## ## Copyright INRIA 2007 ## @@ -31,3 +31,24 @@ SRC = ssins.c \ zsina.c HEAD = ../includes/sin.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_PROGRAMS = testSin + +TESTS = testSin + +# +# -*- Sine Tests -*- +# +testSin_SOURCES = testSin.c +testSin_CFLAGS = $(check_INCLUDES) +testSin_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSin.a \ + @LIBMATH@ diff --git a/src/elementaryFunctions/sin/Makefile.in b/src/elementaryFunctions/sin/Makefile.in index 413efbd1..feef12ce 100644 --- a/src/elementaryFunctions/sin/Makefile.in +++ b/src/elementaryFunctions/sin/Makefile.in @@ -36,6 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testSin$(EXEEXT) subdir = elementaryFunctions/sin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,6 +66,11 @@ am__objects_2 = ssins.$(OBJEXT) dsins.$(OBJEXT) csins.$(OBJEXT) \ csina.$(OBJEXT) zsina.$(OBJEXT) am_libSin_a_OBJECTS = $(am__objects_1) $(am__objects_2) libSin_a_OBJECTS = $(am_libSin_a_OBJECTS) +am_testSin_OBJECTS = testSin-testSin.$(OBJEXT) +testSin_OBJECTS = $(am_testSin_OBJECTS) +testSin_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSin.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +78,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 = $(libSin_a_SOURCES) -DIST_SOURCES = $(libSin_a_SOURCES) +SOURCES = $(libSin_a_SOURCES) $(testSin_SOURCES) +DIST_SOURCES = $(libSin_a_SOURCES) $(testSin_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -189,6 +195,25 @@ SRC = ssins.c \ zsina.c HEAD = ../includes/sin.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +TESTS = testSin + +# +# -*- Sine Tests -*- +# +testSin_SOURCES = testSin.c +testSin_CFLAGS = $(check_INCLUDES) +testSin_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSin.a \ + @LIBMATH@ + all: all-am .SUFFIXES: @@ -259,6 +284,12 @@ libSin.a: $(libSin_a_OBJECTS) $(libSin_a_DEPENDENCIES) $(libSin_a_AR) libSin.a $(libSin_a_OBJECTS) $(libSin_a_LIBADD) $(RANLIB) libSin.a +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +testSin$(EXEEXT): $(testSin_OBJECTS) $(testSin_DEPENDENCIES) + @rm -f testSin$(EXEEXT) + $(LINK) $(testSin_LDFLAGS) $(testSin_OBJECTS) $(testSin_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -271,6 +302,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsins.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssina.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssins.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSin-testSin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsina.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsins.Po@am__quote@ @@ -287,6 +319,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +testSin-testSin.o: testSin.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSin_CFLAGS) $(CFLAGS) -MT testSin-testSin.o -MD -MP -MF "$(DEPDIR)/testSin-testSin.Tpo" -c -o testSin-testSin.o `test -f 'testSin.c' || echo '$(srcdir)/'`testSin.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSin-testSin.Tpo" "$(DEPDIR)/testSin-testSin.Po"; else rm -f "$(DEPDIR)/testSin-testSin.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSin.c' object='testSin-testSin.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) $(testSin_CFLAGS) $(CFLAGS) -c -o testSin-testSin.o `test -f 'testSin.c' || echo '$(srcdir)/'`testSin.c + +testSin-testSin.obj: testSin.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSin_CFLAGS) $(CFLAGS) -MT testSin-testSin.obj -MD -MP -MF "$(DEPDIR)/testSin-testSin.Tpo" -c -o testSin-testSin.obj `if test -f 'testSin.c'; then $(CYGPATH_W) 'testSin.c'; else $(CYGPATH_W) '$(srcdir)/testSin.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSin-testSin.Tpo" "$(DEPDIR)/testSin-testSin.Po"; else rm -f "$(DEPDIR)/testSin-testSin.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSin.c' object='testSin-testSin.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) $(testSin_CFLAGS) $(CFLAGS) -c -o testSin-testSin.obj `if test -f 'testSin.c'; then $(CYGPATH_W) 'testSin.c'; else $(CYGPATH_W) '$(srcdir)/testSin.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -337,6 +383,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ @@ -365,6 +484,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: @@ -397,8 +518,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-instLIBRARIES clean-noinstLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -445,12 +566,13 @@ ps-am: uninstall-am: uninstall-info-am uninstall-instLIBRARIES -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-instLIBRARIES clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-instLIBRARIES install-man \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-instLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ diff --git a/src/elementaryFunctions/sin/testSin.c b/src/elementaryFunctions/sin/testSin.c new file mode 100644 index 00000000..0efe6396 --- /dev/null +++ b/src/elementaryFunctions/sin/testSin.c @@ -0,0 +1,64 @@ +/* +** -*- C -*- +** +** testSin.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:06:16 2006 jofret +** Last update Fri Mar 30 11:12:32 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "testSin.h" + +void ssinsTest() { + printf(">> Float scalar\n"); + printf("ssins(0) = %f\n", ssins((float) 0)); + printf("ssins(PI) = %f\n", ssins(PI)); + printf("ssins(PI/2) = %f\n", ssins(PI/2)); + printf("ssins(PI/3) = %f\n", ssins(PI/3)); + printf("ssins(PI/4) = %f\n", ssins(PI/4)); + printf("ssins(PI/6) = %f\n", ssins(PI/6)); + printf("ssins(-PI) = %f\n", ssins(-PI)); + printf("ssins(-PI/2) = %f\n", ssins(-PI/2)); + printf("ssins(-PI/3) = %f\n", ssins(-PI/3)); + printf("ssins(-PI/4) = %f\n", ssins(-PI/4)); + printf("ssins(-PI/6) = %f\n", ssins(-PI/6)); +} + +void dsinsTest() { + printf(">> Double scalar\n"); + printf("dsins(0) = %e\n", dsins((double) 0)); + printf("dsins(PI) = %e\n", dsins(PI)); + printf("dsins(PI/2) = %e\n", dsins(PI/2)); + printf("dsins(PI/3) = %e\n", dsins(PI/3)); + printf("dsins(PI/4) = %e\n", dsins(PI/4)); + printf("dsins(PI/6) = %e\n", dsins(PI/6)); + printf("dsins(-PI) = %e\n", dsins(-PI)); + printf("dsins(-PI/2) = %e\n", dsins(-PI/2)); + printf("dsins(-PI/3) = %e\n", dsins(-PI/3)); + printf("dsins(-PI/4) = %e\n", dsins(-PI/4)); + printf("dsins(-PI/6) = %e\n", dsins(-PI/6)); +} + +int testSin() { + printf("\n>>>> Sine Tests\n"); + ssinsTest(); + dsinsTest(); + /* FIXME : Implement some test here ... */ + /* + csinsTest(); + zsinsTest(); + ssinaTest(); + dsinaTest(); + csinaTest(); + zsinaTest(); + */ + return 0; +} + +int main(void) { + assert(testSin() == 0); + return 0; +} diff --git a/src/elementaryFunctions/sin/testSin.h b/src/elementaryFunctions/sin/testSin.h new file mode 100644 index 00000000..1921e331 --- /dev/null +++ b/src/elementaryFunctions/sin/testSin.h @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** testSin.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Mon Mar 26 17:21:21 2007 jofret +** Last update Fri Mar 30 12:04:46 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef _TESTSIN_H_ +#define _TESTSIN_H_ + +#include <stdio.h> +#include <assert.h> +#include "sin.h" +#include "constant.h" + +void ssinsTest(void); + +void dsinsTest(void); + +int testSin(void); + +#endif /* !_TESTSIN_H_ */ diff --git a/src/elementaryFunctions/sinh/Makefile.am b/src/elementaryFunctions/sinh/Makefile.am index 417b5579..91473362 100644 --- a/src/elementaryFunctions/sinh/Makefile.am +++ b/src/elementaryFunctions/sinh/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 Sun Mar 25 20:57:46 2007 bruno +## Last update Wed Apr 18 16:52:23 2007 jofret ## ## Copyright INRIA 2007 ## @@ -31,3 +31,24 @@ SRC = ssinhs.c \ zsinha.c HEAD = ../includes/sinh.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_PROGRAMS = testSinh + +TESTS = testSinh + +# +# -*- Hyperbolic Sine Tests -*- +# +testSinh_SOURCES = testSinh.c +testSinh_CFLAGS = $(check_INCLUDES) +testSinh_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSinh.a \ + @LIBMATH@ diff --git a/src/elementaryFunctions/sinh/Makefile.in b/src/elementaryFunctions/sinh/Makefile.in index 78f4bd76..0c575e5b 100644 --- a/src/elementaryFunctions/sinh/Makefile.in +++ b/src/elementaryFunctions/sinh/Makefile.in @@ -36,6 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testSinh$(EXEEXT) subdir = elementaryFunctions/sinh DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,6 +66,11 @@ am__objects_2 = ssinhs.$(OBJEXT) dsinhs.$(OBJEXT) csinhs.$(OBJEXT) \ csinha.$(OBJEXT) zsinha.$(OBJEXT) am_libSinh_a_OBJECTS = $(am__objects_1) $(am__objects_2) libSinh_a_OBJECTS = $(am_libSinh_a_OBJECTS) +am_testSinh_OBJECTS = testSinh-testSinh.$(OBJEXT) +testSinh_OBJECTS = $(am_testSinh_OBJECTS) +testSinh_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSinh.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +78,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 = $(libSinh_a_SOURCES) -DIST_SOURCES = $(libSinh_a_SOURCES) +SOURCES = $(libSinh_a_SOURCES) $(testSinh_SOURCES) +DIST_SOURCES = $(libSinh_a_SOURCES) $(testSinh_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -189,6 +195,25 @@ SRC = ssinhs.c \ zsinha.c HEAD = ../includes/sinh.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +TESTS = testSinh + +# +# -*- Hyperbolic Sine Tests -*- +# +testSinh_SOURCES = testSinh.c +testSinh_CFLAGS = $(check_INCLUDES) +testSinh_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSinh.a \ + @LIBMATH@ + all: all-am .SUFFIXES: @@ -259,6 +284,12 @@ libSinh.a: $(libSinh_a_OBJECTS) $(libSinh_a_DEPENDENCIES) $(libSinh_a_AR) libSinh.a $(libSinh_a_OBJECTS) $(libSinh_a_LIBADD) $(RANLIB) libSinh.a +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +testSinh$(EXEEXT): $(testSinh_OBJECTS) $(testSinh_DEPENDENCIES) + @rm -f testSinh$(EXEEXT) + $(LINK) $(testSinh_LDFLAGS) $(testSinh_OBJECTS) $(testSinh_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -271,6 +302,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsinhs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssinha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssinhs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSinh-testSinh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsinha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsinhs.Po@am__quote@ @@ -287,6 +319,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +testSinh-testSinh.o: testSinh.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSinh_CFLAGS) $(CFLAGS) -MT testSinh-testSinh.o -MD -MP -MF "$(DEPDIR)/testSinh-testSinh.Tpo" -c -o testSinh-testSinh.o `test -f 'testSinh.c' || echo '$(srcdir)/'`testSinh.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSinh-testSinh.Tpo" "$(DEPDIR)/testSinh-testSinh.Po"; else rm -f "$(DEPDIR)/testSinh-testSinh.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSinh.c' object='testSinh-testSinh.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) $(testSinh_CFLAGS) $(CFLAGS) -c -o testSinh-testSinh.o `test -f 'testSinh.c' || echo '$(srcdir)/'`testSinh.c + +testSinh-testSinh.obj: testSinh.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSinh_CFLAGS) $(CFLAGS) -MT testSinh-testSinh.obj -MD -MP -MF "$(DEPDIR)/testSinh-testSinh.Tpo" -c -o testSinh-testSinh.obj `if test -f 'testSinh.c'; then $(CYGPATH_W) 'testSinh.c'; else $(CYGPATH_W) '$(srcdir)/testSinh.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSinh-testSinh.Tpo" "$(DEPDIR)/testSinh-testSinh.Po"; else rm -f "$(DEPDIR)/testSinh-testSinh.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSinh.c' object='testSinh-testSinh.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) $(testSinh_CFLAGS) $(CFLAGS) -c -o testSinh-testSinh.obj `if test -f 'testSinh.c'; then $(CYGPATH_W) 'testSinh.c'; else $(CYGPATH_W) '$(srcdir)/testSinh.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -337,6 +383,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ @@ -365,6 +484,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: @@ -397,8 +518,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-instLIBRARIES clean-noinstLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -445,12 +566,13 @@ ps-am: uninstall-am: uninstall-info-am uninstall-instLIBRARIES -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-instLIBRARIES clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-instLIBRARIES install-man \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-instLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ diff --git a/src/elementaryFunctions/sinh/testSinh.c b/src/elementaryFunctions/sinh/testSinh.c new file mode 100644 index 00000000..acc837a2 --- /dev/null +++ b/src/elementaryFunctions/sinh/testSinh.c @@ -0,0 +1,64 @@ +/* +** -*- C -*- +** +** testSinh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:06:16 2006 jofret +** Last update Fri Mar 30 12:10:15 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "testSinh.h" + +void ssinhsTest() { + printf(">> Float scalar\n"); + printf("ssinhs(0) = %f\n", ssinhs((float) 0)); + printf("ssinhs(PI) = %f\n", ssinhs(PI)); + printf("ssinhs(PI/2) = %f\n", ssinhs(PI/2)); + printf("ssinhs(PI/3) = %f\n", ssinhs(PI/3)); + printf("ssinhs(PI/4) = %f\n", ssinhs(PI/4)); + printf("ssinhs(PI/6) = %f\n", ssinhs(PI/6)); + printf("ssinhs(-PI) = %f\n", ssinhs(-PI)); + printf("ssinhs(-PI/2) = %f\n", ssinhs(-PI/2)); + printf("ssinhs(-PI/3) = %f\n", ssinhs(-PI/3)); + printf("ssinhs(-PI/4) = %f\n", ssinhs(-PI/4)); + printf("ssinhs(-PI/6) = %f\n", ssinhs(-PI/6)); +} + +void dsinhsTest() { + printf(">> Double scalar\n"); + printf("dsinhs(0) = %e\n", dsinhs((double) 0)); + printf("dsinhs(PI) = %e\n", dsinhs(PI)); + printf("dsinhs(PI/2) = %e\n", dsinhs(PI/2)); + printf("dsinhs(PI/3) = %e\n", dsinhs(PI/3)); + printf("dsinhs(PI/4) = %e\n", dsinhs(PI/4)); + printf("dsinhs(PI/6) = %e\n", dsinhs(PI/6)); + printf("dsinhs(-PI) = %e\n", dsinhs(-PI)); + printf("dsinhs(-PI/2) = %e\n", dsinhs(-PI/2)); + printf("dsinhs(-PI/3) = %e\n", dsinhs(-PI/3)); + printf("dsinhs(-PI/4) = %e\n", dsinhs(-PI/4)); + printf("dsinhs(-PI/6) = %e\n", dsinhs(-PI/6)); +} + +int testSinh() { + printf("\n>>>> Hyperbolic Sine Tests\n"); + ssinhsTest(); + dsinhsTest(); + /* FIXME : Implement some test here ... */ + /* + csinhsTest(); + zsinhsTest(); + ssinhaTest(); + dsinhaTest(); + csinhaTest(); + zsinhaTest(); + */ + return 0; +} + +int main() { + assert(testSinh() == 0); + return 0; +} diff --git a/src/elementaryFunctions/sinh/testSinh.h b/src/elementaryFunctions/sinh/testSinh.h new file mode 100644 index 00000000..2e20b05c --- /dev/null +++ b/src/elementaryFunctions/sinh/testSinh.h @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** testSinh.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Mar 30 12:01:28 2007 jofret +** Last update Fri Mar 30 12:08:11 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef _TESTSINH_H_ +#define _TESTSINH_H_ + +#include <stdio.h> +#include <assert.h> +#include "sinh.h" +#include "constant.h" + +void ssinhsTest(void); + +void dsinhsTest(void); + +int testSinh(void); + +#endif /* !_TESTSINH_H_ */ diff --git a/src/elementaryFunctions/sqrt/testSqrt.c b/src/elementaryFunctions/sqrt/testSqrt.c new file mode 100644 index 00000000..c3bbddbe --- /dev/null +++ b/src/elementaryFunctions/sqrt/testSqrt.c @@ -0,0 +1,64 @@ +/* +** -*- C -*- +** +** testSqrt.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:06:16 2006 jofret +** Last update Fri Apr 20 10:53:23 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "testSqrt.h" + +void ssqrtsTest() { + printf(">> Float scalar\n"); + printf("ssqrts(0) = %f\n", ssqrts((float) 0)); + printf("ssqrts(PI) = %f\n", ssqrts(PI)); + printf("ssqrts(PI/2) = %f\n", ssqrts(PI/2)); + printf("ssqrts(PI/3) = %f\n", ssqrts(PI/3)); + printf("ssqrts(PI/4) = %f\n", ssqrts(PI/4)); + printf("ssqrts(PI/6) = %f\n", ssqrts(PI/6)); + printf("ssqrts(-PI) = %f\n", ssqrts(-PI)); + printf("ssqrts(-PI/2) = %f\n", ssqrts(-PI/2)); + printf("ssqrts(-PI/3) = %f\n", ssqrts(-PI/3)); + printf("ssqrts(-PI/4) = %f\n", ssqrts(-PI/4)); + printf("ssqrts(-PI/6) = %f\n", ssqrts(-PI/6)); +} + +void dsqrtsTest() { + printf(">> Double scalar\n"); + printf("dsqrts(0) = %e\n", dsqrts((double) 0)); + printf("dsqrts(PI) = %e\n", dsqrts(PI)); + printf("dsqrts(PI/2) = %e\n", dsqrts(PI/2)); + printf("dsqrts(PI/3) = %e\n", dsqrts(PI/3)); + printf("dsqrts(PI/4) = %e\n", dsqrts(PI/4)); + printf("dsqrts(PI/6) = %e\n", dsqrts(PI/6)); + printf("dsqrts(-PI) = %e\n", dsqrts(-PI)); + printf("dsqrts(-PI/2) = %e\n", dsqrts(-PI/2)); + printf("dsqrts(-PI/3) = %e\n", dsqrts(-PI/3)); + printf("dsqrts(-PI/4) = %e\n", dsqrts(-PI/4)); + printf("dsqrts(-PI/6) = %e\n", dsqrts(-PI/6)); +} + +int testSqrt() { + printf("\n>>>> Square Root Tests\n"); + ssqrtsTest(); + dsqrtsTest(); + /* FIXME : Implement some test here ... */ + /* + csqrtsTest(); + zsqrtsTest(); + ssqrtaTest(); + dsqrtaTest(); + csqrtaTest(); + zsqrtaTest(); + */ + return 0; +} + +int main() { + assert(testSqrt() == 0); + return 0; +} diff --git a/src/elementaryFunctions/sqrt/testSqrt.h b/src/elementaryFunctions/sqrt/testSqrt.h new file mode 100644 index 00000000..5761d293 --- /dev/null +++ b/src/elementaryFunctions/sqrt/testSqrt.h @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** testSqrt.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Mar 30 12:01:28 2007 jofret +** Last update Fri Apr 20 10:52:56 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef _TESTSQRT_H_ +#define _TESTSQRT_H_ + +#include <stdio.h> +#include <assert.h> +#include "sqrt.h" +#include "constant.h" + +void ssqrtsTest(void); + +void dsqrtsTest(void); + +int testSqrt(void); + +#endif /* !_TESTSQRT_H_ */ diff --git a/src/elementaryFunctions/tan/Makefile.am b/src/elementaryFunctions/tan/Makefile.am index d52d3956..b48157b3 100644 --- a/src/elementaryFunctions/tan/Makefile.am +++ b/src/elementaryFunctions/tan/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 Sun Mar 25 20:56:35 2007 bruno +## Last update Wed Apr 18 16:51:17 2007 jofret ## ## Copyright INRIA 2007 ## @@ -31,3 +31,24 @@ SRC = stans.c \ ztana.c HEAD = ../includes/tan.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_PROGRAMS = testTan + +TESTS = testTan + +# +# -*- Tangeant Tests -*- +# +testTan_SOURCES = testTan.c +testTan_CFLAGS = $(check_INCLUDES) +testTan_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTan.a \ + @LIBMATH@ diff --git a/src/elementaryFunctions/tan/Makefile.in b/src/elementaryFunctions/tan/Makefile.in index 48cc09ca..26b001db 100644 --- a/src/elementaryFunctions/tan/Makefile.in +++ b/src/elementaryFunctions/tan/Makefile.in @@ -36,6 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testTan$(EXEEXT) subdir = elementaryFunctions/tan DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,6 +66,11 @@ am__objects_2 = stans.$(OBJEXT) dtans.$(OBJEXT) ctans.$(OBJEXT) \ ctana.$(OBJEXT) ztana.$(OBJEXT) am_libTan_a_OBJECTS = $(am__objects_1) $(am__objects_2) libTan_a_OBJECTS = $(am_libTan_a_OBJECTS) +am_testTan_OBJECTS = testTan-testTan.$(OBJEXT) +testTan_OBJECTS = $(am_testTan_OBJECTS) +testTan_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTan.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +78,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 = $(libTan_a_SOURCES) -DIST_SOURCES = $(libTan_a_SOURCES) +SOURCES = $(libTan_a_SOURCES) $(testTan_SOURCES) +DIST_SOURCES = $(libTan_a_SOURCES) $(testTan_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -189,6 +195,25 @@ SRC = stans.c \ ztana.c HEAD = ../includes/tan.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +TESTS = testTan + +# +# -*- Tangeant Tests -*- +# +testTan_SOURCES = testTan.c +testTan_CFLAGS = $(check_INCLUDES) +testTan_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTan.a \ + @LIBMATH@ + all: all-am .SUFFIXES: @@ -259,6 +284,12 @@ libTan.a: $(libTan_a_OBJECTS) $(libTan_a_DEPENDENCIES) $(libTan_a_AR) libTan.a $(libTan_a_OBJECTS) $(libTan_a_LIBADD) $(RANLIB) libTan.a +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +testTan$(EXEEXT): $(testTan_OBJECTS) $(testTan_DEPENDENCIES) + @rm -f testTan$(EXEEXT) + $(LINK) $(testTan_LDFLAGS) $(testTan_OBJECTS) $(testTan_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -271,6 +302,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtans.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stana.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stans.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testTan-testTan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ztana.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ztans.Po@am__quote@ @@ -287,6 +319,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +testTan-testTan.o: testTan.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testTan_CFLAGS) $(CFLAGS) -MT testTan-testTan.o -MD -MP -MF "$(DEPDIR)/testTan-testTan.Tpo" -c -o testTan-testTan.o `test -f 'testTan.c' || echo '$(srcdir)/'`testTan.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testTan-testTan.Tpo" "$(DEPDIR)/testTan-testTan.Po"; else rm -f "$(DEPDIR)/testTan-testTan.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testTan.c' object='testTan-testTan.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) $(testTan_CFLAGS) $(CFLAGS) -c -o testTan-testTan.o `test -f 'testTan.c' || echo '$(srcdir)/'`testTan.c + +testTan-testTan.obj: testTan.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testTan_CFLAGS) $(CFLAGS) -MT testTan-testTan.obj -MD -MP -MF "$(DEPDIR)/testTan-testTan.Tpo" -c -o testTan-testTan.obj `if test -f 'testTan.c'; then $(CYGPATH_W) 'testTan.c'; else $(CYGPATH_W) '$(srcdir)/testTan.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testTan-testTan.Tpo" "$(DEPDIR)/testTan-testTan.Po"; else rm -f "$(DEPDIR)/testTan-testTan.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testTan.c' object='testTan-testTan.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) $(testTan_CFLAGS) $(CFLAGS) -c -o testTan-testTan.obj `if test -f 'testTan.c'; then $(CYGPATH_W) 'testTan.c'; else $(CYGPATH_W) '$(srcdir)/testTan.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -337,6 +383,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ @@ -365,6 +484,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: @@ -397,8 +518,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-instLIBRARIES clean-noinstLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -445,12 +566,13 @@ ps-am: uninstall-am: uninstall-info-am uninstall-instLIBRARIES -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-instLIBRARIES clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-instLIBRARIES install-man \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-instLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ diff --git a/src/elementaryFunctions/tan/testTan.c b/src/elementaryFunctions/tan/testTan.c new file mode 100644 index 00000000..9200d3bb --- /dev/null +++ b/src/elementaryFunctions/tan/testTan.c @@ -0,0 +1,64 @@ +/* +** -*- C -*- +** +** testTan.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Fri Mar 30 11:24:54 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "testTan.h" + +void stansTest() { + printf(">> Float scalar\n"); + printf("stans(0) = %f\n", stans((float) 0)); + printf("stans(PI) = %f\n", stans(PI)); + printf("stans(PI/2) = %f\n", stans(PI/2)); + printf("stans(PI/3) = %f\n", stans(PI/3)); + printf("stans(PI/4) = %f\n", stans(PI/4)); + printf("stans(PI/6) = %f\n", stans(PI/6)); + printf("stans(-PI) = %f\n", stans(-PI)); + printf("stans(-PI/2) = %f\n", stans(-PI/2)); + printf("stans(-PI/3) = %f\n", stans(-PI/3)); + printf("stans(-PI/4) = %f\n", stans(-PI/4)); + printf("stans(-PI/6) = %f\n", stans(-PI/6)); +} + +void dtansTest() { + printf(">> Double scalar\n"); + printf("dtans(0) = %e\n", dtans((double) 0)); + printf("dtans(PI) = %e\n", dtans(PI)); + printf("dtans(PI/2) = %e\n", dtans(PI/2)); + printf("dtans(PI/3) = %e\n", dtans(PI/3)); + printf("dtans(PI/4) = %e\n", dtans(PI/4)); + printf("dtans(PI/6) = %e\n", dtans(PI/6)); + printf("dtans(-PI) = %e\n", dtans(-PI)); + printf("dtans(-PI/2) = %e\n", dtans(-PI/2)); + printf("dtans(-PI/3) = %e\n", dtans(-PI/3)); + printf("dtans(-PI/4) = %e\n", dtans(-PI/4)); + printf("dtans(-PI/6) = %e\n", dtans(-PI/6)); +} + +int testTan() { + printf("\n>>>> Tangeant Tests\n"); + stansTest(); + dtansTest(); + /* FIXME : Implement some test here ... */ + /* + ctansTest(); + ztansTest(); + stanaTest(); + dtanaTest(); + ctanaTest(); + ztanaTest(); + */ + return 0; +} + +int main() { + assert(testTan() == 0); + return 0; +} diff --git a/src/elementaryFunctions/tan/testTan.h b/src/elementaryFunctions/tan/testTan.h new file mode 100644 index 00000000..1e1cac62 --- /dev/null +++ b/src/elementaryFunctions/tan/testTan.h @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** testTan.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Mar 30 11:22:40 2007 jofret +** Last update Fri Mar 30 12:05:07 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef _TESTTAN_H_ +#define _TESTTAN_H_ + +#include <stdio.h> +#include <assert.h> +#include "tan.h" +#include "constant.h" + +void stansTest(void); + +void dtansTest(void); + +int testTan(void); + +#endif /* !_TESTTAN_H_ */ diff --git a/src/elementaryFunctions/tanh/Makefile.am b/src/elementaryFunctions/tanh/Makefile.am index c6ebda7e..a38e2914 100644 --- a/src/elementaryFunctions/tanh/Makefile.am +++ b/src/elementaryFunctions/tanh/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 Sun Mar 25 20:56:56 2007 bruno +## Last update Wed Apr 18 16:53:46 2007 jofret ## ## Copyright INRIA 2007 ## @@ -31,3 +31,26 @@ SRC = stanhs.c \ ztanha.c HEAD = ../includes/tanh.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_PROGRAMS = testTanh + +TESTS = testTanh + +# +# -*- Hyperbolic Tangeant Tests -*- +# +testTanh_SOURCES = testTanh.c +testTanh_CFLAGS = $(check_INCLUDES) +testTanh_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTanh.a \ + @LIBMATH@ + + diff --git a/src/elementaryFunctions/tanh/Makefile.in b/src/elementaryFunctions/tanh/Makefile.in index 7d3b883b..d9d86a05 100644 --- a/src/elementaryFunctions/tanh/Makefile.in +++ b/src/elementaryFunctions/tanh/Makefile.in @@ -36,6 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testTanh$(EXEEXT) subdir = elementaryFunctions/tanh DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,6 +66,11 @@ am__objects_2 = stanhs.$(OBJEXT) dtanhs.$(OBJEXT) ctanhs.$(OBJEXT) \ ctanha.$(OBJEXT) ztanha.$(OBJEXT) am_libTanh_a_OBJECTS = $(am__objects_1) $(am__objects_2) libTanh_a_OBJECTS = $(am_libTanh_a_OBJECTS) +am_testTanh_OBJECTS = testTanh-testTanh.$(OBJEXT) +testTanh_OBJECTS = $(am_testTanh_OBJECTS) +testTanh_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTanh.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +78,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 = $(libTanh_a_SOURCES) -DIST_SOURCES = $(libTanh_a_SOURCES) +SOURCES = $(libTanh_a_SOURCES) $(testTanh_SOURCES) +DIST_SOURCES = $(libTanh_a_SOURCES) $(testTanh_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -189,6 +195,25 @@ SRC = stanhs.c \ ztanha.c HEAD = ../includes/tanh.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +TESTS = testTanh + +# +# -*- Hyperbolic Tangeant Tests -*- +# +testTanh_SOURCES = testTanh.c +testTanh_CFLAGS = $(check_INCLUDES) +testTanh_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libTanh.a \ + @LIBMATH@ + all: all-am .SUFFIXES: @@ -259,6 +284,12 @@ libTanh.a: $(libTanh_a_OBJECTS) $(libTanh_a_DEPENDENCIES) $(libTanh_a_AR) libTanh.a $(libTanh_a_OBJECTS) $(libTanh_a_LIBADD) $(RANLIB) libTanh.a +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +testTanh$(EXEEXT): $(testTanh_OBJECTS) $(testTanh_DEPENDENCIES) + @rm -f testTanh$(EXEEXT) + $(LINK) $(testTanh_LDFLAGS) $(testTanh_OBJECTS) $(testTanh_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -271,6 +302,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtanhs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stanha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stanhs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testTanh-testTanh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ztanha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ztanhs.Po@am__quote@ @@ -287,6 +319,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +testTanh-testTanh.o: testTanh.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testTanh_CFLAGS) $(CFLAGS) -MT testTanh-testTanh.o -MD -MP -MF "$(DEPDIR)/testTanh-testTanh.Tpo" -c -o testTanh-testTanh.o `test -f 'testTanh.c' || echo '$(srcdir)/'`testTanh.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testTanh-testTanh.Tpo" "$(DEPDIR)/testTanh-testTanh.Po"; else rm -f "$(DEPDIR)/testTanh-testTanh.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testTanh.c' object='testTanh-testTanh.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) $(testTanh_CFLAGS) $(CFLAGS) -c -o testTanh-testTanh.o `test -f 'testTanh.c' || echo '$(srcdir)/'`testTanh.c + +testTanh-testTanh.obj: testTanh.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testTanh_CFLAGS) $(CFLAGS) -MT testTanh-testTanh.obj -MD -MP -MF "$(DEPDIR)/testTanh-testTanh.Tpo" -c -o testTanh-testTanh.obj `if test -f 'testTanh.c'; then $(CYGPATH_W) 'testTanh.c'; else $(CYGPATH_W) '$(srcdir)/testTanh.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testTanh-testTanh.Tpo" "$(DEPDIR)/testTanh-testTanh.Po"; else rm -f "$(DEPDIR)/testTanh-testTanh.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testTanh.c' object='testTanh-testTanh.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) $(testTanh_CFLAGS) $(CFLAGS) -c -o testTanh-testTanh.obj `if test -f 'testTanh.c'; then $(CYGPATH_W) 'testTanh.c'; else $(CYGPATH_W) '$(srcdir)/testTanh.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -337,6 +383,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ @@ -365,6 +484,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: @@ -397,8 +518,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-instLIBRARIES clean-noinstLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -445,12 +566,13 @@ ps-am: uninstall-am: uninstall-info-am uninstall-instLIBRARIES -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-instLIBRARIES clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-instLIBRARIES install-man \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-instLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ diff --git a/src/elementaryFunctions/tanh/testTanh.c b/src/elementaryFunctions/tanh/testTanh.c new file mode 100644 index 00000000..f0ee3e61 --- /dev/null +++ b/src/elementaryFunctions/tanh/testTanh.c @@ -0,0 +1,91 @@ +/* +** -*- C -*- +** +** testTanh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Fri Mar 30 14:07:53 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "testTanh.h" + +void stanhsTest() { + printf(">> Float scalar\n"); + printf("stanhs(0) = %f\n", stanhs((float) 0)); + printf("stanhs(PI) = %f\n", stanhs(PI)); + printf("stanhs(PI/2) = %f\n", stanhs(PI/2)); + printf("stanhs(PI/3) = %f\n", stanhs(PI/3)); + printf("stanhs(PI/4) = %f\n", stanhs(PI/4)); + printf("stanhs(PI/6) = %f\n", stanhs(PI/6)); + printf("stanhs(-PI) = %f\n", stanhs(-PI)); + printf("stanhs(-PI/2) = %f\n", stanhs(-PI/2)); + printf("stanhs(-PI/3) = %f\n", stanhs(-PI/3)); + printf("stanhs(-PI/4) = %f\n", stanhs(-PI/4)); + printf("stanhs(-PI/6) = %f\n", stanhs(-PI/6)); +} + +void dtanhsTest() { + printf(">> Double scalar\n"); + printf("dtanhs(0) = %e\n", dtanhs((double) 0)); + printf("dtanhs(PI) = %e\n", dtanhs(PI)); + printf("dtanhs(PI/2) = %e\n", dtanhs(PI/2)); + printf("dtanhs(PI/3) = %e\n", dtanhs(PI/3)); + printf("dtanhs(PI/4) = %e\n", dtanhs(PI/4)); + printf("dtanhs(PI/6) = %e\n", dtanhs(PI/6)); + printf("dtanhs(-PI) = %e\n", dtanhs(-PI)); + printf("dtanhs(-PI/2) = %e\n", dtanhs(-PI/2)); + printf("dtanhs(-PI/3) = %e\n", dtanhs(-PI/3)); + printf("dtanhs(-PI/4) = %e\n", dtanhs(-PI/4)); + printf("dtanhs(-PI/6) = %e\n", dtanhs(-PI/6)); +} + +void ctanhsTest() { + printf(">> Float Complex scalar\n"); + /* FIXME : Implement some test here ... */ +} + +void ztanhsTest() { + printf(">> Double Complex scalar\n"); + /* FIXME : Implement some test here ... */ +} + +void stanhaTest() { + printf(">> Float array\n"); + /* FIXME : Implement some test here ... */ +} + +void dtanhaTest() { + printf(">> Double array\n"); + /* FIXME : Implement some test here ... */ +} + +void ctanhaTest() { + printf(">> Float Complex array\n"); + /* FIXME : Implement some test here ... */ +} + +void ztanhaTest() { + printf(">> Double Complex array\n"); + /* FIXME : Implement some test here ... */ +} + +int testTanh() { + printf("\n>>>> Hyperbolic Tangeant Tests\n"); + stanhsTest(); + dtanhsTest(); + ctanhsTest(); + ztanhsTest(); + stanhaTest(); + dtanhaTest(); + ctanhaTest(); + ztanhaTest(); + return 0; +} + +int main() { + assert(testTanh() == 0); + return 0; +} diff --git a/src/elementaryFunctions/tanh/testTanh.h b/src/elementaryFunctions/tanh/testTanh.h new file mode 100644 index 00000000..35c3b565 --- /dev/null +++ b/src/elementaryFunctions/tanh/testTanh.h @@ -0,0 +1,39 @@ +/* +** -*- C -*- +** +** testTanh.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Mar 30 14:04:02 2007 jofret +** Last update Fri Mar 30 14:12:06 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#ifndef _TESTTANH_H_ +#define _TESTTANH_H_ + +#include <stdio.h> +#include <assert.h> +#include "tanh.h" +#include "constant.h" + +void stanhsTest(void); + +void dtanhsTest(void); + +void ctanhsTest(void); + +void ztanhsTest(void); + +void stanhaTest(void); + +void dtanhaTest(void); + +void ctanhaTest(void); + +void ztanhaTest(void); + +int testTanh(void); + +#endif /* !_TESTTANH_H_ */ |