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
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) $@
--- /dev/null
+set tname(tnewint) 42
--- /dev/null
+set tname(tint) 42
--- /dev/null
+set tname(tnewint) 13
+set tname(tnewint) 26
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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;
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef I_LOWERCASE_H
#define I_LOWERCASE_H
-#include <allParam.h>
-
-int i_lowercase(const char *, const Param *);
+int i_lowercase(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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;
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef I_NO_INDEX_H
#define I_NO_INDEX_H
-#include <allParam.h>
-
-int i_no_index(const char *, const Param *);
+int i_no_index(const char *);
#endif
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);
--- /dev/null
+#ifndef I_STORE_EXISTING_H
+#define I_STORE_EXISTING_H
+
+int i_store_existing(const char *);
+
+#endif
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);
--- /dev/null
+#ifndef I_STORE_MULTIPLE_H
+#define I_STORE_MULTIPLE_H
+
+int i_store_multiple(const char *);
+
+#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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;
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef I_STRING_AVAILABLE_H
#define I_STRING_AVAILABLE_H
-#include <allParam.h>
-
-int i_string_available(const char *, const Param *);
+int i_string_available(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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;
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef I_UPPERCASE_H
#define I_UPPERCASE_H
-#include <allParam.h>
-
-int i_uppercase(const char *, const Param *);
+int i_uppercase(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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));
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_LONG_ARRAY_H
#define IA_LONG_ARRAY_H
-#include <allParam.h>
-
-#define NUM2 32
-#define NUM6 16
-
-int ia_long_array(const char *, const Param *);
+int ia_long_array(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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));
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_LOWERCASE_H
#define IA_LOWERCASE_H
-#include <allParam.h>
-
-#define NUM2 32
-
-int ia_lowercase(const char *, const Param *);
+int ia_lowercase(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_NO_INDEX_H
#define IA_NO_INDEX_H
-#include <allParam.h>
-
-#define NUM2 32
-
-int ia_no_index(const char *, const Param *);
+int ia_no_index(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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));
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_SHORT_ARRAY_H
#define IA_SHORT_ARRAY_H
-#include <allParam.h>
-
-#define NUM2 32
-#define NUM4 64
-
-int ia_short_array(const char *, const Param *);
+int ia_short_array(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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;
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_STRING_AVAILABLE_H
#define IA_STRING_AVAILABLE_H
-#include <allParam.h>
-
-#define NUM1 8
-
-int ia_string_available(const char *, const Param *);
+int ia_string_available(const char *);
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <allParam.h>
#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];
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));
#endif
myRetVal = -1;
}
+ desParam(param);
+ free(param);
+
return myRetVal;
}
#ifndef IA_UPPERCASE_H
#define IA_UPPERCASE_H
-#include <allParam.h>
-
-#define NUM2 32
-
-int ia_uppercase(const char *, const Param *);
+int ia_uppercase(const char *);
#endif