summaryrefslogtreecommitdiff
path: root/src/auxiliaryFunctions/isempty/testIsEmpty.c
diff options
context:
space:
mode:
authorjofret2009-04-28 06:52:28 +0000
committerjofret2009-04-28 06:52:28 +0000
commit127ac18608c72acfed9d59599252ad62cb562ee5 (patch)
treeefb7e9416342cd3758bf623710c46d2d4cdb5df4 /src/auxiliaryFunctions/isempty/testIsEmpty.c
parentc1abfc271612a255d4491f2e0220bace5fdf11d2 (diff)
downloadscilab2c-127ac18608c72acfed9d59599252ad62cb562ee5.tar.gz
scilab2c-127ac18608c72acfed9d59599252ad62cb562ee5.tar.bz2
scilab2c-127ac18608c72acfed9d59599252ad62cb562ee5.zip
Moving source code
Diffstat (limited to 'src/auxiliaryFunctions/isempty/testIsEmpty.c')
-rw-r--r--src/auxiliaryFunctions/isempty/testIsEmpty.c159
1 files changed, 0 insertions, 159 deletions
diff --git a/src/auxiliaryFunctions/isempty/testIsEmpty.c b/src/auxiliaryFunctions/isempty/testIsEmpty.c
deleted file mode 100644
index 011b5d2f..00000000
--- a/src/auxiliaryFunctions/isempty/testIsEmpty.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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 "testIsEmpty.h"
-
-int sisemptyaTest() {
- int result = 0;
- float *empty;
- float full[5] = {1., 2., 3., 0., 0.};
- float out;
-
- empty = NULL;
- full[4]=0;
-
- printf(">> Float array\n");
-
- out=sisemptya(empty, 0);
- if (out == 0) {
- printf("ERROR1 ! : Test Failed (empty array)\n");
- result = ERROR;
- }
- assert (out == 1);
-
-
- out = sisemptya(full, 5);
- if ( out == 1) {
- printf("ERROR2 ! : Test Failed (non empty array)\n");
- result = ERROR;
- }
- assert(out == 0);
-
- return result;
-}
-
-int disemptyaTest() {
- int result = 0;
- double *empty;
- double full[5] = {1., 2., 3., 0., 0.};
- double out;
-
- empty = NULL;
- full[4]=0;
-
-
- printf(">> Double array\n");
- out=disemptya(empty, 0);
- if (out == 0) {
- printf("ERROR1 ! : Test Failed (empty array)\n");
- result = ERROR;
- }
-
- assert(out == 1);
-
-
- out=disemptya(full, 5);
- if (out == 1) {
- printf("ERROR2 ! : Test Failed (non empty array)\n");
- result = ERROR;
- }
- assert(out == 0);
-
- return result;
-}
-
-int cisemptyaTest() {
- int result = 0;
- floatComplex *empty;
- floatComplex full[5];
- float out;
-
- empty=NULL;
-
- full[0] = FloatComplex(0.,1.);
- full[1] = FloatComplex(0., 2.);
- full[2] = FloatComplex(0., 3.);
- full[3] = FloatComplex(0., 0.);
- full[4] = FloatComplex(0., 0.);
-
- printf(">> Float Complex array\n");
-
- out = cisemptya(empty, 0);
- if (out == 0) {
- printf("ERROR1 ! : Test Failed (empty array)\n");
- result = ERROR;
- }
- assert (out == 1);
-
-
- out = cisemptya(full, 5);
- if (out == 1) {
- printf("ERROR2 ! : Test Failed (non empty array)\n");
- result = ERROR;
- }
- assert(out == 0);
-
-
- return result;
-}
-
-int zisemptyaTest() {
- int result = 0;
- doubleComplex *empty;
- doubleComplex full[5];
- double out;
-
- empty=NULL;
-
- full[0] = DoubleComplex(0.,1.);
- full[1] = DoubleComplex(0., 2.);
- full[2] = DoubleComplex(0., 3.);
- full[3] = DoubleComplex(0., 0.);
- full[4] = DoubleComplex(0., 0.);;
-
- printf(">> Double Complex array\n");
-
- out = zisemptya(empty, 0);
- if (out == 0) {
- printf("ERROR1 ! : Test Failed (empty array)\n");
- result = ERROR;
- }
- assert (out == 1);
-
- out = zisemptya(full, 5);
- if (out == 1) {
- printf("ERROR2 ! : Test Failed (non empty array)\n");
- result = ERROR;
- }
- assert(out == 0);
-
-
- return result;
-}
-
-
-int testIsEmpty() {
- int sisemptyaTestStatus, disemptyaTestStatus = 0;
- int cisemptyaTestStatus, zisemptyaTestStatus = 0;
- printf("\n>>>> IsEmpty Tests\n");
- sisemptyaTestStatus = sisemptyaTest();
- disemptyaTestStatus = disemptyaTest();
- cisemptyaTestStatus = cisemptyaTest();
- zisemptyaTestStatus = zisemptyaTest();
- return (sisemptyaTestStatus + disemptyaTestStatus +
- cisemptyaTestStatus + zisemptyaTestStatus);
-}
-
-int main(void) {
- assert(testIsEmpty() == 0);
- return 0;
-}