Removed todo testcase for #5783

This commit is contained in:
Daniel Marjamäki 2016-05-26 18:47:36 +02:00
parent 2417f72c5e
commit be755af762
1 changed files with 0 additions and 25 deletions

View File

@ -463,7 +463,6 @@ private:
TEST_CASE(removeMacroInClassDef); // #6058
TEST_CASE(sizeofAddParentheses);
TEST_CASE(noreturn); // #5783
}
std::string tokenizeAndStringify(const char code[], bool simplify = false, bool expand = true, Settings::PlatformType platform = Settings::Native, const char* filename = "test.cpp", bool cpp11 = true) {
@ -8426,30 +8425,6 @@ private:
ASSERT_EQUALS("sizeof ( a [ 2 ] . b ) + 3 ;", tokenizeAndStringify("sizeof a[2].b+3;"));
ASSERT_EQUALS("f ( 0 , sizeof ( ptr . bar ) ) ;", tokenizeAndStringify("f(0, sizeof ptr->bar );"));
}
// see #5783
void noreturn() {
const char code[] = "void myassert() {\n"
" exit(1);\n"
"}\n"
"void f(char *buf) {\n"
" if(i==0) {\n"
" free(buf);\n"
" myassert();\n"
" }\n"
" free(buf);\n"
"}\n";
// tokenize..
Tokenizer tokenizer(&settings0, this);
std::istringstream istr(code);
tokenizer.tokenize(istr, "test.cpp");
const Token * func = Token::findsimplematch(tokenizer.tokens(), "myassert");
TODO_ASSERT(func && func->isAttributeNoreturn());
}
};
REGISTER_TEST(TestTokenizer)