From 5e932813106d7c8d79ecced553be6f3f2aff56c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 13 Nov 2010 15:45:33 +0100 Subject: [PATCH] Tokenizer: Added TODO test cases for splitting up variable declarations --- test/testtokenize.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 4831b7799..1b04e43ec 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -217,7 +217,8 @@ private: TEST_CASE(vardecl11); TEST_CASE(vardecl12); TEST_CASE(vardecl13); - TEST_CASE(vardecl_stl); + TEST_CASE(vardecl_stl_1); + TEST_CASE(vardecl_stl_2); TEST_CASE(vardecl_template); TEST_CASE(vardecl_union); TEST_CASE(volatile_variables); @@ -3578,7 +3579,7 @@ private: ASSERT_EQUALS(res4, tokenizeAndStringify(code4)); } - void vardecl_stl() + void vardecl_stl_1() { // ticket #520 @@ -3595,6 +3596,17 @@ private: ASSERT_EQUALS(res3, tokenizeAndStringify(code3)); } + void vardecl_stl_2() + { + const char code1[] = "{ std::string x = \"abc\"; }"; + TODO_ASSERT_EQUALS("{ std :: string x ; x = \"abc\" ; }", tokenizeAndStringify(code1)); + ASSERT_EQUALS("{ std :: string x = \"abc\" ; }", tokenizeAndStringify(code1)); + + const char code2[] = "{ std::vector x = y; }"; + TODO_ASSERT_EQUALS("{ std :: vector < int > x ; x = y ; }", tokenizeAndStringify(code2)); + ASSERT_EQUALS("{ std :: vector < int > x = y ; }", tokenizeAndStringify(code2)); + } + void vardecl_template() { // ticket #1046