From 05c93b7d844e59ecaa5dec3bd6d9091f5aa5d1b0 Mon Sep 17 00:00:00 2001 From: Theophile Ranquet Date: Mon, 12 Nov 2012 15:41:52 +0000 Subject: [PATCH] tests: close files in glr-regression * tests/glr-regression.at: Here. --- tests/glr-regression.at | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/glr-regression.at b/tests/glr-regression.at index 7df17b62..6ca021f9 100644 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@ -196,8 +196,12 @@ int main (int argc, char **argv) { input = stdin; - if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3; - return yyparse (); + if (argc == 2 && !(input = fopen (argv[1], "r"))) + return 3; + int res = yyparse (); + if (argc == 2 && fclose (input)) + return 4; + return res; } ]]) AT_BISON_OPTION_POPDEFS @@ -324,8 +328,12 @@ int main(int argc, char* argv[]) { input = stdin; - if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3; - return yyparse (); + if (argc == 2 && !(input = fopen (argv[1], "r"))) + return 3; + int res = yyparse (); + if (argc == 2 && fclose (input)) + return 4; + return res; } ]]) AT_BISON_OPTION_POPDEFS -- 2.45.2