From f9e5491e24254b630886080ffe315502cf9bcc6d Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 30 Mar 2001 12:31:15 +0000 Subject: [PATCH] *** empty log message *** --- allParam/test/int/i_conparam.c | 43 +++++++++++++++++ allParam/test/int/i_conparam.h | 6 +++ allParam/test/int/i_lowercase.c | 2 +- allParam/test/int/i_no_index.c | 2 +- allParam/test/int/i_no_setup.c | 43 +++++++++++++++++ allParam/test/int/i_no_setup.h | 6 +++ allParam/test/int/i_store.c | 8 ++-- allParam/test/int/i_store_existing.c | 8 ++-- allParam/test/int/i_store_multiple.c | 8 ++-- allParam/test/int/i_string_available.c | 4 +- allParam/test/int/i_uppercase.c | 2 +- allParam/test/int/ia_long_array.c | 2 +- allParam/test/int/ia_lowercase.c | 2 +- allParam/test/int/ia_no_index.c | 2 +- allParam/test/int/ia_short_array.c | 2 +- allParam/test/int/ia_string_available.c | 2 +- allParam/test/int/ia_uppercase.c | 2 +- allParam/test/test_p.tcl | 63 ------------------------- 18 files changed, 121 insertions(+), 86 deletions(-) create mode 100644 allParam/test/int/i_conparam.c create mode 100644 allParam/test/int/i_conparam.h create mode 100644 allParam/test/int/i_no_setup.c create mode 100644 allParam/test/int/i_no_setup.h delete mode 100644 allParam/test/test_p.tcl diff --git a/allParam/test/int/i_conparam.c b/allParam/test/int/i_conparam.c new file mode 100644 index 0000000..12481a8 --- /dev/null +++ b/allParam/test/int/i_conparam.c @@ -0,0 +1,43 @@ +#include +#include +#include + +#include + +#include "i_conparam.h" + +int i_conparam(const char *testid) { + Param *param; + char *name = "tname"; + char *idx = "tint"; + unsigned long int result; + int rows; + int retVal; + int myRetVal; + +#ifdef VERBOSE + printf("%s : Param_getInt: Lowercase input on correct statements.\n", testid); +#endif + + param = malloc(sizeof(Param)); + conParam(param); + + retVal = Param_getInt(param, name, idx, &rows, &result); + if ((rows == 1) && (result == 100) && (retVal == 0)) { + myRetVal = 0; + printf("%s : Passed.\n", testid); + } else { +#ifdef VERBOSE + printf("%s : Failed. Rows: %d, result: \'%ld\', return Value: %d.\n", testid, rows, result, retVal); + printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); +#else + printf("%s : Failed.\n", testid); +#endif + myRetVal = -1; + } + desParam(param); + free(param); + + return myRetVal; +} + diff --git a/allParam/test/int/i_conparam.h b/allParam/test/int/i_conparam.h new file mode 100644 index 0000000..f66e37c --- /dev/null +++ b/allParam/test/int/i_conparam.h @@ -0,0 +1,6 @@ +#ifndef I_CONPARAM_H +#define I_CONPARAM_H + +int i_conparam(const char *); + +#endif diff --git a/allParam/test/int/i_lowercase.c b/allParam/test/int/i_lowercase.c index b6d3232..c4c8fb4 100644 --- a/allParam/test/int/i_lowercase.c +++ b/allParam/test/int/i_lowercase.c @@ -20,7 +20,7 @@ int i_lowercase(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getInt(param, name, idx, &rows, &result); if ((rows == 1) && (result == 100) && (retVal == 0)) { diff --git a/allParam/test/int/i_no_index.c b/allParam/test/int/i_no_index.c index 0699f5f..b4d1187 100644 --- a/allParam/test/int/i_no_index.c +++ b/allParam/test/int/i_no_index.c @@ -20,7 +20,7 @@ int i_no_index(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getInt(param, name, idx, &rows, &result); if ((rows == 0) && (retVal == 0)) { diff --git a/allParam/test/int/i_no_setup.c b/allParam/test/int/i_no_setup.c new file mode 100644 index 0000000..d263257 --- /dev/null +++ b/allParam/test/int/i_no_setup.c @@ -0,0 +1,43 @@ +#include +#include +#include + +#include + +#include "i_no_setup.h" + +int i_no_setup(const char *testid) { + Param *param; + char *name = "tname"; + char *idx = "tint"; + unsigned long int result; + int rows; + int retVal; + int myRetVal; + +#ifdef VERBOSE + printf("%s : Param_getInt: Lowercase input on correct statements.\n", testid); +#endif + + param = malloc(sizeof(Param)); + conSetupParam(param, NULL); + + retVal = Param_getInt(param, name, idx, &rows, &result); + if ((rows == 1) && (result == 100) && (retVal == 0)) { + myRetVal = 0; + printf("%s : Passed.\n", testid); + } else { +#ifdef VERBOSE + printf("%s : Failed. Rows: %d, result: \'%ld\', return Value: %d.\n", testid, rows, result, retVal); + printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); +#else + printf("%s : Failed.\n", testid); +#endif + myRetVal = -1; + } + desParam(param); + free(param); + + return myRetVal; +} + diff --git a/allParam/test/int/i_no_setup.h b/allParam/test/int/i_no_setup.h new file mode 100644 index 0000000..1bd46d5 --- /dev/null +++ b/allParam/test/int/i_no_setup.h @@ -0,0 +1,6 @@ +#ifndef I_NO_SETUP_H +#define I_NO_SETUP_H + +int i_no_setup(const char *); + +#endif diff --git a/allParam/test/int/i_store.c b/allParam/test/int/i_store.c index 38f0819..84ba6e0 100644 --- a/allParam/test/int/i_store.c +++ b/allParam/test/int/i_store.c @@ -22,10 +22,10 @@ int i_store(const char *testid) { printf("%s : Param_storeInt: Simple.\n", testid); #endif - truncate("storage.tcl", 0); + truncate("i_store_s.tcl", 0); param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, "i_store"); retVal1 = Param_storeInt(param, name, idx, tostore); retVal2 = Param_getInt(param, name, idx, &rows, &result); @@ -34,9 +34,9 @@ int i_store(const char *testid) { free(param); if ((rows == 1) && result && (result == tostore) && (retVal1 == 0) && (retVal2 == 0)) { - if(system("diff storage.tcl i_store.tcl")) { + if(system("diff i_store_s.tcl i_store.tcl")) { #ifdef VERBOSE - printf("%s : Failed: Files \"storage.tcl\" and \"i_store.tcl\" differ.\n", testid); + printf("%s : Failed: Files \"%s_s.tcl\" and \"%s.tcl\" differ.\n", testid, testid, testid); printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); #else printf("%s : Failed.\n", testid); diff --git a/allParam/test/int/i_store_existing.c b/allParam/test/int/i_store_existing.c index 13c75b5..6ce3dc3 100644 --- a/allParam/test/int/i_store_existing.c +++ b/allParam/test/int/i_store_existing.c @@ -22,10 +22,10 @@ int i_store_existing(const char *testid) { printf("%s : Param_storeInt: Store a Parameter already existing in the source.\n", testid); #endif - truncate("storage.tcl", 0); + truncate("s_store_existing_s.tcl", 0); param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal1 = Param_storeInt(param, name, idx, tostore); retVal2 = Param_getInt(param, name, idx, &rows, &result); @@ -34,9 +34,9 @@ int i_store_existing(const char *testid) { free(param); if ((rows == 1) && result && (result == tostore) && (retVal1 == 0) && (retVal2 == 0)) { - if(system("diff storage.tcl i_store_existing.tcl")) { + if(system("diff i_store_existing_s.tcl i_store_existing.tcl")) { #ifdef VERBOSE - printf("%s : Failed: Files \"storage.tcl\" and \"i_store_existing.tcl\" differ.\n", testid); + printf("%s : Failed: Files \"%s_s.tcl\" and \"%s.tcl\" differ.\n", testid, testid, testid); printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); #else printf("%s : Failed.\n", testid); diff --git a/allParam/test/int/i_store_multiple.c b/allParam/test/int/i_store_multiple.c index cdf41f9..1947649 100644 --- a/allParam/test/int/i_store_multiple.c +++ b/allParam/test/int/i_store_multiple.c @@ -24,10 +24,10 @@ int i_store_multiple(const char *testid) { printf("%s : Param_storeInt: Storing a value multiple.\n", testid); #endif - truncate("storage.tcl", 0); + truncate("i_store_multiple_s.tcl", 0); param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal1 = Param_storeInt(param, name, idx, old); retVal2 = Param_storeInt(param, name, idx, new); @@ -37,9 +37,9 @@ int i_store_multiple(const char *testid) { free(param); if ((rows == 1) && result && (result == new) && (retVal1 == 0) && (retVal2 == 0) && (retVal3 == 0)) { - if(system("diff storage.tcl i_store_multiple.tcl")) { + if(system("diff i_store_multiple_s.tcl i_store_multiple.tcl")) { #ifdef VERBOSE - printf("%s : Failed: Files \"storage.tcl\" and \"i_store_multiple.tcl\" differ.\n", testid); + printf("%s : Failed: Files \"%s_s.tcl\" and \"%s.tcl\" differ.\n", testid, testid, testid); printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); #else printf("%s : Failed.\n", testid); diff --git a/allParam/test/int/i_string_available.c b/allParam/test/int/i_string_available.c index 3d43a98..c3ff6ad 100644 --- a/allParam/test/int/i_string_available.c +++ b/allParam/test/int/i_string_available.c @@ -20,10 +20,10 @@ int i_string_available(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getInt(param, name, idx, &rows, &result); - if ((rows == 0) && (retVal == -1)) { + if ((rows == 0) && ((retVal == -1) || (retVal == 0))) { myRetVal = 0; printf("%s : Passed.\n", testid); } else { diff --git a/allParam/test/int/i_uppercase.c b/allParam/test/int/i_uppercase.c index 3cfd368..76d74b1 100644 --- a/allParam/test/int/i_uppercase.c +++ b/allParam/test/int/i_uppercase.c @@ -20,7 +20,7 @@ int i_uppercase(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getInt(param, name, idx, &rows, &result); if ((rows == 1) && (result == 100) && (retVal == 0)) { diff --git a/allParam/test/int/ia_long_array.c b/allParam/test/int/ia_long_array.c index 9a0893a..536bd3a 100644 --- a/allParam/test/int/ia_long_array.c +++ b/allParam/test/int/ia_long_array.c @@ -25,7 +25,7 @@ int ia_long_array(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM6, &rows, result); for(i = 0 ; i < NUM6 ; i++) { diff --git a/allParam/test/int/ia_lowercase.c b/allParam/test/int/ia_lowercase.c index 54cc87d..c845630 100644 --- a/allParam/test/int/ia_lowercase.c +++ b/allParam/test/int/ia_lowercase.c @@ -24,7 +24,7 @@ int ia_lowercase(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); for(i = 0 ; i < NUM2 ; i++) { diff --git a/allParam/test/int/ia_no_index.c b/allParam/test/int/ia_no_index.c index 21cdd06..f5add67 100644 --- a/allParam/test/int/ia_no_index.c +++ b/allParam/test/int/ia_no_index.c @@ -22,7 +22,7 @@ int ia_no_index(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); if ((rows == 0) && (retVal == 0)) { diff --git a/allParam/test/int/ia_short_array.c b/allParam/test/int/ia_short_array.c index 0552bc1..3ab5ce0 100644 --- a/allParam/test/int/ia_short_array.c +++ b/allParam/test/int/ia_short_array.c @@ -25,7 +25,7 @@ int ia_short_array(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM4, &rows, result); for(i = 0 ; i < NUM2 ; i++) { diff --git a/allParam/test/int/ia_string_available.c b/allParam/test/int/ia_string_available.c index 3919b3c..292c914 100644 --- a/allParam/test/int/ia_string_available.c +++ b/allParam/test/int/ia_string_available.c @@ -22,7 +22,7 @@ int ia_string_available(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM1, &rows, result); if ((rows == 0) && (retVal == -1)) { diff --git a/allParam/test/int/ia_uppercase.c b/allParam/test/int/ia_uppercase.c index b7c0527..c278b78 100644 --- a/allParam/test/int/ia_uppercase.c +++ b/allParam/test/int/ia_uppercase.c @@ -24,7 +24,7 @@ int ia_uppercase(const char *testid) { #endif param = malloc(sizeof(Param)); - conParam(param); + conSetupParam(param, testid); retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); for(i = 0 ; i < NUM2 ; i++) { diff --git a/allParam/test/test_p.tcl b/allParam/test/test_p.tcl deleted file mode 100644 index 72c3853..0000000 --- a/allParam/test/test_p.tcl +++ /dev/null @@ -1,63 +0,0 @@ -set file(rname) test0.blob -set file(aname) /test0.blob -set file(rnamellarge) test1.blob -set file(rnameodd) test2.blob - -set file(namea0) test1.blob -set file(namea1) /test0.blob -set file(namea2) test3.blob -set file(namea3) /test2.blob -set file(namea4) test5.blob -set file(namea5) /test4.blob -set file(namea6) test7.blob -set file(namea7) /test6.blob -set file(namea9) test10.blob - -set tname(twhitespace) "test1000 whith whitespace" -set tname(tstring) test1000 - -set tname(tint) 1000 - -set tname(tstringa0) test10 -set tname(tstringa1) test00 -set tname(tstringa2) test30 -set tname(tstringa3) test20 -set tname(tstringa4) test50 -set tname(tstringa5) test40 -set tname(tstringa6) test70 -set tname(tstringa7) test60 -set tname(tstringa9) test100 - -set tname(tinta0) 10 -set tname(tinta1) 00 -set tname(tinta2) 30 -set tname(tinta3) 20 -set tname(tinta4) 50 -set tname(tinta5) 40 -set tname(tinta6) 70 -set tname(tinta7) 60 -set tname(tinta8) 90 -set tname(tinta9) 80 -set tname(tinta10) 110 -set tname(tinta11) 100 -set tname(tinta12) 130 -set tname(tinta13) 120 -set tname(tinta14) 150 -set tname(tinta15) 140 -set tname(tinta16) 170 -set tname(tinta17) 160 -set tname(tinta18) 190 -set tname(tinta19) 180 -set tname(tinta20) 210 -set tname(tinta21) 200 -set tname(tinta22) 230 -set tname(tinta23) 220 -set tname(tinta24) 250 -set tname(tinta25) 240 -set tname(tinta26) 270 -set tname(tinta27) 260 -set tname(tinta28) 290 -set tname(tinta29) 280 -set tname(tinta30) 310 -set tname(tinta31) 300 - -- 2.43.0