From fef17765ca418361dd1260ae012d8f4a15d7f93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= Date: Fri, 25 Jul 2014 17:16:26 +0200 Subject: Remove a few `unused variable` warnings --- tests/header_r_main.c | 7 ++++--- tests/multiple_scanners_nr_main.c | 18 ++++++++++++++++++ tests/reject.l4 | 2 ++ tests/tableopts.l4 | 2 ++ tests/top_main.c | 7 ++++--- 5 files changed, 30 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/header_r_main.c b/tests/header_r_main.c index 661457a..22b397d 100644 --- a/tests/header_r_main.c +++ b/tests/header_r_main.c @@ -21,6 +21,8 @@ * PURPOSE. */ +#include + #include "header_r_scanner.h" /* The scanner itself is not important here. @@ -43,7 +45,9 @@ main ( int argc, char** argv ) testset_extra(extra,scanner); fp = testget_in(scanner); + assert(fp == stdin); fp = testget_out(scanner); + assert(fp == stdout); while(testlex(scanner)) { char * text; @@ -61,6 +65,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ diff --git a/tests/multiple_scanners_nr_main.c b/tests/multiple_scanners_nr_main.c index ff1a6d5..bfdd12a 100644 --- a/tests/multiple_scanners_nr_main.c +++ b/tests/multiple_scanners_nr_main.c @@ -21,6 +21,8 @@ * PURPOSE. */ +#include + #include "multiple_scanners_nr_1.h" #include "multiple_scanners_nr_2.h" @@ -30,11 +32,27 @@ main ( int argc, char** argv ) (void)argc; (void)argv; +<<<<<<< HEAD:tests/multiple_scanners_nr_main.c int S1_ok=1, S2_ok=1; YY_BUFFER_STATE buff1, buff2; S1_out = S2_out = stdout; buff1 = S1__scan_string("foo on bar off"); buff2 = S2__scan_string("on blah blah off foo on bar off"); +======= + yyscan_t scanner; + FILE *fp; + char * extra = "EXTRA"; + + testlex_init(&scanner); + testset_in(stdin,scanner); + testset_out(stdout,scanner); + testset_extra(extra,scanner); + + fp = testget_in(scanner); + assert(fp == stdin); + fp = testget_out(scanner); + assert(fp == stdout); +>>>>>>> Remove a few `unused variable` warnings:tests/test-linedir-r/main.c /* scan simultaneously. */ while(S1_ok || S2_ok) diff --git a/tests/reject.l4 b/tests/reject.l4 index 5e5208e..190c700 100644 --- a/tests/reject.l4 +++ b/tests/reject.l4 @@ -48,6 +48,8 @@ int main ( int argc, char** argv ) #ifdef TEST_IS_REENTRANT yylex_init(&yyscanner); +#else + (void)yyscanner; #endif #ifdef TEST_HAS_TABLES_EXTERNAL diff --git a/tests/tableopts.l4 b/tests/tableopts.l4 index 3ad6199..f0358dd 100644 --- a/tests/tableopts.l4 +++ b/tests/tableopts.l4 @@ -50,6 +50,8 @@ int main ( int argc, char** argv ) #ifdef TEST_IS_REENTRANT yylex_init(&yyscanner); +#else + (void)yyscanner; #endif #ifdef TEST_HAS_TABLES_EXTERNAL diff --git a/tests/top_main.c b/tests/top_main.c index d383ce5..b273214 100644 --- a/tests/top_main.c +++ b/tests/top_main.c @@ -21,6 +21,8 @@ * PURPOSE. */ +#include + #include "top.h" /* The scanner itself is not important here. @@ -43,7 +45,9 @@ main ( int argc, char** argv ) testset_extra(extra,scanner); fp = testget_in(scanner); + assert(fp == stdin); fp = testget_out(scanner); + assert(fp == stdout); while(testlex(scanner)) { char * text; @@ -61,6 +65,3 @@ main ( int argc, char** argv ) printf("TEST RETURNING OK.\n"); return 0; } - - -/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */ -- cgit v1.2.3