From 8b44229ef44f0558ce045e46ff833fb44df913c9 Mon Sep 17 00:00:00 2001 From: jofret Date: Mon, 21 Jun 2010 06:24:38 +0000 Subject: Tagging the 2.0 release of scilab2c --- src/c/auxiliaryFunctions/find2d/testFind2d.c | 532 +++++++++++++++++++++++++++ 1 file changed, 532 insertions(+) create mode 100644 src/c/auxiliaryFunctions/find2d/testFind2d.c (limited to 'src/c/auxiliaryFunctions/find2d/testFind2d.c') diff --git a/src/c/auxiliaryFunctions/find2d/testFind2d.c b/src/c/auxiliaryFunctions/find2d/testFind2d.c new file mode 100644 index 00000000..1fcfdc9e --- /dev/null +++ b/src/c/auxiliaryFunctions/find2d/testFind2d.c @@ -0,0 +1,532 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 "testFind2d.h" +#include + +int sfind2daTest() { + int result = 0, i = 0; + float goodArray[6] = {0.,2.,3.,0.,5.,10.}; + float badArray[6] = {0.,0.,0.,0.,0.,0.}; + float out1_1_6[4] = {1.,1.,1.,1.}; + float out1_2_3[4] = {1.,1.,2.,2.}; + float out1_3_2[4] = {2.,2.,3.,3.}; + float out1_6_1[4] = {2.,3.,5.,6.}; + float out2_1_6[4] = {2.,3.,5.,6.}; + float out2_2_3[4] = {2.,3.,1.,3.}; + float out2_3_2[4] = {1.,2.,1.,2.}; + float out2_6_1[4] = {1.,1.,1.,1.}; + float out1Good[6] = {0}, out1Bad[6] = {0}, out2Good[6] = {0}, out2Bad[6] = {0}; + int size1[2]={0},size2[2]={0}; + printf(">> Floats \n"); + + /* Test tab 1 ligne 6 colonnes */ + sfind2da(goodArray, 1, 6, out1Good, size1, out2Good, size2 , -1); + + + for (i=0;i> Double \n"); + + /* Test tab 1 ligne 6 colonnes */ + dfind2da(goodArray, 1, 6, out1Good, size1, out2Good, size2,-1); + + + for (i=0;i> Float Complex \n"); + + /* Test tab 1 ligne 6 colonnes */ + cfind2da(goodArray, 1, 6, out1Good, size1, out2Good, size2,-1); + + + for (i=0;i> Double Complex \n"); + + /* Test tab 1 ligne 6 colonnes */ + zfind2da(goodArray, 1, 6, out1Good, size1, out2Good, size2,-1); + + + for (i=0;i>>> Find2d Tests\n"); + sfind2daStatus = sfind2daTest(); + dfind2daStatus = dfind2daTest(); + cfind2daStatus = cfind2daTest(); + zfind2daStatus = zfind2daTest(); + + return (sfind2daStatus + dfind2daStatus + + cfind2daStatus + zfind2daStatus); +} + +int main(void) { + assert(testFind2d() == 0); + return 0; +} -- cgit