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

Method redundant_config

test/testpreprocessor.cpp:1934–1959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1932 }
1933
1934 void redundant_config() {
1935 const char filedata[] = "int main() {\n"
1936 "#ifdef FOO\n"
1937 "#ifdef BAR\n"
1938 " std::cout << 1;\n"
1939 "#endif\n"
1940 "#endif\n"
1941 "\n"
1942 "#ifdef BAR\n"
1943 "#ifdef FOO\n"
1944 " std::cout << 2;\n"
1945 "#endif\n"
1946 "#endif\n"
1947 "}\n";
1948
1949
1950 // Preprocess => actual result..
1951 const std::map<std::string, std::string> actual = getcode(settings0, *this, filedata);
1952
1953 // Compare results..
1954 ASSERT_EQUALS(4, actual.size());
1955 ASSERT(actual.find("") != actual.end());
1956 ASSERT(actual.find("BAR=BAR") != actual.end());
1957 ASSERT(actual.find("FOO=FOO") != actual.end());
1958 ASSERT(actual.find("BAR=BAR;FOO=FOO") != actual.end());
1959 }
1960
1961
1962 void endfile() {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected