-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
even more testrunner cleanups #254
Conversation
@danmar Can this be merged? I need this to finish up that other PR. |
test.cpp
Outdated
std::vector<std::string> files; | ||
return simplecpp::TokenList(istr,files,std::string(),outputList).stringify(); | ||
return makeTokenList(code, files); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks dangerous. the returned TokenList will reference the local files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I didn't think about this.
We didn't detect this in Cppcheck - I have this enabled in my IDE and it did not report anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed https://trac.cppcheck.net/ticket/10975. It is impossible to detect the issue I introduced though since we have no idea what is done with the reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test.cpp
Outdated
ASSERT_EQUALS("file0,1,syntax_error,Invalid newline in raw string delimiter.\n", toString(outputList)); | ||
outputList.clear(); | ||
|
||
readfile("A = u8R\"as\n(abc)as\"", -1, &outputList); | ||
readfile("A = u8R\"as\n(abc)as\"", &outputList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation seems wrong on this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This gets rid of all the explicit
std::istringstream
usage in the test cases so I can hopefully easily switch the implementation for the new API introduced with #244.