diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-05-01 16:34:46 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-05-01 16:34:46 +0000 |
commit | 2777a04ed2ba4fd36138b991d66a32a283361f7e (patch) | |
tree | b0c3730533c36ca41402b6d0c5b98413f0a57bee /test/parserutils.c | |
download | libparserutils-2777a04ed2ba4fd36138b991d66a32a283361f7e.tar.gz libparserutils-2777a04ed2ba4fd36138b991d66a32a283361f7e.tar.bz2 |
Import parser construction utility library
svn path=/trunk/libparserutils/; revision=4111
Diffstat (limited to 'test/parserutils.c')
-rw-r--r-- | test/parserutils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/parserutils.c b/test/parserutils.c new file mode 100644 index 0000000..c6d671a --- /dev/null +++ b/test/parserutils.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> + +#include <parserutils/parserutils.h> + +#include "testutils.h" + +static void *myrealloc(void *ptr, size_t len, void *pw) +{ + UNUSED(pw); + + return realloc(ptr, len); +} + +int main(int argc, char **argv) +{ + if (argc != 2) { + printf("Usage: %s <filename>\n", argv[0]); + return 1; + } + + assert(parserutils_initialise(argv[1], myrealloc, NULL) == + PARSERUTILS_OK); + + assert (parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); + + printf("PASS\n"); + + return 0; +} |