You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'--suppress=functionStatic', # we do not care about this - this was converted from TestUnusedPrivateFunction
4315
+
test_file
4316
+
]
4317
+
4318
+
ret, stdout, stderr=cppcheck(args)
4319
+
assertstdout==''
4320
+
assertstderr.splitlines() == []
4321
+
assertret==0, stdout
4322
+
4323
+
4324
+
deftest_missing_doublequote_include(tmpdir):
4325
+
test_inc=os.path.join(tmpdir, 'abc.h')
4326
+
withopen(test_inc, 'wt') asf:
4327
+
f.write(
4328
+
'''
4329
+
#define a
4330
+
"
4331
+
''')
4332
+
4333
+
test_file=os.path.join(tmpdir, 'test.cpp')
4334
+
withopen(test_file, 'wt') asf:
4335
+
f.write(
4336
+
"""
4337
+
#include "abc.h"
4338
+
""")
4339
+
4340
+
args= [
4341
+
'-q',
4342
+
'--template=simple',
4343
+
test_file
4344
+
]
4345
+
4346
+
ret, stdout, stderr=cppcheck(args)
4347
+
assertstdout==''
4348
+
assertstderr.splitlines() == [
4349
+
f"{test_inc}:3:1: error: No pair for character (\"). Can't process file. File is either invalid or unicode, which is currently not supported. [syntaxError]"
ASSERT_EQUALS("[abc.h:2:1]: (error) No pair for character (\"). Can't process file. File is either invalid or unicode, which is currently not supported. [syntaxError]\n", errout_str());
1589
-
}
1590
-
1591
-
{
1592
-
constchar filedata[] = "#file \"abc.h\"\n"
1593
-
"#define a\n"
1594
-
"#endfile\n"
1583
+
ScopedFile header("abc.h",
1584
+
"#define a\n");
1585
+
constchar filedata[] = "#include \"abc.h\"\n"
1595
1586
"\"\n";
1596
1587
1597
1588
// expand macros..
@@ -2286,14 +2277,14 @@ class TestPreprocessor : public TestFixture {
0 commit comments