From 1154ed7ffffa15e4ff5317259feaa487581ef999 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 4 Dec 2010 19:26:41 +0000 Subject: Remove Aliases file from test harnesses svn path=/trunk/libparserutils/; revision=10979 --- test/aliases.c | 6 ++---- test/cscodec-8859.c | 8 ++++---- test/cscodec-ext8.c | 8 ++++---- test/cscodec-utf16.c | 8 ++++---- test/cscodec-utf8.c | 8 ++++---- test/filter.c | 6 ++---- test/inputstream.c | 8 ++++---- test/regression/filter-badenc-segv.c | 6 ++---- test/regression/filter-segv.c | 6 ++---- test/regression/stream-nomem.c | 6 ++---- 10 files changed, 30 insertions(+), 40 deletions(-) (limited to 'test') diff --git a/test/aliases.c b/test/aliases.c index 819e4b5..3513c7f 100644 --- a/test/aliases.c +++ b/test/aliases.c @@ -9,10 +9,8 @@ int main (int argc, char **argv) { parserutils_charset_aliases_canon *c; - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } + UNUSED(argc); + UNUSED(argv); c = parserutils_charset_alias_canonicalise("moose", 5); if (c) { diff --git a/test/cscodec-8859.c b/test/cscodec-8859.c index 7fd5a2f..bd7dfa4 100644 --- a/test/cscodec-8859.c +++ b/test/cscodec-8859.c @@ -42,15 +42,15 @@ int main(int argc, char **argv) parserutils_charset_codec *codec; line_ctx ctx; - if (argc != 3) { - printf("Usage: %s \n", argv[0]); + if (argc != 2) { + printf("Usage: %s \n", argv[0]); return 1; } assert(parserutils_charset_codec_create("NATS-SEFI-ADD", myrealloc, NULL, &codec) == PARSERUTILS_BADENCODING); - ctx.buflen = parse_filesize(argv[2]); + ctx.buflen = parse_filesize(argv[1]); if (ctx.buflen == 0) return 1; @@ -73,7 +73,7 @@ int main(int argc, char **argv) ctx.inexp = false; ctx.exp_ret = PARSERUTILS_OK; - assert(parse_testfile(argv[2], handle_line, &ctx) == true); + assert(parse_testfile(argv[1], handle_line, &ctx) == true); /* and run final test */ if (ctx.bufused > 0 && ctx.buf[ctx.bufused - 1] == '\n') diff --git a/test/cscodec-ext8.c b/test/cscodec-ext8.c index 7fd5a2f..bd7dfa4 100644 --- a/test/cscodec-ext8.c +++ b/test/cscodec-ext8.c @@ -42,15 +42,15 @@ int main(int argc, char **argv) parserutils_charset_codec *codec; line_ctx ctx; - if (argc != 3) { - printf("Usage: %s \n", argv[0]); + if (argc != 2) { + printf("Usage: %s \n", argv[0]); return 1; } assert(parserutils_charset_codec_create("NATS-SEFI-ADD", myrealloc, NULL, &codec) == PARSERUTILS_BADENCODING); - ctx.buflen = parse_filesize(argv[2]); + ctx.buflen = parse_filesize(argv[1]); if (ctx.buflen == 0) return 1; @@ -73,7 +73,7 @@ int main(int argc, char **argv) ctx.inexp = false; ctx.exp_ret = PARSERUTILS_OK; - assert(parse_testfile(argv[2], handle_line, &ctx) == true); + assert(parse_testfile(argv[1], handle_line, &ctx) == true); /* and run final test */ if (ctx.bufused > 0 && ctx.buf[ctx.bufused - 1] == '\n') diff --git a/test/cscodec-utf16.c b/test/cscodec-utf16.c index dd0ebb1..3eadaca 100644 --- a/test/cscodec-utf16.c +++ b/test/cscodec-utf16.c @@ -45,8 +45,8 @@ int main(int argc, char **argv) parserutils_charset_codec *codec; line_ctx ctx; - if (argc != 3) { - printf("Usage: %s \n", argv[0]); + if (argc != 2) { + printf("Usage: %s \n", argv[0]); return 1; } @@ -56,7 +56,7 @@ int main(int argc, char **argv) assert(parserutils_charset_codec_create("UTF-16", myrealloc, NULL, &ctx.codec) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); + ctx.buflen = parse_filesize(argv[1]); if (ctx.buflen == 0) return 1; @@ -82,7 +82,7 @@ int main(int argc, char **argv) ctx.inexp = false; ctx.exp_ret = PARSERUTILS_OK; - assert(parse_testfile(argv[2], handle_line, &ctx) == true); + assert(parse_testfile(argv[1], handle_line, &ctx) == true); /* and run final test */ if (ctx.bufused > 0 && ctx.buf[ctx.bufused - 1] == '\n') diff --git a/test/cscodec-utf8.c b/test/cscodec-utf8.c index b0dcb89..c36961e 100644 --- a/test/cscodec-utf8.c +++ b/test/cscodec-utf8.c @@ -40,8 +40,8 @@ int main(int argc, char **argv) parserutils_charset_codec *codec; line_ctx ctx; - if (argc != 3) { - printf("Usage: %s \n", argv[0]); + if (argc != 2) { + printf("Usage: %s \n", argv[0]); return 1; } @@ -51,7 +51,7 @@ int main(int argc, char **argv) assert(parserutils_charset_codec_create("UTF-8", myrealloc, NULL, &ctx.codec) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); + ctx.buflen = parse_filesize(argv[1]); if (ctx.buflen == 0) return 1; @@ -73,7 +73,7 @@ int main(int argc, char **argv) ctx.inexp = false; ctx.exp_ret = PARSERUTILS_OK; - assert(parse_testfile(argv[2], handle_line, &ctx) == true); + assert(parse_testfile(argv[1], handle_line, &ctx) == true); /* and run final test */ if (ctx.bufused > 0 && ctx.buf[ctx.bufused - 1] == '\n') diff --git a/test/filter.c b/test/filter.c index c66b684..dfbe38b 100644 --- a/test/filter.c +++ b/test/filter.c @@ -27,10 +27,8 @@ int main(int argc, char **argv) const uint8_t *in = inbuf; uint8_t *out = outbuf; - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } + UNUSED(argc); + UNUSED(argv); /* Create input filter */ assert(parserutils_filter_create("UTF-8", myrealloc, NULL, &input) == diff --git a/test/inputstream.c b/test/inputstream.c index 99d3a3d..ba11e9c 100644 --- a/test/inputstream.c +++ b/test/inputstream.c @@ -31,17 +31,17 @@ int main(int argc, char **argv) const uint8_t *c; size_t clen; - if (argc != 3) { - printf("Usage: %s \n", argv[0]); + if (argc != 2) { + printf("Usage: %s \n", argv[0]); return 1; } assert(parserutils_inputstream_create("UTF-8", 1, NULL, myrealloc, NULL, &stream) == PARSERUTILS_OK); - fp = fopen(argv[2], "rb"); + fp = fopen(argv[1], "rb"); if (fp == NULL) { - printf("Failed opening %s\n", argv[2]); + printf("Failed opening %s\n", argv[1]); return 1; } diff --git a/test/regression/filter-badenc-segv.c b/test/regression/filter-badenc-segv.c index 0c9877a..5ca77e3 100644 --- a/test/regression/filter-badenc-segv.c +++ b/test/regression/filter-badenc-segv.c @@ -26,10 +26,8 @@ int main(int argc, char **argv) expected = PARSERUTILS_BADENCODING; #endif - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } + UNUSED(argc); + UNUSED(argv); assert(parserutils_filter_create("UTF-8", myrealloc, NULL, &input) == PARSERUTILS_OK); diff --git a/test/regression/filter-segv.c b/test/regression/filter-segv.c index 58905f9..b0e9586 100644 --- a/test/regression/filter-segv.c +++ b/test/regression/filter-segv.c @@ -18,10 +18,8 @@ int main(int argc, char **argv) { parserutils_filter *input; - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } + UNUSED(argc); + UNUSED(argv); assert(parserutils_filter_create("UTF-8", myrealloc, NULL, &input) == PARSERUTILS_OK); diff --git a/test/regression/stream-nomem.c b/test/regression/stream-nomem.c index 2f7707e..4545bea 100644 --- a/test/regression/stream-nomem.c +++ b/test/regression/stream-nomem.c @@ -29,10 +29,8 @@ int main(int argc, char **argv) const uint8_t *c; size_t clen; - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } + UNUSED(argc); + UNUSED(argv); /* Populate the buffer with something sane */ memset(input_buffer, 'a', BUFFER_SIZE); -- cgit v1.2.3