From: Theophile Ranquet Date: Mon, 12 Nov 2012 15:41:52 +0000 (+0000) Subject: tests: close files in glr-regression X-Git-Tag: v2.6.90~37 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/05c93b7d844e59ecaa5dec3bd6d9091f5aa5d1b0 tests: close files in glr-regression * tests/glr-regression.at: Here. --- 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