1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2010 - DIGITEO - Allan CORNET
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
8 // <-- CLI SHELL MODE -->
10 // <-- Non-regression test for bug 7959 -->
12 // <-- Bugzilla URL -->
13 // http://bugzilla.scilab.org/show_bug.cgi?id=7959
15 // <-- Short Description -->
16 // fscanf did not manage file descriptor as input argument
18 wMode = warning("query");
21 mputl(text, TMPDIR + "/test1.txt");
22 s1 = fscanf(TMPDIR + "/test1.txt", "%s");
23 if text <> s1 then bugmes();quit;end
24 fd = mopen(TMPDIR + "/test1.txt", "rt");
25 s2 = fscanf(fd, "%s");
27 if text <> s2 then bugmes();quit;end
28 if s1 <> s2 then bugmes();quit;end