Skip to content

Commit ae3b9c0

Browse files
committed
testcppcheck.cpp: removed std::istringstream usage
1 parent ba32fd2 commit ae3b9c0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

test/testcppcheck.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <algorithm>
3434
#include <cstdlib>
3535
#include <list>
36-
#include <sstream>
3736
#include <string>
3837
#include <unordered_set>
3938
#include <utility>
@@ -486,9 +485,8 @@ class TestCppcheck : public TestFixture {
486485
"y\n"
487486
";\n";
488487

489-
std::istringstream fin(code);
490488
simplecpp::OutputList outputList;
491-
const simplecpp::TokenList tokens2(fin, files, "", &outputList);
489+
const simplecpp::TokenList tokens2(code, files, "", &outputList);
492490
const std::string expected2 = " <rawtokens>\n"
493491
" <file index=\"0\" name=\"test.c\"/>\n"
494492
" <file index=\"1\" name=\"\"/>\n"
@@ -531,8 +529,8 @@ class TestCppcheck : public TestFixture {
531529

532530
std::vector<std::string> files;
533531

534-
std::istringstream istr("void f();\nint x;\n");
535-
const simplecpp::TokenList tokens(istr, files, "m1.c");
532+
const char code[] = "void f();\nint x;\n";
533+
const simplecpp::TokenList tokens(code, files, "m1.c");
536534

537535
Preprocessor preprocessor(settings, errorLogger, Standards::Language::C);
538536
ASSERT(preprocessor.loadFiles(tokens, files));

0 commit comments

Comments
 (0)