| 1973 | } |
| 1974 | |
| 1975 | void dup_defines() { |
| 1976 | const char filedata[] = "#ifdef A\n" |
| 1977 | "#define B\n" |
| 1978 | "#if defined(B) && defined(A)\n" |
| 1979 | "a\n" |
| 1980 | "#else\n" |
| 1981 | "b\n" |
| 1982 | "#endif\n" |
| 1983 | "#endif\n"; |
| 1984 | |
| 1985 | // Preprocess => actual result.. |
| 1986 | const std::map<std::string, std::string> actual = getcode(settings0, *this, filedata); |
| 1987 | |
| 1988 | // B will always be defined if A is defined; the following test |
| 1989 | // cases should be fixed whenever this other bug is fixed |
| 1990 | ASSERT_EQUALS(2U, actual.size()); |
| 1991 | |
| 1992 | ASSERT_EQUALS_MSG(true, (actual.find("A=A") != actual.end()), "A is expected to be checked but it was not checked"); |
| 1993 | |
| 1994 | ASSERT_EQUALS_MSG(true, (actual.find("A=A;A=A;B=B") == actual.end()), "A;A;B is expected to NOT be checked but it was checked"); |
| 1995 | } |
| 1996 | |
| 1997 | void invalid_define_1() { |
| 1998 | (void)getcode(settings0, *this, "#define =\n"); |