MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / removePragma

Method removePragma

test/testtokenize.cpp:1002–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1000 }
1001
1002 void removePragma() {
1003 const char code[] = "_Pragma(\"abc\") int x;";
1004 const Settings s_c89 = settingsBuilder().c(Standards::C89).build();
1005 ASSERT_EQUALS("_Pragma ( \"abc\" ) int x ;", tokenizeAndStringify(code, s_c89, false));
1006 const Settings s_clatest;
1007 ASSERT_EQUALS("int x ;", tokenizeAndStringify(code, s_clatest, false));
1008
1009 const Settings s_cpp03 = settingsBuilder().cpp(Standards::CPP03).build();
1010 ASSERT_EQUALS("_Pragma ( \"abc\" ) int x ;", tokenizeAndStringify(code, s_cpp03, true));
1011 const Settings s_cpplatest;
1012 ASSERT_EQUALS("int x ;", tokenizeAndStringify(code, s_cpplatest, true));
1013 }
1014
1015 void foreach () {
1016 // #3690,#5154

Callers

nothing calls this directly

Calls 2

buildMethod · 0.80
cppMethod · 0.80

Tested by

no test coverage detected