summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz PluciƄski <mplucinski@mplucinski.com>2014-07-25 17:16:26 +0200
committerWill Estes <westes575@gmail.com>2014-11-25 08:28:24 -0500
commitfef17765ca418361dd1260ae012d8f4a15d7f93c (patch)
tree2659c713ba9972c858061daa1a51b6767f6998c7 /tests
parent9ba547712870d4bc690ef9b712950e9df9a707dc (diff)
Remove a few `unused variable` warnings
Diffstat (limited to 'tests')
-rw-r--r--tests/header_r_main.c7
-rw-r--r--tests/multiple_scanners_nr_main.c18
-rw-r--r--tests/reject.l42
-rw-r--r--tests/tableopts.l42
-rw-r--r--tests/top_main.c7
5 files changed, 30 insertions, 6 deletions
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 <assert.h>
+
#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 <assert.h>
+
#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 <assert.h>
+
#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: */