| 337 | } |
| 338 | |
| 339 | void suppress_error_library() const |
| 340 | { |
| 341 | ScopedFile file("suppr_err_lib.c", |
| 342 | "void f()\n" |
| 343 | "{\n" |
| 344 | " (void)(*((int*)0));\n" |
| 345 | "}"); |
| 346 | |
| 347 | const char xmldata[] = R"(<def format="2"><markup ext=".c" reporterrors="false"/></def>)"; |
| 348 | const Settings s = settingsBuilder().libraryxml(xmldata).build(); |
| 349 | Suppressions supprs; |
| 350 | ErrorLogger2 errorLogger; |
| 351 | CppCheck cppcheck(s, supprs, errorLogger, nullptr, false, {}); |
| 352 | ASSERT_EQUALS(0, cppcheck.check(FileWithDetails(file.path(), Path::identify(file.path(), false), 0))); |
| 353 | // TODO: how to properly disable these warnings? |
| 354 | errorLogger.ids.erase(std::remove_if(errorLogger.ids.begin(), errorLogger.ids.end(), [](const std::string& id) { |
| 355 | return id == "logChecker"; |
| 356 | }), errorLogger.ids.end()); |
| 357 | ASSERT_EQUALS(0, errorLogger.ids.size()); |
| 358 | } |
| 359 | |
| 360 | // TODO: how to actually get duplicated findings |
| 361 | void unique_errors() const |