]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Fri, 30 Mar 2001 12:31:15 +0000 (12:31 +0000)
committerhades <hades>
Fri, 30 Mar 2001 12:31:15 +0000 (12:31 +0000)
18 files changed:
allParam/test/int/i_conparam.c [new file with mode: 0644]
allParam/test/int/i_conparam.h [new file with mode: 0644]
allParam/test/int/i_lowercase.c
allParam/test/int/i_no_index.c
allParam/test/int/i_no_setup.c [new file with mode: 0644]
allParam/test/int/i_no_setup.h [new file with mode: 0644]
allParam/test/int/i_store.c
allParam/test/int/i_store_existing.c
allParam/test/int/i_store_multiple.c
allParam/test/int/i_string_available.c
allParam/test/int/i_uppercase.c
allParam/test/int/ia_long_array.c
allParam/test/int/ia_lowercase.c
allParam/test/int/ia_no_index.c
allParam/test/int/ia_short_array.c
allParam/test/int/ia_string_available.c
allParam/test/int/ia_uppercase.c
allParam/test/test_p.tcl [deleted file]

diff --git a/allParam/test/int/i_conparam.c b/allParam/test/int/i_conparam.c
new file mode 100644 (file)
index 0000000..12481a8
--- /dev/null
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <allParam.h>
+
+#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 (file)
index 0000000..f66e37c
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef I_CONPARAM_H
+#define I_CONPARAM_H
+
+int i_conparam(const char *);
+
+#endif
index b6d32320992cd350a4749ef76b6f6a1687b950a7..c4c8fb4864bb2e1858dd2c04e9a3b0ca8da23fd7 100644 (file)
@@ -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)) {
index 0699f5f830975c40172ec0744be8b5a23d17cd64..b4d1187f19b262f53db6add843edf5e678b71f08 100644 (file)
@@ -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 (file)
index 0000000..d263257
--- /dev/null
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <allParam.h>
+
+#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 (file)
index 0000000..1bd46d5
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef I_NO_SETUP_H
+#define I_NO_SETUP_H
+
+int i_no_setup(const char *);
+
+#endif
index 38f08196161936111b4e2fb45139aaf908e643ee..84ba6e0ef412b9cc2cc05b9f0c1ff83e9294c745 100644 (file)
@@ -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);
index 13c75b56fde55d5d1b969832a38606f0ab3d1f1e..6ce3dc380465d7687abf7a5b254c3b48f5bb8795 100644 (file)
@@ -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);
index cdf41f9b82b9e61cd456b1e3ad7261c2af5fe1e5..19476498dcdd48f46427f2eafbc43a7be9499474 100644 (file)
@@ -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);
index 3d43a9884a96d75cf70ae54c5235683c4ac10f29..c3ff6adf50926cb95cfa837f8a9069630d88e5ea 100644 (file)
@@ -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 {
index 3cfd368962f1c14c0d34017815bddbee102452b8..76d74b12493a29dc12f32f0f11c85a4f9d78a454 100644 (file)
@@ -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)) {
index 9a0893a5164e724a1bf8f0b97885aa564137d135..536bd3af87b9af0b6cf44b889141607b5677c7b8 100644 (file)
@@ -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++) {
index 54cc87dd5892e6a021b33c91b76ee65c57326bfa..c8456306b6e242c84e50b605064aba6fb2d036e0 100644 (file)
@@ -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++) {
index 21cdd06caa0166cff2494a6965d86fdeeaee03c1..f5add6772e02527cde9493233a19d38e5a9b72b8 100644 (file)
@@ -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)) {
index 0552bc19dccb54b2a32f84c46d585e5a223e822a..3ab5ce0a69ee1c7be3ee0b1e4b9a2cb854981a0f 100644 (file)
@@ -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++) {
index 3919b3cb9c25d9bbb72072ae2aa0d81ab9d4be53..292c9145cd59977094c943672ce143a2f2043b87 100644 (file)
@@ -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)) {
index b7c0527ca68aa9fdad403d093d4c924eef762f05..c278b78b31891f34b83908c964b398ddf1437f8a 100644 (file)
@@ -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 (file)
index 72c3853..0000000
+++ /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
-