+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include <allParam.h>
size_t size;
int retVal;
int myRetVal;
+ struct stat fileS, *file = &fileS;
#ifdef VERBOSE
printf("%s : Param_getBlob: Lowercase input on correct statements.\n", testid);
#endif
+ stat("blob/test0.blob", file);
+
param = malloc(sizeof(Param));
conSetupParam(param, testid);
retVal = Param_getBlob(param, name, idx, &size, &result);
- if ((size == 16368) && (retVal == 0)) {
+ if ((size == file->st_size) && (retVal == 0)) {
int buf;
store = fopen("test0.blob", "w+");
while((buf = fgetc(result)) != EOF) {
--- /dev/null
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <allParam.h>
+
+#include "b_odd_size.h"
+
+int b_odd_size(const char *testid) {
+ Param *param;
+ char *name = "file";
+ char *idx = "rname";
+ FILE *result;
+ FILE *store;
+ size_t size;
+ int retVal;
+ int myRetVal;
+ struct stat fileS, *file = &fileS;
+
+#ifdef VERBOSE
+ printf("%s : Param_getBlob: Lowercase input on correct statements.\n", testid);
+#endif
+
+ stat("blob/test2.blob", file);
+
+ param = malloc(sizeof(Param));
+ conSetupParam(param, testid);
+
+ retVal = Param_getBlob(param, name, idx, &size, &result);
+ if ((size == file->st_size) && (retVal == 0)) {
+ int buf;
+ store = fopen("test2.blob", "w+");
+ while((buf = fgetc(result)) != EOF) {
+ putc(buf, store);
+ }
+ fclose(store);
+ if (!system("diff test2.blob blob/test2.blob")) {
+ myRetVal = 0;
+ printf("%s : Passed.\n", testid);
+ } else {
+#ifdef VERBOSE
+ printf("%s : Failed. Files \"test2.blob\" and \"blob/test2.blob\" differ.\n", testid);
+#else
+ printf("%s : Failed.\n", testid);
+#endif
+ myRetVal = -1;
+ }
+ fclose(result);
+ } else {
+#ifdef VERBOSE
+ printf("%s : Failed. Size: %d, return Value: %d.\n", testid, size, 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;
+}
+
--- /dev/null
+#ifndef B_ODD_SIZE_H
+#define B_ODD_SIZE_H
+
+int b_odd_size(const char *);
+
+#endif
--- /dev/null
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <allParam.h>
+
+#include "b_to_large.h"
+
+#define EPICS_MAX_INDEX 4092
+
+int b_to_large(const char *testid) {
+ Param *param;
+ char *name = "file";
+ char *idx = "rnamelarge";
+ FILE *result;
+ FILE *store;
+ size_t size;
+ int retVal;
+ int myRetVal;
+ struct stat fileS, *file = &fileS;
+
+#ifdef VERBOSE
+ printf("%s : Param_getBlob: File larger than %d bytes (EPICS_MAX_INDEX-limitation).\n", testid, (EPICS_MAX_INDEX - 1) * sizeof(unsigned long int));
+#endif
+
+ stat("blob/test1.blob", file);
+
+ param = malloc(sizeof(Param));
+ conSetupParam(param, testid);
+
+ retVal = Param_getBlob(param, name, idx, &size, &result);
+ if (((size == file->st_size) && (retVal == 0)) {
+ int buf;
+ store = fopen("test1.blob", "w+");
+ while((buf = fgetc(result)) != EOF) {
+ putc(buf, store);
+ }
+ fclose(store);
+ if (!system("diff test1.blob blob/test1.blob")) {
+ myRetVal = 0;
+ printf("%s : Passed.\n", testid);
+ } else {
+#ifdef VERBOSE
+ printf("%s : Failed. Files \"test1.blob\" and \"blob/test1.blob\" differ.\n", testid);
+#else
+ printf("%s : Failed.\n", testid);
+#endif
+ myRetVal = -1;
+ }
+ fclose(result);
+ } else if ((size == 0) && (retVal == 0)) {
+ myRetVal = 0;
+ printf("%s : Passed.\n", testid);
+ } else {
+#ifdef VERBOSE
+ printf("%s : Failed. Size: %d, return Value: %d.\n", testid, size, 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;
+}
+
--- /dev/null
+#ifndef B_TO_LARGE_H
+#define B_TO_LARGE_H
+
+int b_to_large(const char *);
+
+#endif