]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Fri, 8 Sep 2000 14:11:37 +0000 (14:11 +0000)
committerhades <hades>
Fri, 8 Sep 2000 14:11:37 +0000 (14:11 +0000)
allParam/test/test21.c [new file with mode: 0644]
allParam/test/test21.h [new file with mode: 0644]
allParam/test/test22.c [new file with mode: 0644]
allParam/test/test22.h [new file with mode: 0644]

diff --git a/allParam/test/test21.c b/allParam/test/test21.c
new file mode 100644 (file)
index 0000000..6865f84
--- /dev/null
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <string.h>
+
+#include <param.h>
+
+#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 (file)
index 0000000..ccc38ed
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef TEST21_H
+#define TEST21_H
+
+#include <param.h>
+
+#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 (file)
index 0000000..7784ea9
--- /dev/null
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <string.h>
+
+#include <param.h>
+
+#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 (file)
index 0000000..9a91156
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef TEST22_H
+#define TEST22_H
+
+#include <param.h>
+
+int test22(const char *, const Param *);
+
+#endif