From 2a2d01a87036cf98531c1cfd0b4b98a34e13e3ac Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sat, 21 Jan 2012 00:59:12 +0100 Subject: [PATCH] Remove some redundant 'errout.str("")' in some checks because it's already done inside tok call. --- test/testsimplifytokens.cpp | 1 - test/testtokenize.cpp | 8 -------- 2 files changed, 9 deletions(-) diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 754dec327..dbea633a9 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -2409,7 +2409,6 @@ private: void whileAssign2() { // #1909 - Internal error - errout.str(""); tok("void f()\n" "{\n" " int b;\n" diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 695bda7cf..0efbbd4f8 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -459,7 +459,6 @@ private: } void tokenize3() { - errout.str(""); const std::string code("void foo()\n" "{\n" " int i;\n" @@ -474,7 +473,6 @@ private: } void tokenize4() { - errout.str(""); const std::string code("class foo\n" "{\n" "public:\n" @@ -535,7 +533,6 @@ private: } void tokenize9() { - errout.str(""); const char code[] = "typedef void (*fp)();\n" "typedef fp (*fpp)();\n" "void f() {\n" @@ -625,21 +622,18 @@ private: void wrong_syntax1() { { - errout.str(""); const std::string code("TR(kvmpio, PROTO(int rw), ARGS(rw), TP_(aa->rw;))"); ASSERT_EQUALS("TR ( kvmpio , PROTO ( int rw ) , ARGS ( rw ) , TP_ ( aa . rw ; ) )", tokenizeAndStringify(code.c_str(), true)); ASSERT_EQUALS("", errout.str()); } { - errout.str(""); const std::string code("struct A { template struct { }; };"); ASSERT_EQUALS("", tokenizeAndStringify(code.c_str(), true)); ASSERT_EQUALS("[test.cpp:1]: (error) syntax error\n", errout.str()); } { - errout.str(""); const std::string code("enum ABC { A,B, typedef enum { C } };"); tokenizeAndStringify(code.c_str(), true); ASSERT_EQUALS("[test.cpp:1]: (error) syntax error\n", errout.str()); @@ -647,7 +641,6 @@ private: { // #3314 - don't report syntax error. - errout.str(""); const std::string code("struct A { typedef B::C (A::*f)(); };"); tokenizeAndStringify(code.c_str(), true); ASSERT_EQUALS("[test.cpp:1]: (debug) Failed to parse 'typedef B :: C ( A :: * f ) ( ) ;'. The checking continues anyway.\n", errout.str()); @@ -668,7 +661,6 @@ private: void wrong_syntax_if_macro() { // #2518 - errout.str(""); const std::string code("void f() { if MACRO(); }"); tokenizeAndStringify(code.c_str(), false); ASSERT_EQUALS("[test.cpp:1]: (error) syntax error\n", errout.str());