diff options
author | jofret | 2007-03-23 10:05:02 +0000 |
---|---|---|
committer | jofret | 2007-03-23 10:05:02 +0000 |
commit | 423b129433254f7c4e5c4a0be5730d0d1c5454ab (patch) | |
tree | 37a157eb5429b445282848ecb299e3428bfcb47e /src/type/testDoubleComplex.c | |
parent | e733d0ce2c4d804896031c0789fa192106508a35 (diff) | |
download | scilab2c-423b129433254f7c4e5c4a0be5730d0d1c5454ab.tar.gz scilab2c-423b129433254f7c4e5c4a0be5730d0d1c5454ab.tar.bz2 scilab2c-423b129433254f7c4e5c4a0be5730d0d1c5454ab.zip |
* src/type/Makefile :
Removed : delegate to AutoTools.
* src/type/Makefile.am :
Automake file.
* src/type/Makefile.in :
Automake generated file : ./configure needed.
* src/type/testFloatComplex.c :
Test Float Complex generation :
Assert + AutoCheck through AutoTools.
* src/type/testDoubleComplex.c :
Test Double Complex generation :
Assert + AutoCheck through AutoTools.
Diffstat (limited to 'src/type/testDoubleComplex.c')
-rw-r--r-- | src/type/testDoubleComplex.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/type/testDoubleComplex.c b/src/type/testDoubleComplex.c index 704613c0..0823a39b 100644 --- a/src/type/testDoubleComplex.c +++ b/src/type/testDoubleComplex.c @@ -5,36 +5,30 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:59:04 2006 jofret -** Last update Fri Feb 23 16:19:35 2007 jofret +** Last update Fri Mar 23 11:11:25 2007 jofret ** ** Copyright INRIA 2006 */ -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif - -#ifndef STDC99 -# include <stdio.h> -# include "doubleComplex.h" -#else -# include <stdio.h> -# include <complex.h> -# include "doubleComplexC99.h" -#endif - +#include <stdio.h> +#include <assert.h> +#include "doubleComplex.h" int main(int argc, char **argv) { /* z = -3 + 25*%i */ doubleComplex z = DoubleComplex(-3,25); printf("Partie reelle = %f\n", zreals(z)); + assert(zreals(z) == -3); printf("Partie imaginaire = %f\n", zimags(z)); + assert(zimags(z) == 25); + + /* z = -3.123456 + 25.123456*%i */ + z = DoubleComplex(-3.123456,25.123456); + printf("Partie reelle = %f\n", zreals(z)); + assert(zreals(z) == (double)-3.123456); + printf("Partie imaginaire = %f\n", zimags(z)); + assert(zimags(z) == (double)25.123456); + + return 0; } |