diff --git a/test/testother.cpp b/test/testother.cpp index 544a34ebd..e49c6da42 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -34,9 +34,11 @@ public: private: Settings settings_std; + Settings settings_posix; void run() { LOAD_LIB_2(settings_std.library, "std.cfg"); + LOAD_LIB_2(settings_posix.library, "posix.cfg"); TEST_CASE(emptyBrackets); @@ -183,6 +185,9 @@ private: static Settings _settings; settings = &_settings; } + if (posix) { + settings = &settings_posix; + } settings->addEnabled("style"); settings->addEnabled("warning"); settings->addEnabled("portability"); @@ -191,16 +196,6 @@ private: settings->experimental = experimental; settings->standards.posix = posix; - if (posix) { - const char cfg[] = "\n" - "\n" - " 0:999999 \n" - ""; - tinyxml2::XMLDocument xmldoc; - xmldoc.Parse(cfg, sizeof(cfg)); - settings->library.load(xmldoc); - } - // Tokenize.. Tokenizer tokenizer(settings, this); std::istringstream istr(code); @@ -6369,9 +6364,6 @@ private: } void testReturnIgnoredReturnValuePosix() { - Settings settings_posix; - LOAD_LIB_2(settings_posix.library, "posix.cfg"); - check("void f() {\n" " strdupa(\"test\");\n" "}", @@ -6379,8 +6371,7 @@ private: false, // experimental false, // inconclusive true, // posix - false, // runSimpleChecks - &settings_posix + false // runSimpleChecks ); ASSERT_EQUALS("[test.cpp:2]: (warning) Return value of function strdupa() is not used.\n", errout.str()); @@ -6394,8 +6385,7 @@ private: false, // experimental false, // inconclusive true, // posix - false, // runSimpleChecks - &settings_posix + false // runSimpleChecks ); ASSERT_EQUALS("[test.cpp:3]: (warning) Return value of function mmap() is not used.\n", errout.str()); }