| 414 | } |
| 415 | |
| 416 | void Bug2190219() { |
| 417 | const char filedata[] = "#ifdef __cplusplus\n" |
| 418 | "cpp\n" |
| 419 | "#else\n" |
| 420 | "c\n" |
| 421 | "#endif"; |
| 422 | |
| 423 | { |
| 424 | // Preprocess => actual result.. |
| 425 | const std::map<std::string, std::string> actual = getcode(settings0, *this, filedata, "file.cpp"); |
| 426 | |
| 427 | // Compare results.. |
| 428 | ASSERT_EQUALS(1U, actual.size()); |
| 429 | ASSERT_EQUALS("\ncpp", actual.at("")); |
| 430 | } |
| 431 | |
| 432 | { |
| 433 | // Ticket #7102 - skip __cplusplus in C code |
| 434 | // Preprocess => actual result.. |
| 435 | const std::map<std::string, std::string> actual = getcode(settings0, *this, filedata, "file.c"); |
| 436 | |
| 437 | // Compare results.. |
| 438 | ASSERT_EQUALS(1U, actual.size()); |
| 439 | ASSERT_EQUALS("\n\n\nc", actual.at("")); |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | void error1() { |
| 444 | const char filedata[] = "#ifdef A\n" |