| 562 | } |
| 563 | |
| 564 | void premiumResultsCache() const { |
| 565 | // Trac #13889 - cached misra results are shown after removing --premium=misra-c-2012 option |
| 566 | |
| 567 | Settings settings; |
| 568 | Suppressions supprs; |
| 569 | ErrorLogger2 errorLogger; |
| 570 | |
| 571 | std::vector<std::string> files; |
| 572 | |
| 573 | const char code[] = "void f();\nint x;\n"; |
| 574 | simplecpp::TokenList tokens(code, files, "m1.c"); |
| 575 | |
| 576 | Preprocessor preprocessor(tokens, settings, errorLogger, Standards::Language::C); |
| 577 | ASSERT(preprocessor.loadFiles(files)); |
| 578 | |
| 579 | AddonInfo premiumaddon; |
| 580 | premiumaddon.name = "premiumaddon.json"; |
| 581 | premiumaddon.executable = "premiumaddon"; |
| 582 | |
| 583 | settings.cppcheckCfgProductName = "Cppcheck Premium 0.0.0"; |
| 584 | settings.addons.insert(premiumaddon.name); |
| 585 | settings.addonInfos.push_back(premiumaddon); |
| 586 | |
| 587 | settings.premiumArgs = "misra-c-2012"; |
| 588 | CppCheck check(settings, supprs, errorLogger, nullptr, false, {}); |
| 589 | const size_t hash1 = check.calculateHash(preprocessor); |
| 590 | |
| 591 | settings.premiumArgs = ""; |
| 592 | const size_t hash2 = check.calculateHash(preprocessor); |
| 593 | |
| 594 | // cppcheck-suppress knownConditionTrueFalse |
| 595 | ASSERT(hash1 != hash2); |
| 596 | } |
| 597 | |
| 598 | void purgedConfiguration() const |
| 599 | { |
nothing calls this directly
no test coverage detected