From 6b4368f1d5139b30efd3f99e5007a06f6df348fc Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 2 Apr 2001 17:10:26 +0000 Subject: [PATCH] *** empty log message *** --- allParam/ca/client/caParam.c | 27 +++++++--- allParam/ca/server/paramBlobRecord.cc | 9 +++- allParam/ca/server/paramIntRecord.cc | 4 +- allParam/test/blob/b_odd_size.c | 2 +- allParam/test/blob/b_to_large.c | 2 +- allParam/test/blob/test1.blob | Bin 16384 -> 16368 bytes allParam/test/tcl/blob_p.tcl | 2 +- allParam/test/test1.c | 29 ----------- allParam/test/test1.h | 8 --- allParam/test/test10.c | 29 ----------- allParam/test/test10.h | 8 --- allParam/test/test11.c | 29 ----------- allParam/test/test11.h | 8 --- allParam/test/test12.c | 29 ----------- allParam/test/test12.h | 8 --- allParam/test/test13.c | 37 -------------- allParam/test/test13.h | 10 ---- allParam/test/test14.c | 29 ----------- allParam/test/test14.h | 10 ---- allParam/test/test15.c | 46 ----------------- allParam/test/test15.h | 11 ---- allParam/test/test16.c | 34 ------------- allParam/test/test16.h | 11 ---- allParam/test/test17.c | 42 ---------------- allParam/test/test17.h | 11 ---- allParam/test/test18.c | 34 ------------- allParam/test/test18.h | 11 ---- allParam/test/test19.c | 70 -------------------------- allParam/test/test19.h | 10 ---- allParam/test/test2.c | 29 ----------- allParam/test/test2.h | 8 --- allParam/test/test20.c | 29 ----------- allParam/test/test20.h | 10 ---- allParam/test/test21.c | 37 -------------- allParam/test/test21.h | 10 ---- allParam/test/test22.c | 31 ------------ allParam/test/test22.h | 8 --- allParam/test/test3.c | 55 -------------------- allParam/test/test3.h | 10 ---- allParam/test/test4.c | 38 -------------- allParam/test/test4.h | 10 ---- allParam/test/test5.c | 29 ----------- allParam/test/test5.h | 8 --- allParam/test/test6.c | 29 ----------- allParam/test/test6.h | 8 --- allParam/test/test7.c | 55 -------------------- allParam/test/test7.h | 10 ---- allParam/test/test8.c | 38 -------------- allParam/test/test8.h | 10 ---- allParam/test/test9.c | 29 ----------- allParam/test/test9.h | 8 --- 51 files changed, 31 insertions(+), 1028 deletions(-) delete mode 100644 allParam/test/test1.c delete mode 100644 allParam/test/test1.h delete mode 100644 allParam/test/test10.c delete mode 100644 allParam/test/test10.h delete mode 100644 allParam/test/test11.c delete mode 100644 allParam/test/test11.h delete mode 100644 allParam/test/test12.c delete mode 100644 allParam/test/test12.h delete mode 100644 allParam/test/test13.c delete mode 100644 allParam/test/test13.h delete mode 100644 allParam/test/test14.c delete mode 100644 allParam/test/test14.h delete mode 100644 allParam/test/test15.c delete mode 100644 allParam/test/test15.h delete mode 100644 allParam/test/test16.c delete mode 100644 allParam/test/test16.h delete mode 100644 allParam/test/test17.c delete mode 100644 allParam/test/test17.h delete mode 100644 allParam/test/test18.c delete mode 100644 allParam/test/test18.h delete mode 100644 allParam/test/test19.c delete mode 100644 allParam/test/test19.h delete mode 100644 allParam/test/test2.c delete mode 100644 allParam/test/test2.h delete mode 100644 allParam/test/test20.c delete mode 100644 allParam/test/test20.h delete mode 100644 allParam/test/test21.c delete mode 100644 allParam/test/test21.h delete mode 100644 allParam/test/test22.c delete mode 100644 allParam/test/test22.h delete mode 100644 allParam/test/test3.c delete mode 100644 allParam/test/test3.h delete mode 100644 allParam/test/test4.c delete mode 100644 allParam/test/test4.h delete mode 100644 allParam/test/test5.c delete mode 100644 allParam/test/test5.h delete mode 100644 allParam/test/test6.c delete mode 100644 allParam/test/test6.h delete mode 100644 allParam/test/test7.c delete mode 100644 allParam/test/test7.h delete mode 100644 allParam/test/test8.c delete mode 100644 allParam/test/test8.h delete mode 100644 allParam/test/test9.c delete mode 100644 allParam/test/test9.h diff --git a/allParam/ca/client/caParam.c b/allParam/ca/client/caParam.c index 842f721..c7b163c 100644 --- a/allParam/ca/client/caParam.c +++ b/allParam/ca/client/caParam.c @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -293,7 +294,12 @@ int Param_getBlob(const Param *my, const char *name, const char *idx, size_t *si found = 0; retVal = 0; } - *val = tmpfile(); + if((*val = tmpfile()) == NULL) { + Param_strerror((Param *) my, strerror(errno)); + found = 0; + retVal = -1; + } + if(found == 1) { ParamBlobResult resultS, *result = &resultS; result->val = val; @@ -456,19 +462,24 @@ static void Param_copyStringsToAllocMem(struct event_handler_args args) static void Param_copyIntsToAllocMem(struct event_handler_args args) { +#if 1 int i; +#endif ParamIntResult *result = args.usr; +#if 0 dbr_long_t *buffer = (dbr_long_t *) args.dbr; - +#endif + *(result->rows) = (args.count > result->maxrows) ? result->maxrows : args.count; if(args.type == DBR_LONG && args.status == ECA_NORMAL) { + memcpy(result->val, (dbr_long_t *) args.dbr, (sizeof(dbr_long_t) * *(result->rows))); for(i = 0 ; i < *(result->rows) ; i++) { - (result->val)[i] = buffer[i]; #if 0 - fprintf(stderr, "val[%d] received: %ld\n", i, (result->val)[i]); + (result->val)[i] = buffer[i]; #endif + fprintf(stderr, "val[%d] received: %ld\n", i, (result->val)[i]); } } else { Param_strerror((Param *) result->my, ca_message(args.status)); @@ -480,11 +491,11 @@ static void Param_copyBlobToAllocMem(struct event_handler_args args) { ParamBlobResult *result = args.usr; dbr_long_t *buffer = (dbr_long_t *) args.dbr; - - *(result->size) = args.count; if(args.type == DBR_LONG && args.status == ECA_NORMAL) { - fwrite(buffer, sizeof(dbr_long_t), *(result->size), *result->val); - rewind(*result->val); + *(result->size) = *buffer; + fwrite(buffer + 1, 1, *(result->size), *(result->val)); + fflush(*(result->val)); + rewind(*(result->val)); } else { Param_strerror((Param *) result->my, ca_message(args.status)); *(result->size) = 0; diff --git a/allParam/ca/server/paramBlobRecord.cc b/allParam/ca/server/paramBlobRecord.cc index 537e5fd..ed556e0 100644 --- a/allParam/ca/server/paramBlobRecord.cc +++ b/allParam/ca/server/paramBlobRecord.cc @@ -7,6 +7,8 @@ extern "C" { #include "paramBlobRecord.h" +#define EPICS_MAX_INDEX 4092 + ParamBlobRecord::ParamBlobRecord(caServer& cas, const Param *p, const char *rn, const char *u) : ParamRecord(cas, p, rn, u) { @@ -14,6 +16,9 @@ ParamBlobRecord::ParamBlobRecord(caServer& cas, const Param *p, const char *rn, FILE *tmp; if(Param_getBlob(param, name, idx, &size, &tmp) == 0) { index = (unsigned int) ((size - 1) / sizeof(aitUint32)) + 2; + if (index > EPICS_MAX_INDEX) { + index = 0; + } } else { index = 0; } @@ -65,7 +70,7 @@ gddAppFuncTableStatus ParamBlobRecord::readValue(gdd &value) retVal = Param_getBlob(param, name, idx, &size, &blob); index = 2 + (((unsigned int) size - 1) / sizeof(aitUint32)); - if((retVal != 0) || (index == 0)) { + if((retVal != 0) || (index == 0) || (index > EPICS_MAX_INDEX)) { return S_cas_noRead; } else { aitUint32 *ourValue = new aitUint32[index]; @@ -90,7 +95,7 @@ caStatus ParamBlobRecord::scan() retVal = Param_getBlob(param, name, idx, &size, &blob); index = 2 + (((unsigned int) size - 1) / sizeof(aitUint32)); - if((retVal != 0) || (index == 0)) { + if((retVal != 0) || (index == 0) || (index > EPICS_MAX_INDEX)) { return S_cas_noRead; } else { aitUint32 *ourValue = new aitUint32[index]; diff --git a/allParam/ca/server/paramIntRecord.cc b/allParam/ca/server/paramIntRecord.cc index 10fb61b..af1ce82 100644 --- a/allParam/ca/server/paramIntRecord.cc +++ b/allParam/ca/server/paramIntRecord.cc @@ -108,9 +108,9 @@ caStatus ParamIntRecord::scan() val->putConvert(intValue); } else { aitUint32 *intValue = new aitUint32[index]; - for (unsigned int k = 0 ; k < index ; k++) { + for (unsigned int k = 0 ; k < index ; k++) { intValue[k] = ourValue[k]; -#if 0 +#if 1 fprintf(stderr, "intValue[%d] put: %d\n", k, intValue[k]); #endif } diff --git a/allParam/test/blob/b_odd_size.c b/allParam/test/blob/b_odd_size.c index b62289a..6b3f3e1 100644 --- a/allParam/test/blob/b_odd_size.c +++ b/allParam/test/blob/b_odd_size.c @@ -11,7 +11,7 @@ int b_odd_size(const char *testid) { Param *param; char *name = "file"; - char *idx = "rname"; + char *idx = "rnameodd"; FILE *result; FILE *store; size_t size; diff --git a/allParam/test/blob/b_to_large.c b/allParam/test/blob/b_to_large.c index f00d206..a626b77 100644 --- a/allParam/test/blob/b_to_large.c +++ b/allParam/test/blob/b_to_large.c @@ -31,7 +31,7 @@ int b_to_large(const char *testid) { conSetupParam(param, testid); retVal = Param_getBlob(param, name, idx, &size, &result); - if (((size == file->st_size) && (retVal == 0)) { + if ((size == file->st_size) && (retVal == 0)) { int buf; store = fopen("test1.blob", "w+"); while((buf = fgetc(result)) != EOF) { diff --git a/allParam/test/blob/test1.blob b/allParam/test/blob/test1.blob index 6258757487a594fa93f5abf894d5265e43f7d30c..ae56c07133a54e32e3dda56fc643fb92722a2897 100644 GIT binary patch delta 8 PcmZo@VEj -#include - -#include - -#include "test1.h" - -int test1(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstring"; - char result[PARAM_MAX_VALUE_LEN]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getString: Lowercase input on correct statements.\n", testid); - - retVal = Param_getString(param, name, idx, &rows, result); - if ((rows == 1) && result && (strcmp(result, "test100") == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result: \'%s\', return Value: %d.\n", testid, rows, result, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test1.h b/allParam/test/test1.h deleted file mode 100644 index 3c59cfb..0000000 --- a/allParam/test/test1.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST1_H -#define TEST1_H - -#include - -int test1(const char *, const Param *); - -#endif diff --git a/allParam/test/test10.c b/allParam/test/test10.c deleted file mode 100644 index 45456d4..0000000 --- a/allParam/test/test10.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test10.h" - -int test10(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "bla"; - unsigned long int result; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getInt: Non-existing idx.\n", testid); - - retVal = Param_getInt(param, name, idx, &rows, &result); - if ((rows == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test10.h b/allParam/test/test10.h deleted file mode 100644 index 494c275..0000000 --- a/allParam/test/test10.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST10_H -#define TEST10_H - -#include - -int test10(const char *, const Param *); - -#endif diff --git a/allParam/test/test11.c b/allParam/test/test11.c deleted file mode 100644 index bf07ed0..0000000 --- a/allParam/test/test11.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test11.h" - -int test11(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tint"; - char result[PARAM_MAX_VALUE_LEN]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getString: String is wanted but int-like value found.\n", testid); - - retVal = Param_getString(param, name, idx, &rows, result); - if ((rows == 1) && result && (strcmp(result, "100") == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result: \'%s\', return Value: %d.\n", testid, rows, result, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test11.h b/allParam/test/test11.h deleted file mode 100644 index 9018171..0000000 --- a/allParam/test/test11.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST11_H -#define TEST11_H - -#include - -int test11(const char *, const Param *); - -#endif diff --git a/allParam/test/test12.c b/allParam/test/test12.c deleted file mode 100644 index 15c51b5..0000000 --- a/allParam/test/test12.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test12.h" - -int test12(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstring"; - unsigned long int result; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getInt: Integer is wanted but string-like value found.\n", testid); - - retVal = Param_getInt(param, name, idx, &rows, &result); - if ((rows == 0) && (retVal == -1)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test12.h b/allParam/test/test12.h deleted file mode 100644 index 55d872b..0000000 --- a/allParam/test/test12.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST12_H -#define TEST12_H - -#include - -int test12(const char *, const Param *); - -#endif diff --git a/allParam/test/test13.c b/allParam/test/test13.c deleted file mode 100644 index 38eea13..0000000 --- a/allParam/test/test13.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -#include - -#include "test13.h" - -int test13(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "bla"; - char *result[NUM1]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM1 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: Non-existing idx.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM1, &rows, result); - if ((rows == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM1 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test13.h b/allParam/test/test13.h deleted file mode 100644 index 41b2a22..0000000 --- a/allParam/test/test13.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST13_H -#define TEST13_H - -#include - -#define NUM1 8 - -int test13(const char *, const Param *); - -#endif diff --git a/allParam/test/test14.c b/allParam/test/test14.c deleted file mode 100644 index 70de9f3..0000000 --- a/allParam/test/test14.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test14.h" - -int test14(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "bla"; - unsigned long int result[NUM2]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: Non-existing idx.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); - if ((rows == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test14.h b/allParam/test/test14.h deleted file mode 100644 index b5d6bee..0000000 --- a/allParam/test/test14.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST14_H -#define TEST14_H - -#include - -#define NUM2 32 - -int test14(const char *, const Param *); - -#endif diff --git a/allParam/test/test15.c b/allParam/test/test15.c deleted file mode 100644 index 720e3c4..0000000 --- a/allParam/test/test15.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include -#include - -#include - -#include "test15.h" - -int test15(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstringa"; - char *result[NUM3]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM3 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: To few array members available.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM3, &rows, result); - if ((rows == NUM1) && - result[0] && (strcmp(result[0], "test1") == 0) && - result[1] && (strcmp(result[1], "test0") == 0) && - result[2] && (strcmp(result[2], "test3") == 0) && - result[3] && (strcmp(result[3], "test2") == 0) && - result[4] && (strcmp(result[4], "test5") == 0) && - result[5] && (strcmp(result[5], "test4") == 0) && - result[6] && (strcmp(result[6], "test7") == 0) && - result[7] && (strcmp(result[7], "test6") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM3 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test15.h b/allParam/test/test15.h deleted file mode 100644 index fdbb051..0000000 --- a/allParam/test/test15.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TEST15_H -#define TEST15_H - -#include - -#define NUM1 8 -#define NUM3 16 - -int test15(const char *, const Param *); - -#endif diff --git a/allParam/test/test16.c b/allParam/test/test16.c deleted file mode 100644 index ab733c9..0000000 --- a/allParam/test/test16.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include - -#include - -#include "test16.h" - -int test16(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tinta"; - unsigned long int result[NUM4]; - int rows; - int resultsum = 1; - int i; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: To few array members available.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM4, &rows, result); - for(i = 0 ; i < NUM2 ; i++) { - resultsum &= (result[i] == i + 1 - 2*(i%2)); - } - if ((rows == NUM2) && resultsum && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test16.h b/allParam/test/test16.h deleted file mode 100644 index 5d3d1b5..0000000 --- a/allParam/test/test16.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TEST16_H -#define TEST16_H - -#include - -#define NUM2 32 -#define NUM4 64 - -int test16(const char *, const Param *); - -#endif diff --git a/allParam/test/test17.c b/allParam/test/test17.c deleted file mode 100644 index 22a9b5e..0000000 --- a/allParam/test/test17.c +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include - -#include - -#include "test17.h" - -int test17(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstringa"; - char *result[NUM5]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM5 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: To many array members available.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM5, &rows, result); - if ((rows == NUM5) && - result[0] && (strcmp(result[0], "test1") == 0) && - result[1] && (strcmp(result[1], "test0") == 0) && - result[2] && (strcmp(result[2], "test3") == 0) && - result[3] && (strcmp(result[3], "test2") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM5 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test17.h b/allParam/test/test17.h deleted file mode 100644 index e1187d8..0000000 --- a/allParam/test/test17.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TEST17_H -#define TEST17_H - -#include - -#define NUM1 8 -#define NUM5 4 - -int test17(const char *, const Param *); - -#endif diff --git a/allParam/test/test18.c b/allParam/test/test18.c deleted file mode 100644 index f41206f..0000000 --- a/allParam/test/test18.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include - -#include - -#include "test18.h" - -int test18(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tinta"; - unsigned long int result[NUM6]; - int rows; - int resultsum = 1; - int i; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: To many array members available.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM6, &rows, result); - for(i = 0 ; i < NUM6 ; i++) { - resultsum &= (result[i] == i + 1 - 2*(i%2)); - } - if ((rows == NUM6) && resultsum && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test18.h b/allParam/test/test18.h deleted file mode 100644 index c11451b..0000000 --- a/allParam/test/test18.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TEST18_H -#define TEST18_H - -#include - -#define NUM2 32 -#define NUM6 16 - -int test18(const char *, const Param *); - -#endif diff --git a/allParam/test/test19.c b/allParam/test/test19.c deleted file mode 100644 index 2b5607b..0000000 --- a/allParam/test/test19.c +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include - -#include - -#include "test19.h" - -int test19(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tinta"; - char *result[NUM2]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM2 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: String is wanted but Int-like values found.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM2, &rows, result); - if ((rows == NUM2) && - result[0] && (strcmp(result[0], "1") == 0) && - result[1] && (strcmp(result[1], "0") == 0) && - result[2] && (strcmp(result[2], "3") == 0) && - result[3] && (strcmp(result[3], "2") == 0) && - result[4] && (strcmp(result[4], "5") == 0) && - result[5] && (strcmp(result[5], "4") == 0) && - result[6] && (strcmp(result[6], "7") == 0) && - result[7] && (strcmp(result[7], "6") == 0) && - result[8] && (strcmp(result[8], "9") == 0) && - result[9] && (strcmp(result[9], "8") == 0) && - result[10] && (strcmp(result[10], "11") == 0) && - result[11] && (strcmp(result[11], "10") == 0) && - result[12] && (strcmp(result[12], "13") == 0) && - result[13] && (strcmp(result[13], "12") == 0) && - result[14] && (strcmp(result[14], "15") == 0) && - result[15] && (strcmp(result[15], "14") == 0) && - result[16] && (strcmp(result[16], "17") == 0) && - result[17] && (strcmp(result[17], "16") == 0) && - result[18] && (strcmp(result[18], "19") == 0) && - result[19] && (strcmp(result[19], "18") == 0) && - result[20] && (strcmp(result[20], "21") == 0) && - result[21] && (strcmp(result[21], "20") == 0) && - result[22] && (strcmp(result[22], "23") == 0) && - result[23] && (strcmp(result[23], "22") == 0) && - result[24] && (strcmp(result[24], "25") == 0) && - result[25] && (strcmp(result[25], "24") == 0) && - result[26] && (strcmp(result[26], "27") == 0) && - result[27] && (strcmp(result[27], "26") == 0) && - result[28] && (strcmp(result[28], "29") == 0) && - result[29] && (strcmp(result[29], "28") == 0) && - result[30] && (strcmp(result[30], "31") == 0) && - result[31] && (strcmp(result[31], "30") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM2 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test19.h b/allParam/test/test19.h deleted file mode 100644 index f1ac665..0000000 --- a/allParam/test/test19.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST19_H -#define TEST19_H - -#include - -#define NUM2 32 - -int test19(const char *, const Param *); - -#endif diff --git a/allParam/test/test2.c b/allParam/test/test2.c deleted file mode 100644 index f34ffe8..0000000 --- a/allParam/test/test2.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test2.h" - -int test2(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tint"; - unsigned long int result; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getInt: Lowercase input on correct statements.\n", testid); - - retVal = Param_getInt(param, name, idx, &rows, &result); - if ((rows == 1) && (result == 100) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - 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)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test2.h b/allParam/test/test2.h deleted file mode 100644 index f4d6fde..0000000 --- a/allParam/test/test2.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST2_H -#define TEST2_H - -#include - -int test2(const char *, const Param *); - -#endif diff --git a/allParam/test/test20.c b/allParam/test/test20.c deleted file mode 100644 index 35506dc..0000000 --- a/allParam/test/test20.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test20.h" - -int test20(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstringa"; - unsigned long int result[NUM1]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: Int is wanted but String-like values found.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM1, &rows, result); - if ((rows == 0) && (retVal == -1)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test20.h b/allParam/test/test20.h deleted file mode 100644 index 754e555..0000000 --- a/allParam/test/test20.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST20_H -#define TEST20_H - -#include - -#define NUM1 8 - -int test20(const char *, const Param *); - -#endif diff --git a/allParam/test/test21.c b/allParam/test/test21.c deleted file mode 100644 index 76277d1..0000000 --- a/allParam/test/test21.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -#include - -#include "test21.h" - -int test21(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstring"; - char *result[NUM1]; - int i; - int rows; - int retVal; - int myRetVal; - - for (i = 0 ; i < NUM1 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: Request for a scalar value.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM1, &rows, result); - if ((rows == 1) && result && (strcmp(result[0], "test100") == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result: \'%s\', return Value: %d.\n", testid, rows, result[0], retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM1 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test21.h b/allParam/test/test21.h deleted file mode 100644 index 30e078c..0000000 --- a/allParam/test/test21.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST21_H -#define TEST21_H - -#include - -#define NUM1 8 - -int test21(const char *, const Param *); - -#endif diff --git a/allParam/test/test22.c b/allParam/test/test22.c deleted file mode 100644 index 84dc726..0000000 --- a/allParam/test/test22.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include - -#include - -#include "test22.h" - -int test22(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstringa"; - char result[PARAM_MAX_VALUE_LEN]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getString: Request for Array value.\n", testid); - - retVal = Param_getString(param, name, idx, &rows, result); - if ((rows == 1) && - result && (strcmp(result, "test1") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result : \'%s\', return Value: %d.\n", testid, rows, result, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test22.h b/allParam/test/test22.h deleted file mode 100644 index 147f567..0000000 --- a/allParam/test/test22.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST22_H -#define TEST22_H - -#include - -int test22(const char *, const Param *); - -#endif diff --git a/allParam/test/test3.c b/allParam/test/test3.c deleted file mode 100644 index d8f5abd..0000000 --- a/allParam/test/test3.c +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include - -#include - -#include "test3.h" - -int test3(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tstringa"; - char *result[NUM1]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM1 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: Lowercase input on correct statements.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM1, &rows, result); - if ((rows == NUM1) && - result[0] && (strcmp(result[0], "test1") == 0) && - result[1] && (strcmp(result[1], "test0") == 0) && - result[2] && (strcmp(result[2], "test3") == 0) && - result[3] && (strcmp(result[3], "test2") == 0) && - result[4] && (strcmp(result[4], "test5") == 0) && - result[5] && (strcmp(result[5], "test4") == 0) && - result[6] && (strcmp(result[6], "test7") == 0) && - result[7] && (strcmp(result[7], "test6") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result array:\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\nreturn Value: %d.\n", testid, rows, - result[0], - result[1], - result[2], - result[3], - result[4], - result[5], - result[6], - result[7], - retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM1 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test3.h b/allParam/test/test3.h deleted file mode 100644 index 0ad4432..0000000 --- a/allParam/test/test3.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST3_H -#define TEST3_H - -#include - -#define NUM1 8 - -int test3(const char *, const Param *); - -#endif diff --git a/allParam/test/test4.c b/allParam/test/test4.c deleted file mode 100644 index 3941dfb..0000000 --- a/allParam/test/test4.c +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#include - -#include "test4.h" - -int test4(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "tinta"; - unsigned long int result[NUM2]; - int rows; - int resultsum = 1; - int i; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: Lowercase input on correct statements.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); - for(i = 0 ; i < NUM2 ; i++) { - resultsum &= (result[i] == i + 1 - 2*(i%2)); - } - if ((rows == NUM2) && resultsum && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result array:\n", testid, rows); - for(i = 0 ; i < NUM2 ; i++) { - printf("result[%d]: %ld.\n", i, result[i]); - } - printf("return Value: %d.\n", retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test4.h b/allParam/test/test4.h deleted file mode 100644 index d293afb..0000000 --- a/allParam/test/test4.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST4_H -#define TEST4_H - -#include - -#define NUM2 32 - -int test4(const char *, const Param *); - -#endif diff --git a/allParam/test/test5.c b/allParam/test/test5.c deleted file mode 100644 index 1c2d450..0000000 --- a/allParam/test/test5.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test5.h" - -int test5(const char *testid, const Param *param) { - char *name = "TNAME"; - char *idx = "TSTRING"; - char result[PARAM_MAX_VALUE_LEN]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getString: Uppercase input on correct statements.\n", testid); - - retVal = Param_getString(param, name, idx, &rows, result); - if ((rows == 1) && result && (strcmp(result, "test100") == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result: \'%s\', return Value: %d.\n", testid, rows, result, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test5.h b/allParam/test/test5.h deleted file mode 100644 index c4a85f6..0000000 --- a/allParam/test/test5.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST5_H -#define TEST5_H - -#include - -int test5(const char *, const Param *); - -#endif diff --git a/allParam/test/test6.c b/allParam/test/test6.c deleted file mode 100644 index 4967ebb..0000000 --- a/allParam/test/test6.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test6.h" - -int test6(const char *testid, const Param *param) { - char *name = "TNAME"; - char *idx = "TINT"; - unsigned long int result; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getInt: Uppercase input on correct statements.\n", testid); - - retVal = Param_getInt(param, name, idx, &rows, &result); - if ((rows == 1) && (result == 100) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - 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)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test6.h b/allParam/test/test6.h deleted file mode 100644 index 9b146f2..0000000 --- a/allParam/test/test6.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST6_H -#define TEST6_H - -#include - -int test6(const char *, const Param *); - -#endif diff --git a/allParam/test/test7.c b/allParam/test/test7.c deleted file mode 100644 index ed73dc5..0000000 --- a/allParam/test/test7.c +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include - -#include - -#include "test7.h" - -int test7(const char *testid, const Param *param) { - char *name = "TNAME"; - char *idx = "TSTRINGA"; - char *result[NUM1]; - int rows; - int retVal; - int myRetVal; - int i; - - for (i = 0 ; i < NUM1 ; i++) { - result[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char)); - } - printf("%s : Param_getStringArray: Uppercase input on correct statements.\n", testid); - - retVal = Param_getStringArray(param, name, idx, NUM1, &rows, result); - if ((rows == NUM1) && - result[0] && (strcmp(result[0], "test1") == 0) && - result[1] && (strcmp(result[1], "test0") == 0) && - result[2] && (strcmp(result[2], "test3") == 0) && - result[3] && (strcmp(result[3], "test2") == 0) && - result[4] && (strcmp(result[4], "test5") == 0) && - result[5] && (strcmp(result[5], "test4") == 0) && - result[6] && (strcmp(result[6], "test7") == 0) && - result[7] && (strcmp(result[7], "test6") == 0) && - (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result array:\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\nreturn Value: %d.\n", testid, rows, - result[0], - result[1], - result[2], - result[3], - result[4], - result[5], - result[6], - result[7], - retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - for (i = 0 ; i < NUM1 ; i++) { - free(result[i]); - } - return myRetVal; -} - diff --git a/allParam/test/test7.h b/allParam/test/test7.h deleted file mode 100644 index 4eaf352..0000000 --- a/allParam/test/test7.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST7_H -#define TEST7_H - -#include - -#define NUM1 8 - -int test7(const char *, const Param *); - -#endif diff --git a/allParam/test/test8.c b/allParam/test/test8.c deleted file mode 100644 index 7a8711e..0000000 --- a/allParam/test/test8.c +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#include - -#include "test8.h" - -int test8(const char *testid, const Param *param) { - char *name = "TNAME"; - char *idx = "TINTA"; - unsigned long int result[NUM2]; - int rows; - int resultsum = 1; - int i; - int retVal; - int myRetVal; - - printf("%s : Param_getIntArray: Uppercase input on correct statements.\n", testid); - - retVal = Param_getIntArray(param, name, idx, NUM2, &rows, result); - for(i = 0 ; i < NUM2 ; i++) { - resultsum &= (result[i] == i + 1 - 2*(i%2)); - } - if ((rows == NUM2) && resultsum && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, result array:\n", testid, rows); - for(i = 0 ; i < NUM2 ; i++) { - printf("result[%d]: %ld.\n", i, result[i]); - } - printf("return Value: %d.\n", retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test8.h b/allParam/test/test8.h deleted file mode 100644 index 854f879..0000000 --- a/allParam/test/test8.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TEST8_H -#define TEST8_H - -#include - -#define NUM2 32 - -int test8(const char *, const Param *); - -#endif diff --git a/allParam/test/test9.c b/allParam/test/test9.c deleted file mode 100644 index 2829d35..0000000 --- a/allParam/test/test9.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "test9.h" - -int test9(const char *testid, const Param *param) { - char *name = "tname"; - char *idx = "bla"; - char result[PARAM_MAX_VALUE_LEN]; - int rows; - int retVal; - int myRetVal; - - printf("%s : Param_getString: Non-existing idx.\n", testid); - - retVal = Param_getString(param, name, idx, &rows, result); - if ((rows == 0) && (retVal == 0)) { - myRetVal = 0; - printf("%s : Passed.\n", testid); - } else { - printf("%s : Failed. Rows: %d, return Value: %d.\n", testid, rows, retVal); - printf("%s : Error string: %s\n", testid, Param_getErrStr(param)); - myRetVal = -1; - } - return myRetVal; -} - diff --git a/allParam/test/test9.h b/allParam/test/test9.h deleted file mode 100644 index d880f40..0000000 --- a/allParam/test/test9.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST9_H -#define TEST9_H - -#include - -int test9(const char *, const Param *); - -#endif -- 2.43.0