21 #include "procTypes.h"
22 #include "EXISerializer.h"
23 #include "EXIParser.h"
24 #include "stringManipulate.h"
25 #include "grammarGenerator.h"
27 #define INPUT_BUFFER_SIZE 200
28 #define MAX_PATH_LEN 200
44 FILE *infile = (FILE*) stream;
45 return fread(buf, 1, readSize, infile);
51 static errorCode sample_fatalError(
const errorCode code,
const char* msg,
void* app_data)
53 printf(
"\n%d : FATAL ERROR: %s\n", code, msg);
74 const char *exifname =
"Ant/build-build.bitPacked";
87 size_t pathlen = strlen(dataDir);
88 memcpy(exipath, dataDir, pathlen);
89 exipath[pathlen] =
'/';
90 memcpy(&exipath[pathlen+1], exifname, strlen(exifname)+1);
92 infile = fopen(exipath,
"rb" );
94 fail(
"Unable to open file %s", exipath);
100 tmp_err_code =
initParser(&testParser, buffer, &parsingData);
101 fail_unless (tmp_err_code ==
EXIP_OK,
"initParser returns an error code %d", tmp_err_code);
113 fail_unless (tmp_err_code ==
EXIP_OK,
"parsing the header returns an error code %d", tmp_err_code);
117 fail_unless (tmp_err_code ==
EXIP_OK,
"setSchema() returns an error code %d", tmp_err_code);
127 "Unexpected event count: %u", parsingData.
eventCount);
155 int main (
int argc,
char *argv[])
159 printf(
"ERR: Expected test data directory\n");
164 printf(
"ERR: Test data pathname too long: %u", (
unsigned int) strlen(argv[1]));
178 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;