From 4a30ed24d8688cb2dc5bbf6f4cefdc215c09066b Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 8 Sep 2000 14:11:37 +0000 Subject: [PATCH] *** empty log message *** --- allParam/test/test21.c | 36 ++++++++++++++++++++++++++++++++++++ allParam/test/test21.h | 10 ++++++++++ allParam/test/test22.c | 32 ++++++++++++++++++++++++++++++++ allParam/test/test22.h | 8 ++++++++ 4 files changed, 86 insertions(+) create mode 100644 allParam/test/test21.c create mode 100644 allParam/test/test21.h create mode 100644 allParam/test/test22.c create mode 100644 allParam/test/test22.h diff --git a/allParam/test/test21.c b/allParam/test/test21.c new file mode 100644 index 0000000..6865f84 --- /dev/null +++ b/allParam/test/test21.c @@ -0,0 +1,36 @@ +#include +#include + +#include + +#include "test21.h" + +int test21(const char *testid, const Param *param) { + char *name = "crate_id"; + char *idx = "herakles"; + 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], "test0") == 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; + } + for (i = 0 ; i < NUM1 ; i++) { + free(result[i]); + } + return myRetVal; +} + diff --git a/allParam/test/test21.h b/allParam/test/test21.h new file mode 100644 index 0000000..ccc38ed --- /dev/null +++ b/allParam/test/test21.h @@ -0,0 +1,10 @@ +#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 new file mode 100644 index 0000000..7784ea9 --- /dev/null +++ b/allParam/test/test22.c @@ -0,0 +1,32 @@ +#include +#include + +#include + +#include "test22.h" + +int test22(const char *testid, const Param *param) { + char *name = "race0"; + char *idx = "fefpgafile"; + char result[PARAM_MAX_VALUE_LEN]; + int rows; + int retVal; + int myRetVal; + int i; + + printf("%s : Param_getString: Request for Array value.\n", testid); + + retVal = Param_getString(param, name, idx, &rows, result); + if ((rows == 1) && + result && (strcmp(result, "daq_cas/vme/race/conf/5frontend.rbt") == 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 new file mode 100644 index 0000000..9a91156 --- /dev/null +++ b/allParam/test/test22.h @@ -0,0 +1,8 @@ +#ifndef TEST22_H +#define TEST22_H + +#include + +int test22(const char *, const Param *); + +#endif -- 2.43.0