| 9278 | |
| 9279 | |
| 9280 | void ctu(const std::vector<std::string> &code) { |
| 9281 | CheckClass checkClass; |
| 9282 | Check &check = getCheck(checkClass); |
| 9283 | |
| 9284 | // getFileInfo |
| 9285 | std::list<const Check::FileInfo*> fileInfo; |
| 9286 | for (const std::string& c: code) { |
| 9287 | const std::string filename = std::to_string(fileInfo.size()) + ".cpp"; |
| 9288 | SimpleTokenizer tokenizer{settingsDefault, *this, filename}; |
| 9289 | ASSERT(tokenizer.tokenize(c)); |
| 9290 | fileInfo.push_back(check.getFileInfo(tokenizer, settingsDefault, "")); |
| 9291 | } |
| 9292 | |
| 9293 | // Check code.. |
| 9294 | const CTU::FileInfo ctu; |
| 9295 | check.analyseWholeProgram(ctu, fileInfo, settingsDefault, *this); // TODO: check result |
| 9296 | |
| 9297 | while (!fileInfo.empty()) { |
| 9298 | delete fileInfo.back(); |
| 9299 | fileInfo.pop_back(); |
| 9300 | } |
| 9301 | } |
| 9302 | |
| 9303 | void ctuOneDefinitionRule() { |
| 9304 | ctu({"class C { C() { std::cout << 0; } };", "class C { C() { std::cout << 1; } };"}); |
nothing calls this directly
no test coverage detected