diff --git a/test.cpp b/test.cpp index 612946f..46bfad8 100644 --- a/test.cpp +++ b/test.cpp @@ -23,6 +23,8 @@ struct StreamStringTest : public ::testing::Test std::stringstream _stream; }; +class SingleParamStringTest : public ::testing::TestWithParam> {}; + /////////////////////////////////////////////////////////////// /// Testing data /// /////////////////////////////////////////////////////////////// @@ -44,6 +46,15 @@ static const std::vector testvalues2 = std::make_tuple("te", 'j', "tej") }; +static const std::vector> testvalues3 = + { + std::make_tuple("cica"), + std::make_tuple("sajt"), + std::make_tuple("sör"), + std::make_tuple("C++11"), + std::make_tuple("suchInitializerList") + }; + /////////////////////////////////////////////////////////////// /// Tests /// /////////////////////////////////////////////////////////////// @@ -128,13 +139,14 @@ TEST_P(addCharStringTest, plusEqualsCharable) } INSTANTIATE_TEST_CASE_P(testGroup1, addCharStringTest, ::testing::ValuesIn(testvalues2)); -TEST(StringTest, comparable) +TEST_P(SingleParamStringTest, comparable) { - String str1("cica"); - String str2("cica"); + String str1(std::get<0>(GetParam())); + String str2(std::get<0>(GetParam())); EXPECT_EQ(str1, str2); } +INSTANTIATE_TEST_CASE_P(testGroup1, SingleParamStringTest, ::testing::ValuesIn(testvalues3)); TEST(StringTest, uninitializedStringCompareThrows) {