@@ -139,16 +139,12 @@ class TestLibrary : public TestFixture {
139139 Library library;
140140 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
141141 {
142- TokenList tokenList (nullptr );
143- std::istringstream istr (" fred.foo(123);" ); // <- wrong scope, not library function
144- tokenList.createTokens (istr);
142+ const TokenListCode tokenList (" fred.foo(123);" );// <- wrong scope, not library function
145143
146144 ASSERT (library.isNotLibraryFunction (tokenList.front ()->tokAt (2 )));
147145 }
148146 {
149- TokenList tokenList (nullptr );
150- std::istringstream istr (" Fred::foo(123);" ); // <- wrong scope, not library function
151- tokenList.createTokens (istr);
147+ const TokenListCode tokenList (" Fred::foo(123);" ); // <- wrong scope, not library function
152148
153149 ASSERT (library.isNotLibraryFunction (tokenList.front ()->tokAt (2 )));
154150 }
@@ -231,9 +227,7 @@ class TestLibrary : public TestFixture {
231227 " </function>\n "
232228 " </def>" ;
233229
234- TokenList tokenList (nullptr );
235- std::istringstream istr (" Fred foo(123);" ); // <- Variable declaration, not library function
236- tokenList.createTokens (istr);
230+ TokenListCode tokenList (" Fred foo(123);" ); // <- Variable declaration, not library function
237231 tokenList.front ()->next ()->astOperand1 (tokenList.front ());
238232 tokenList.front ()->next ()->varId (1 );
239233
@@ -291,9 +285,7 @@ class TestLibrary : public TestFixture {
291285 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
292286 ASSERT_EQUALS (0 , library.functions [" foo" ].argumentChecks [-1 ].notuninit );
293287
294- TokenList tokenList (nullptr );
295- std::istringstream istr (" foo(a,b,c,d,e);" );
296- tokenList.createTokens (istr);
288+ TokenListCode tokenList (" foo(a,b,c,d,e);" );
297289 tokenList.front ()->next ()->astOperand1 (tokenList.front ());
298290
299291 ASSERT_EQUALS (false , library.isuninitargbad (tokenList.front (), 1 ));
@@ -316,9 +308,7 @@ class TestLibrary : public TestFixture {
316308 Library library;
317309 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
318310
319- TokenList tokenList (nullptr );
320- std::istringstream istr (" foo(a,b,c,d);" );
321- tokenList.createTokens (istr);
311+ TokenListCode tokenList (" foo(a,b,c,d);" );
322312 tokenList.front ()->next ()->astOperand1 (tokenList.front ());
323313
324314 ASSERT (Library::ArgumentChecks::Direction::DIR_IN == library.getArgDirection (tokenList.front (), 1 ));
@@ -348,9 +338,7 @@ class TestLibrary : public TestFixture {
348338 Library library;
349339 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
350340
351- TokenList tokenList (nullptr );
352- std::istringstream istr (" foo(a,b,c,d,e,f,g,h,i,j,k);" );
353- tokenList.createTokens (istr);
341+ TokenListCode tokenList (" foo(a,b,c,d,e,f,g,h,i,j,k);" );
354342 tokenList.front ()->next ()->astOperand1 (tokenList.front ());
355343
356344 // 1-
@@ -490,9 +478,7 @@ class TestLibrary : public TestFixture {
490478 Library library;
491479 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
492480
493- TokenList tokenList (nullptr );
494- std::istringstream istr (" foo(a,b,c,d,e);" );
495- tokenList.createTokens (istr);
481+ TokenListCode tokenList (" foo(a,b,c,d,e);" );
496482 tokenList.front ()->next ()->astOperand1 (tokenList.front ());
497483
498484 // arg1: type=strlen arg2
@@ -553,16 +539,12 @@ class TestLibrary : public TestFixture {
553539 ASSERT (library.functions .at (" bar" ).argumentChecks .empty ());
554540
555541 {
556- TokenList tokenList (nullptr );
557- std::istringstream istr (" Foo::foo();" );
558- tokenList.createTokens (istr);
542+ const TokenListCode tokenList (" Foo::foo();" );
559543 ASSERT (library.isnotnoreturn (tokenList.front ()->tokAt (2 )));
560544 }
561545
562546 {
563- TokenList tokenList (nullptr );
564- std::istringstream istr (" bar();" );
565- tokenList.createTokens (istr);
547+ const TokenListCode tokenList (" bar();" );
566548 ASSERT (library.isnotnoreturn (tokenList.front ()));
567549 }
568550 }
@@ -634,9 +616,7 @@ class TestLibrary : public TestFixture {
634616 Library library;
635617 ASSERT (loadxmldata (library, xmldata, sizeof (xmldata)));
636618
637- TokenList tokenList (nullptr );
638- std::istringstream istr (" a(); b();" );
639- tokenList.createTokens (istr);
619+ const TokenListCode tokenList (" a(); b();" );
640620
641621 const Library::WarnInfo* a = library.getWarnInfo (tokenList.front ());
642622 const Library::WarnInfo* b = library.getWarnInfo (tokenList.front ()->tokAt (4 ));
0 commit comments