Fix invalid assertion from recent commit. Make single argument givenACodeSampleToTokenize ctor explicit.

This commit is contained in:
Alexander Mai 2014-11-18 19:52:06 +01:00
parent 4163f1e122
commit 1c191845fb
2 changed files with 2 additions and 3 deletions

View File

@ -2359,8 +2359,7 @@ private:
" addtoken(&rettail, tok);\n"
"}");
const Token *f = Token::findsimplematch(tokenizer.tokens(), "void addtoken ( Token * *");
ASSERT_EQUALS(true, db && f);
ASSERT_EQUALS(true, db && f && f->function());
ASSERT_EQUALS(true, db && f && !f->function()); // regression value only
}

View File

@ -30,7 +30,7 @@ private:
Tokenizer _tokenizer;
public:
givenACodeSampleToTokenize(const char sample[], bool createOnly = false, bool cpp = true)
explicit givenACodeSampleToTokenize(const char sample[], bool createOnly = false, bool cpp = true)
: _tokenizer(&_settings, 0) {
std::istringstream iss(sample);
if (createOnly)