From dc293ff483a90202a3d66c1c809cd9397a0d6d27 Mon Sep 17 00:00:00 2001 From: Simon Martin Date: Mon, 25 May 2015 23:13:01 +0200 Subject: [PATCH] Added unit tests for TemplateSimplifier::templateParameters involving variadic templates. --- test/testsimplifytemplate.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index be309a384..fc056a4ce 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -1169,6 +1169,14 @@ private: ASSERT_EQUALS(1U, templateParameters(" x;")); ASSERT_EQUALS(1U, templateParameters(" x;")); ASSERT_EQUALS(0U, templateParameters(">x;")); + ASSERT_EQUALS(1U, templateParameters(" x;")); + ASSERT_EQUALS(0U, templateParameters("<...> x;")); + ASSERT_EQUALS(0U, templateParameters(" x;")); // Invalid syntax + ASSERT_EQUALS(1U, templateParameters(" x;")); + ASSERT_EQUALS(0U, templateParameters(" x;")); // Invalid syntax + ASSERT_EQUALS(2U, templateParameters(" x;")); + TODO_ASSERT_EQUALS(1U, 0U, templateParameters(" x;")); // Mishandled valid syntax + TODO_ASSERT_EQUALS(2U, 0U, templateParameters(" x;")); // Mishandled valid syntax } void templateParameters1() {