From fb2c8b24cccf3497c072a545491ff417ae6c4fb9 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 28 Mar 2001 16:47:50 +0000 Subject: [PATCH] *** empty log message *** --- allParam/VERSION | 2 +- allParam/test/Makefile | 10 +++++----- allParam/test/i_store.tcl | 1 + allParam/test/i_store_existing.tcl | 1 + allParam/test/i_store_multiple.tcl | 2 ++ allParam/test/int/i_lowercase.c | 10 +++++++++- allParam/test/int/i_lowercase.h | 4 +--- allParam/test/int/i_no_index.c | 10 +++++++++- allParam/test/int/i_no_index.h | 4 +--- allParam/test/int/i_store_existing.c | 4 ++-- allParam/test/int/i_store_existing.h | 6 ++++++ allParam/test/int/i_store_multiple.c | 2 +- allParam/test/int/i_store_multiple.h | 6 ++++++ allParam/test/int/i_string_available.c | 10 +++++++++- allParam/test/int/i_string_available.h | 4 +--- allParam/test/int/i_uppercase.c | 10 +++++++++- allParam/test/int/i_uppercase.h | 4 +--- allParam/test/int/ia_long_array.c | 13 ++++++++++++- allParam/test/int/ia_long_array.h | 7 +------ allParam/test/int/ia_lowercase.c | 12 +++++++++++- allParam/test/int/ia_lowercase.h | 6 +----- allParam/test/int/ia_no_index.c | 12 +++++++++++- allParam/test/int/ia_no_index.h | 6 +----- allParam/test/int/ia_short_array.c | 13 ++++++++++++- allParam/test/int/ia_short_array.h | 7 +------ allParam/test/int/ia_string_available.c | 12 +++++++++++- allParam/test/int/ia_string_available.h | 6 +----- allParam/test/int/ia_uppercase.c | 12 +++++++++++- allParam/test/int/ia_uppercase.h | 6 +----- 29 files changed, 139 insertions(+), 63 deletions(-) create mode 100644 allParam/test/i_store.tcl create mode 100644 allParam/test/i_store_existing.tcl create mode 100644 allParam/test/i_store_multiple.tcl create mode 100644 allParam/test/int/i_store_existing.h create mode 100644 allParam/test/int/i_store_multiple.h diff --git a/allParam/VERSION b/allParam/VERSION index 1180819..3b04cfb 100644 --- a/allParam/VERSION +++ b/allParam/VERSION @@ -1 +1 @@ -0.1.7 +0.2 diff --git a/allParam/test/Makefile b/allParam/test/Makefile index 552b797..863eee8 100644 --- a/allParam/test/Makefile +++ b/allParam/test/Makefile @@ -17,7 +17,7 @@ HEADERS = blob/*.h filename/*.h int/*.h string/*.h VPATH=.:blob:filename:int:string -CFLAGS = -I../include +CFLAGS = -Wall -I../include OBJS = suite.o blobobjs filenameobjs intobjs stringobjs LIBS = ca file ora psql tcl @@ -50,13 +50,13 @@ suite.c : bin/main.sh blobobjs : - cd blob ; $(MAKE) "CFLAGS=-I../../include" + cd blob ; $(MAKE) "CFLAGS=-Wall -I../../include" filenameobjs : - cd filename ; $(MAKE) "CFLAGS=-I../../include" + cd filename ; $(MAKE) "CFLAGS=-Wall -I../../include" intobjs : - cd int ; $(MAKE) "CFLAGS=-I../../include" + cd int ; $(MAKE) "CFLAGS=-Wall -I../../include" stringobjs : - cd string ; $(MAKE) "CFLAGS=-I../../include" + cd string ; $(MAKE) "CFLAGS=-Wall -I../../include" clean : cd blob ; $(MAKE) $@ diff --git a/allParam/test/i_store.tcl b/allParam/test/i_store.tcl new file mode 100644 index 0000000..d6670b1 --- /dev/null +++ b/allParam/test/i_store.tcl @@ -0,0 +1 @@ +set tname(tnewint) 42 diff --git a/allParam/test/i_store_existing.tcl b/allParam/test/i_store_existing.tcl new file mode 100644 index 0000000..4ff87a4 --- /dev/null +++ b/allParam/test/i_store_existing.tcl @@ -0,0 +1 @@ +set tname(tint) 42 diff --git a/allParam/test/i_store_multiple.tcl b/allParam/test/i_store_multiple.tcl new file mode 100644 index 0000000..effc966 --- /dev/null +++ b/allParam/test/i_store_multiple.tcl @@ -0,0 +1,2 @@ +set tname(tnewint) 13 +set tname(tnewint) 26 diff --git a/allParam/test/int/i_lowercase.c b/allParam/test/int/i_lowercase.c index ab2454c..b6d3232 100644 --- a/allParam/test/int/i_lowercase.c +++ b/allParam/test/int/i_lowercase.c @@ -1,11 +1,13 @@ #include +#include #include #include #include "i_lowercase.h" -int i_lowercase(const char *testid, const Param *param) { +int i_lowercase(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tint"; unsigned long int result; @@ -17,6 +19,9 @@ int i_lowercase(const char *testid, const Param *param) { 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; @@ -30,6 +35,9 @@ int i_lowercase(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/i_lowercase.h b/allParam/test/int/i_lowercase.h index 219e478..6dce8dd 100644 --- a/allParam/test/int/i_lowercase.h +++ b/allParam/test/int/i_lowercase.h @@ -1,8 +1,6 @@ #ifndef I_LOWERCASE_H #define I_LOWERCASE_H -#include - -int i_lowercase(const char *, const Param *); +int i_lowercase(const char *); #endif diff --git a/allParam/test/int/i_no_index.c b/allParam/test/int/i_no_index.c index 48fadac..0699f5f 100644 --- a/allParam/test/int/i_no_index.c +++ b/allParam/test/int/i_no_index.c @@ -1,11 +1,13 @@ #include +#include #include #include #include "i_no_index.h" -int i_no_index(const char *testid, const Param *param) { +int i_no_index(const char *testid) { + Param *param; char *name = "tname"; char *idx = "bla"; unsigned long int result; @@ -17,6 +19,9 @@ int i_no_index(const char *testid, const Param *param) { printf("%s : Param_getInt: Non-existing idx.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getInt(param, name, idx, &rows, &result); if ((rows == 0) && (retVal == 0)) { myRetVal = 0; @@ -30,6 +35,9 @@ int i_no_index(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/i_no_index.h b/allParam/test/int/i_no_index.h index 8fda975..0f5d448 100644 --- a/allParam/test/int/i_no_index.h +++ b/allParam/test/int/i_no_index.h @@ -1,8 +1,6 @@ #ifndef I_NO_INDEX_H #define I_NO_INDEX_H -#include - -int i_no_index(const char *, const Param *); +int i_no_index(const char *); #endif diff --git a/allParam/test/int/i_store_existing.c b/allParam/test/int/i_store_existing.c index 3050ae7..2f1b5ab 100644 --- a/allParam/test/int/i_store_existing.c +++ b/allParam/test/int/i_store_existing.c @@ -27,8 +27,8 @@ int i_store_existing(const char *testid) { param = malloc(sizeof(Param)); conParam(param); - retVal1 = Param_storeString(param, name, idx, tostore); - retVal2 = Param_getString(param, name, idx, &rows, &result); + retVal1 = Param_storeInt(param, name, idx, tostore); + retVal2 = Param_getInt(param, name, idx, &rows, &result); desParam(param); free(param); diff --git a/allParam/test/int/i_store_existing.h b/allParam/test/int/i_store_existing.h new file mode 100644 index 0000000..7e3cdc1 --- /dev/null +++ b/allParam/test/int/i_store_existing.h @@ -0,0 +1,6 @@ +#ifndef I_STORE_EXISTING_H +#define I_STORE_EXISTING_H + +int i_store_existing(const char *); + +#endif diff --git a/allParam/test/int/i_store_multiple.c b/allParam/test/int/i_store_multiple.c index b51f55e..bb4208a 100644 --- a/allParam/test/int/i_store_multiple.c +++ b/allParam/test/int/i_store_multiple.c @@ -21,7 +21,7 @@ int i_store_multiple(const char *testid) { int myRetVal; #ifdef VERBOSE - printf("%s : Param_storeString: Storing a value multiple.\n", testid); + printf("%s : Param_storeInt: Storing a value multiple.\n", testid); #endif truncate("storage.tcl", 0); diff --git a/allParam/test/int/i_store_multiple.h b/allParam/test/int/i_store_multiple.h new file mode 100644 index 0000000..125532e --- /dev/null +++ b/allParam/test/int/i_store_multiple.h @@ -0,0 +1,6 @@ +#ifndef I_STORE_MULTIPLE_H +#define I_STORE_MULTIPLE_H + +int i_store_multiple(const char *); + +#endif diff --git a/allParam/test/int/i_string_available.c b/allParam/test/int/i_string_available.c index 58db765..3d43a98 100644 --- a/allParam/test/int/i_string_available.c +++ b/allParam/test/int/i_string_available.c @@ -1,11 +1,13 @@ #include +#include #include #include #include "i_string_available.h" -int i_string_available(const char *testid, const Param *param) { +int i_string_available(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tstring"; unsigned long int result; @@ -17,6 +19,9 @@ int i_string_available(const char *testid, const Param *param) { printf("%s : Param_getInt: Integer is wanted but string-like value found.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getInt(param, name, idx, &rows, &result); if ((rows == 0) && (retVal == -1)) { myRetVal = 0; @@ -30,6 +35,9 @@ int i_string_available(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/i_string_available.h b/allParam/test/int/i_string_available.h index 4efb656..58931b4 100644 --- a/allParam/test/int/i_string_available.h +++ b/allParam/test/int/i_string_available.h @@ -1,8 +1,6 @@ #ifndef I_STRING_AVAILABLE_H #define I_STRING_AVAILABLE_H -#include - -int i_string_available(const char *, const Param *); +int i_string_available(const char *); #endif diff --git a/allParam/test/int/i_uppercase.c b/allParam/test/int/i_uppercase.c index 8504c31..3cfd368 100644 --- a/allParam/test/int/i_uppercase.c +++ b/allParam/test/int/i_uppercase.c @@ -1,11 +1,13 @@ #include +#include #include #include #include "i_uppercase.h" -int i_uppercase(const char *testid, const Param *param) { +int i_uppercase(const char *testid) { + Param *param; char *name = "TNAME"; char *idx = "TINT"; unsigned long int result; @@ -17,6 +19,9 @@ int i_uppercase(const char *testid, const Param *param) { printf("%s : Param_getInt: Uppercase 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; @@ -30,6 +35,9 @@ int i_uppercase(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/i_uppercase.h b/allParam/test/int/i_uppercase.h index 3b9c93a..f61580b 100644 --- a/allParam/test/int/i_uppercase.h +++ b/allParam/test/int/i_uppercase.h @@ -1,8 +1,6 @@ #ifndef I_UPPERCASE_H #define I_UPPERCASE_H -#include - -int i_uppercase(const char *, const Param *); +int i_uppercase(const char *); #endif diff --git a/allParam/test/int/ia_long_array.c b/allParam/test/int/ia_long_array.c index dcb787c..9a0893a 100644 --- a/allParam/test/int/ia_long_array.c +++ b/allParam/test/int/ia_long_array.c @@ -1,11 +1,16 @@ #include +#include #include #include #include "ia_long_array.h" -int ia_long_array(const char *testid, const Param *param) { +#define NUM2 32 +#define NUM6 16 + +int ia_long_array(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tinta"; unsigned long int result[NUM6]; @@ -19,6 +24,9 @@ int ia_long_array(const char *testid, const Param *param) { printf("%s : Param_getIntArray: To many array members available.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM6, &rows, result); for(i = 0 ; i < NUM6 ; i++) { resultsum &= (result[i] == i + 1 - 2*(i%2)); @@ -35,6 +43,9 @@ int ia_long_array(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_long_array.h b/allParam/test/int/ia_long_array.h index 7de5ded..3503b71 100644 --- a/allParam/test/int/ia_long_array.h +++ b/allParam/test/int/ia_long_array.h @@ -1,11 +1,6 @@ #ifndef IA_LONG_ARRAY_H #define IA_LONG_ARRAY_H -#include - -#define NUM2 32 -#define NUM6 16 - -int ia_long_array(const char *, const Param *); +int ia_long_array(const char *); #endif diff --git a/allParam/test/int/ia_lowercase.c b/allParam/test/int/ia_lowercase.c index 52b86ae..54cc87d 100644 --- a/allParam/test/int/ia_lowercase.c +++ b/allParam/test/int/ia_lowercase.c @@ -1,11 +1,15 @@ #include +#include #include #include #include "ia_lowercase.h" -int ia_lowercase(const char *testid, const Param *param) { +#define NUM2 32 + +int ia_lowercase(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tinta"; unsigned long int result[NUM2]; @@ -19,6 +23,9 @@ int ia_lowercase(const char *testid, const Param *param) { printf("%s : Param_getIntArray: Lowercase input on correct statements.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); for(i = 0 ; i < NUM2 ; i++) { resultsum &= (result[i] == i + 1 - 2*(i%2)); @@ -39,6 +46,9 @@ int ia_lowercase(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_lowercase.h b/allParam/test/int/ia_lowercase.h index 8aef49a..2f41fbe 100644 --- a/allParam/test/int/ia_lowercase.h +++ b/allParam/test/int/ia_lowercase.h @@ -1,10 +1,6 @@ #ifndef IA_LOWERCASE_H #define IA_LOWERCASE_H -#include - -#define NUM2 32 - -int ia_lowercase(const char *, const Param *); +int ia_lowercase(const char *); #endif diff --git a/allParam/test/int/ia_no_index.c b/allParam/test/int/ia_no_index.c index 5dcaf94..21cdd06 100644 --- a/allParam/test/int/ia_no_index.c +++ b/allParam/test/int/ia_no_index.c @@ -1,11 +1,15 @@ #include +#include #include #include #include "ia_no_index.h" -int ia_no_index(const char *testid, const Param *param) { +#define NUM2 32 + +int ia_no_index(const char *testid) { + Param *param; char *name = "tname"; char *idx = "bla"; unsigned long int result[NUM2]; @@ -17,6 +21,9 @@ int ia_no_index(const char *testid, const Param *param) { printf("%s : Param_getIntArray: Non-existing idx.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); if ((rows == 0) && (retVal == 0)) { myRetVal = 0; @@ -30,6 +37,9 @@ int ia_no_index(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_no_index.h b/allParam/test/int/ia_no_index.h index ef4a1e7..547c551 100644 --- a/allParam/test/int/ia_no_index.h +++ b/allParam/test/int/ia_no_index.h @@ -1,10 +1,6 @@ #ifndef IA_NO_INDEX_H #define IA_NO_INDEX_H -#include - -#define NUM2 32 - -int ia_no_index(const char *, const Param *); +int ia_no_index(const char *); #endif diff --git a/allParam/test/int/ia_short_array.c b/allParam/test/int/ia_short_array.c index a6f98df..0552bc1 100644 --- a/allParam/test/int/ia_short_array.c +++ b/allParam/test/int/ia_short_array.c @@ -1,11 +1,16 @@ #include +#include #include #include #include "ia_short_array.h" -int ia_short_array(const char *testid, const Param *param) { +#define NUM2 32 +#define NUM4 64 + +int ia_short_array(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tinta"; unsigned long int result[NUM4]; @@ -19,6 +24,9 @@ int ia_short_array(const char *testid, const Param *param) { printf("%s : Param_getIntArray: To few array members available.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM4, &rows, result); for(i = 0 ; i < NUM2 ; i++) { resultsum &= (result[i] == i + 1 - 2*(i%2)); @@ -35,6 +43,9 @@ int ia_short_array(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_short_array.h b/allParam/test/int/ia_short_array.h index d3032af..913f010 100644 --- a/allParam/test/int/ia_short_array.h +++ b/allParam/test/int/ia_short_array.h @@ -1,11 +1,6 @@ #ifndef IA_SHORT_ARRAY_H #define IA_SHORT_ARRAY_H -#include - -#define NUM2 32 -#define NUM4 64 - -int ia_short_array(const char *, const Param *); +int ia_short_array(const char *); #endif diff --git a/allParam/test/int/ia_string_available.c b/allParam/test/int/ia_string_available.c index ad9d01e..3919b3c 100644 --- a/allParam/test/int/ia_string_available.c +++ b/allParam/test/int/ia_string_available.c @@ -1,11 +1,15 @@ #include +#include #include #include #include "ia_string_available.h" -int ia_string_available(const char *testid, const Param *param) { +#define NUM1 8 + +int ia_string_available(const char *testid) { + Param *param; char *name = "tname"; char *idx = "tstringa"; unsigned long int result[NUM1]; @@ -17,6 +21,9 @@ int ia_string_available(const char *testid, const Param *param) { printf("%s : Param_getIntArray: Int is wanted but String-like values found.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM1, &rows, result); if ((rows == 0) && (retVal == -1)) { myRetVal = 0; @@ -30,6 +37,9 @@ int ia_string_available(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_string_available.h b/allParam/test/int/ia_string_available.h index d42ffad..0448bbe 100644 --- a/allParam/test/int/ia_string_available.h +++ b/allParam/test/int/ia_string_available.h @@ -1,10 +1,6 @@ #ifndef IA_STRING_AVAILABLE_H #define IA_STRING_AVAILABLE_H -#include - -#define NUM1 8 - -int ia_string_available(const char *, const Param *); +int ia_string_available(const char *); #endif diff --git a/allParam/test/int/ia_uppercase.c b/allParam/test/int/ia_uppercase.c index aceda75..b7c0527 100644 --- a/allParam/test/int/ia_uppercase.c +++ b/allParam/test/int/ia_uppercase.c @@ -1,11 +1,15 @@ #include +#include #include #include #include "ia_uppercase.h" -int ia_uppercase(const char *testid, const Param *param) { +#define NUM2 32 + +int ia_uppercase(const char *testid) { + Param *param; char *name = "TNAME"; char *idx = "TINTA"; unsigned long int result[NUM2]; @@ -19,6 +23,9 @@ int ia_uppercase(const char *testid, const Param *param) { printf("%s : Param_getIntArray: Uppercase input on correct statements.\n", testid); #endif + param = malloc(sizeof(Param)); + conParam(param); + retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); for(i = 0 ; i < NUM2 ; i++) { resultsum &= (result[i] == i + 1 - 2*(i%2)); @@ -39,6 +46,9 @@ int ia_uppercase(const char *testid, const Param *param) { #endif myRetVal = -1; } + desParam(param); + free(param); + return myRetVal; } diff --git a/allParam/test/int/ia_uppercase.h b/allParam/test/int/ia_uppercase.h index 7c1e980..851fd6c 100644 --- a/allParam/test/int/ia_uppercase.h +++ b/allParam/test/int/ia_uppercase.h @@ -1,10 +1,6 @@ #ifndef IA_UPPERCASE_H #define IA_UPPERCASE_H -#include - -#define NUM2 32 - -int ia_uppercase(const char *, const Param *); +int ia_uppercase(const char *); #endif -- 2.43.0