Commit ffd39978 by Victor Costan Committed by Commit Bot

test: Replace _TEST_CASE_ with _TEST_SUITE_.

Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports _TEST_SUITE_ macros instead of _TEST_CASE_, so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature Bug: chromium:925652 Change-Id: Ia0deec0bc4216ef1adabc33985a7cbda89682608 Reviewed-on: https://chromium-review.googlesource.com/c/1477418Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org>
parent 902ceed3
...@@ -161,6 +161,6 @@ TEST_P(VaryingPackingTest, MaxPlusOneMat2VaryingsFailsWebGL) ...@@ -161,6 +161,6 @@ TEST_P(VaryingPackingTest, MaxPlusOneMat2VaryingsFailsWebGL)
} }
// Makes separate tests for different values of kMaxVaryings. // Makes separate tests for different values of kMaxVaryings.
INSTANTIATE_TEST_CASE_P(, VaryingPackingTest, ::testing::Values(1, 4, 8)); INSTANTIATE_TEST_SUITE_P(, VaryingPackingTest, ::testing::Values(1, 4, 8));
} // anonymous namespace } // anonymous namespace
...@@ -443,7 +443,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa ...@@ -443,7 +443,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa
scaleValidPair(0.0f, false), scaleValidPair(0.01f, true), scaleValidPair(0.0f, false), scaleValidPair(0.01f, true),
scaleValidPair(2.00f, true)}; scaleValidPair(2.00f, true)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, CoreWindowScaleTest, testing::ValuesIn(scales)); INSTANTIATE_TEST_SUITE_P(NativeWindowTest, CoreWindowScaleTest, testing::ValuesIn(scales));
// Tests that the size property works as expected in a property set with a SwapChainPanel // Tests that the size property works as expected in a property set with a SwapChainPanel
class CoreWindowSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>> class CoreWindowSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>>
...@@ -492,6 +492,6 @@ typedef std::tuple<float, float, bool> sizeValidPair; ...@@ -492,6 +492,6 @@ typedef std::tuple<float, float, bool> sizeValidPair;
static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false), static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false),
sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)}; sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, CoreWindowSizeTest, testing::ValuesIn(sizes)); INSTANTIATE_TEST_SUITE_P(NativeWindowTest, CoreWindowSizeTest, testing::ValuesIn(sizes));
} // namespace } // namespace
...@@ -566,7 +566,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa ...@@ -566,7 +566,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa
scaleValidPair(0.0f, false), scaleValidPair(0.01f, true), scaleValidPair(0.0f, false), scaleValidPair(0.01f, true),
scaleValidPair(2.00f, true)}; scaleValidPair(2.00f, true)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, SwapChainPanelScaleTest, testing::ValuesIn(scales)); INSTANTIATE_TEST_SUITE_P(NativeWindowTest, SwapChainPanelScaleTest, testing::ValuesIn(scales));
// Tests that the size property works as expected in a property set with a SwapChainPanel // Tests that the size property works as expected in a property set with a SwapChainPanel
class SwapChainPanelSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>> class SwapChainPanelSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>>
...@@ -615,6 +615,6 @@ typedef std::tuple<float, float, bool> sizeValidPair; ...@@ -615,6 +615,6 @@ typedef std::tuple<float, float, bool> sizeValidPair;
static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false), static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false),
sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)}; sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, SwapChainPanelSizeTest, testing::ValuesIn(sizes)); INSTANTIATE_TEST_SUITE_P(NativeWindowTest, SwapChainPanelSizeTest, testing::ValuesIn(sizes));
} // namespace } // namespace
...@@ -270,7 +270,7 @@ TEST_P(EXTYUVTargetTest, CompileSucceedsWithExtensionAndPragma) ...@@ -270,7 +270,7 @@ TEST_P(EXTYUVTargetTest, CompileSucceedsWithExtensionAndPragma)
EXPECT_TRUE(TestShaderCompile(EXTYTPragma)); EXPECT_TRUE(TestShaderCompile(EXTYTPragma));
} }
INSTANTIATE_TEST_CASE_P(CorrectVariantsWithExtensionAndPragma, INSTANTIATE_TEST_SUITE_P(CorrectVariantsWithExtensionAndPragma,
EXTYUVTargetTest, EXTYUVTargetTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
...@@ -287,7 +287,7 @@ TEST_P(EXTYUVTargetCompileSuccessTest, CompileSucceeds) ...@@ -287,7 +287,7 @@ TEST_P(EXTYUVTargetCompileSuccessTest, CompileSucceeds)
EXPECT_TRUE(TestShaderCompile(EXTYTPragma)); EXPECT_TRUE(TestShaderCompile(EXTYTPragma));
} }
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTYUVTargetCompileSuccessTest, EXTYUVTargetCompileSuccessTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
...@@ -307,7 +307,7 @@ TEST_P(EXTYUVTargetCompileFailureTest, CompileFails) ...@@ -307,7 +307,7 @@ TEST_P(EXTYUVTargetCompileFailureTest, CompileFails)
EXPECT_FALSE(TestShaderCompile(EXTYTPragma)); EXPECT_FALSE(TestShaderCompile(EXTYTPragma));
} }
INSTANTIATE_TEST_CASE_P(IncorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTYUVTargetCompileFailureTest, EXTYUVTargetCompileFailureTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
...@@ -341,7 +341,7 @@ TEST_P(EXTYUVNotEnabledTest, CanOverloadConversions) ...@@ -341,7 +341,7 @@ TEST_P(EXTYUVNotEnabledTest, CanOverloadConversions)
EXPECT_TRUE(TestShaderCompile("")); EXPECT_TRUE(TestShaderCompile(""));
} }
INSTANTIATE_TEST_CASE_P(CoreESSL300Shaders, INSTANTIATE_TEST_SUITE_P(CoreESSL300Shaders,
EXTYUVNotEnabledTest, EXTYUVNotEnabledTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
......
...@@ -200,7 +200,7 @@ TEST_P(EXTBlendFuncExtendedTest, CompileSucceedsWithExtensionAndPragma) ...@@ -200,7 +200,7 @@ TEST_P(EXTBlendFuncExtendedTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly // The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string. // in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedTest, EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES2_SPEC, SH_GLES3_SPEC), Combine(Values(SH_GLES2_SPEC, SH_GLES3_SPEC),
Values("", sh::ESSLVersion100), Values("", sh::ESSLVersion100),
...@@ -208,7 +208,7 @@ INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders, ...@@ -208,7 +208,7 @@ INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders,
ESSL100_MaxDualSourceAccessShader, ESSL100_MaxDualSourceAccessShader,
ESSL100_FragDataShader))); ESSL100_FragDataShader)));
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedTest, EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
...@@ -230,7 +230,7 @@ TEST_P(EXTBlendFuncExtendedCompileFailureTest, CompileFails) ...@@ -230,7 +230,7 @@ TEST_P(EXTBlendFuncExtendedCompileFailureTest, CompileFails)
} }
// Incorrect #version 100 shaders fail. // Incorrect #version 100 shaders fail.
INSTANTIATE_TEST_CASE_P(IncorrectESSL100Shaders, INSTANTIATE_TEST_SUITE_P(IncorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest, EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC), Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100), Values(sh::ESSLVersion100),
...@@ -239,7 +239,7 @@ INSTANTIATE_TEST_CASE_P(IncorrectESSL100Shaders, ...@@ -239,7 +239,7 @@ INSTANTIATE_TEST_CASE_P(IncorrectESSL100Shaders,
ESSL100_ColorAndDataWriteFailureShader3))); ESSL100_ColorAndDataWriteFailureShader3)));
// Correct #version 300 es shaders fail in GLES2 context, regardless of version string. // Correct #version 300 es shaders fail in GLES2 context, regardless of version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest, EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC), Combine(Values(SH_GLES2_SPEC),
Values("", sh::ESSLVersion100, sh::ESSLVersion300), Values("", sh::ESSLVersion100, sh::ESSLVersion300),
...@@ -247,14 +247,14 @@ INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders, ...@@ -247,14 +247,14 @@ INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders,
ESSL300_TwoUnspecifiedLocationOutputsShader))); ESSL300_TwoUnspecifiedLocationOutputsShader)));
// Correct #version 100 shaders fail when used with #version 300 es. // Correct #version 100 shaders fail when used with #version 300 es.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest, EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300), Values(sh::ESSLVersion300),
Values(ESSL100_SimpleShader1, ESSL100_FragDataShader))); Values(ESSL100_SimpleShader1, ESSL100_FragDataShader)));
// Incorrect #version 300 es shaders always fail. // Incorrect #version 300 es shaders always fail.
INSTANTIATE_TEST_CASE_P(IncorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest, EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_1_SPEC), Combine(Values(SH_GLES3_1_SPEC),
Values(sh::ESSLVersion300, sh::ESSLVersion310), Values(sh::ESSLVersion300, sh::ESSLVersion310),
......
...@@ -58,7 +58,7 @@ TEST_P(EXTFragDepthTest, CompileSucceedsWithExtensionAndPragma) ...@@ -58,7 +58,7 @@ TEST_P(EXTFragDepthTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly // The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string. // in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTFragDepthTest, EXTFragDepthTest,
Combine(Values(SH_GLES2_SPEC), Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100), Values(sh::ESSLVersion100),
......
...@@ -59,7 +59,7 @@ TEST_P(EXTShaderTextureLodTest, CompileSucceedsWithExtensionAndPragma) ...@@ -59,7 +59,7 @@ TEST_P(EXTShaderTextureLodTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly // The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string. // in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTShaderTextureLodTest, EXTShaderTextureLodTest,
Combine(Values(SH_GLES2_SPEC), Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100), Values(sh::ESSLVersion100),
......
...@@ -63,7 +63,7 @@ class FloatLexTest : public ::testing::Test ...@@ -63,7 +63,7 @@ class FloatLexTest : public ::testing::Test
}; };
typedef ::testing::Types<StrtofClampParser, NumericLexFloatParser> FloatParserTypes; typedef ::testing::Types<StrtofClampParser, NumericLexFloatParser> FloatParserTypes;
TYPED_TEST_CASE(FloatLexTest, FloatParserTypes); TYPED_TEST_SUITE(FloatLexTest, FloatParserTypes);
TYPED_TEST(FloatLexTest, One) TYPED_TEST(FloatLexTest, One)
{ {
......
...@@ -116,4 +116,4 @@ TEST_P(FragDepthTest, ExtensionFDFailsESSL300) ...@@ -116,4 +116,4 @@ TEST_P(FragDepthTest, ExtensionFDFailsESSL300)
} }
// The tests should pass regardless whether the EXT_frag_depth is on or not. // The tests should pass regardless whether the EXT_frag_depth is on or not.
INSTANTIATE_TEST_CASE_P(FragDepthTests, FragDepthTest, testing::Values(false, true)); INSTANTIATE_TEST_SUITE_P(FragDepthTests, FragDepthTest, testing::Values(false, true));
...@@ -80,7 +80,7 @@ TEST_P(OESStandardDerivativesTest, CompileSucceedsWithExtensionAndPragma) ...@@ -80,7 +80,7 @@ TEST_P(OESStandardDerivativesTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly // The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string. // in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
CorrectESSL100Shaders, CorrectESSL100Shaders,
OESStandardDerivativesTest, OESStandardDerivativesTest,
Combine(Values(SH_GLES2_SPEC), Combine(Values(SH_GLES2_SPEC),
......
...@@ -458,7 +458,7 @@ void dEQPTest<TestModuleIndex>::TearDownTestCase() ...@@ -458,7 +458,7 @@ void dEQPTest<TestModuleIndex>::TearDownTestCase()
{}; \ {}; \
TEST_P(dEQP, API) { runTest(); } \ TEST_P(dEQP, API) { runTest(); } \
\ \
INSTANTIATE_TEST_CASE_P(, dEQP, dEQP::GetTestingRange(), \ INSTANTIATE_TEST_SUITE_P(, dEQP, dEQP::GetTestingRange(), \
[](const testing::TestParamInfo<size_t> &info) { \ [](const testing::TestParamInfo<size_t> &info) { \
return dEQP::GetCaseGTestName(info.param); \ return dEQP::GetCaseGTestName(info.param); \
}) })
......
...@@ -512,7 +512,7 @@ const angle::PlatformParameters es2_platforms[] = { ...@@ -512,7 +512,7 @@ const angle::PlatformParameters es2_platforms[] = {
ES2_VULKAN(), ES2_VULKAN(),
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
, ,
MultiDrawTest, MultiDrawTest,
testing::Combine(testing::ValuesIn(::angle::FilterTestParams(platforms, ArraySize(platforms))), testing::Combine(testing::ValuesIn(::angle::FilterTestParams(platforms, ArraySize(platforms))),
...@@ -521,7 +521,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -521,7 +521,7 @@ INSTANTIATE_TEST_CASE_P(
InstancingOption::UseInstancing)), InstancingOption::UseInstancing)),
PrintToStringParamName()); PrintToStringParamName());
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
, ,
MultiDrawNoInstancingSupportTest, MultiDrawNoInstancingSupportTest,
testing::Combine(testing::ValuesIn(::angle::FilterTestParams(es2_platforms, testing::Combine(testing::ValuesIn(::angle::FilterTestParams(es2_platforms,
......
...@@ -39,7 +39,7 @@ typedef testing::Types<D3D11> ConformanceTestTypes; ...@@ -39,7 +39,7 @@ typedef testing::Types<D3D11> ConformanceTestTypes;
template <typename T> \ template <typename T> \
class name : public ConformanceTest<T> \ class name : public ConformanceTest<T> \
{}; \ {}; \
TYPED_TEST_CASE(name, ConformanceTestTypes); TYPED_TEST_SUITE(name, ConformanceTestTypes);
template <typename T> template <typename T>
class ConformanceTest : public testing::Test class ConformanceTest : public testing::Test
......
...@@ -52,7 +52,7 @@ using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>, angle::B ...@@ -52,7 +52,7 @@ using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>, angle::B
#else #else
using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>>; using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>>;
#endif // defined(ANGLE_IS_64_BIT_CPU) #endif // defined(ANGLE_IS_64_BIT_CPU)
TYPED_TEST_CASE(BitSetIteratorPerfTest, TestTypes); TYPED_TEST_SUITE(BitSetIteratorPerfTest, TestTypes);
TYPED_TEST(BitSetIteratorPerfTest, Run) TYPED_TEST(BitSetIteratorPerfTest, Run)
{ {
......
...@@ -610,7 +610,7 @@ TEST_P(VulkanCommandBufferPerfTest, Run) ...@@ -610,7 +610,7 @@ TEST_P(VulkanCommandBufferPerfTest, Run)
run(); run();
} }
INSTANTIATE_TEST_CASE_P(, INSTANTIATE_TEST_SUITE_P(,
VulkanCommandBufferPerfTest, VulkanCommandBufferPerfTest,
::testing::Values(PrimaryCBHundredIndividualParams(), ::testing::Values(PrimaryCBHundredIndividualParams(),
PrimaryCBOneWithOneHundredParams(), PrimaryCBOneWithOneHundredParams(),
......
...@@ -92,6 +92,6 @@ TEST_P(CharTest, Identified) ...@@ -92,6 +92,6 @@ TEST_P(CharTest, Identified)
// Note +1 for the max-value in range. It is there because the max-value // Note +1 for the max-value in range. It is there because the max-value
// not included in the range. // not included in the range.
INSTANTIATE_TEST_CASE_P(All, CharTest, testing::Range(CHAR_MIN, CHAR_MAX + 1)); INSTANTIATE_TEST_SUITE_P(All, CharTest, testing::Range(CHAR_MIN, CHAR_MAX + 1));
} // namespace angle } // namespace angle
...@@ -22,7 +22,7 @@ TEST_P(CommentTest, CommentIgnored) ...@@ -22,7 +22,7 @@ TEST_P(CommentTest, CommentIgnored)
EXPECT_EQ(pp::Token::LAST, token.type); EXPECT_EQ(pp::Token::LAST, token.type);
} }
INSTANTIATE_TEST_CASE_P(LineComment, INSTANTIATE_TEST_SUITE_P(LineComment,
CommentTest, CommentTest,
testing::Values("//foo\n", // With newline. testing::Values("//foo\n", // With newline.
"//foo", // Without newline. "//foo", // Without newline.
...@@ -30,7 +30,7 @@ INSTANTIATE_TEST_CASE_P(LineComment, ...@@ -30,7 +30,7 @@ INSTANTIATE_TEST_CASE_P(LineComment,
"////", // Nested line comment. "////", // Nested line comment.
"//\"")); // Invalid character. "//\"")); // Invalid character.
INSTANTIATE_TEST_CASE_P(BlockComment, INSTANTIATE_TEST_SUITE_P(BlockComment,
CommentTest, CommentTest,
testing::Values("/*foo*/", testing::Values("/*foo*/",
"/*foo\n*/", // With newline. "/*foo\n*/", // With newline.
......
...@@ -130,6 +130,6 @@ static const ExtensionTestParam kParams[] = { ...@@ -130,6 +130,6 @@ static const ExtensionTestParam kParams[] = {
{"#extension foo : \n", pp::Diagnostics::PP_INVALID_EXTENSION_DIRECTIVE}, {"#extension foo : \n", pp::Diagnostics::PP_INVALID_EXTENSION_DIRECTIVE},
{"#extension foo : 1\n", pp::Diagnostics::PP_INVALID_EXTENSION_BEHAVIOR}, {"#extension foo : 1\n", pp::Diagnostics::PP_INVALID_EXTENSION_BEHAVIOR},
{"#extension foo : bar baz\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN}}; {"#extension foo : bar baz\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN}};
INSTANTIATE_TEST_CASE_P(All, InvalidExtensionTest, testing::ValuesIn(kParams)); INSTANTIATE_TEST_SUITE_P(All, InvalidExtensionTest, testing::ValuesIn(kParams));
} // namespace angle } // namespace angle
...@@ -39,13 +39,13 @@ TEST_P(SingleLetterIdentifierTest, Identified) ...@@ -39,13 +39,13 @@ TEST_P(SingleLetterIdentifierTest, Identified)
} }
// Test string: '_' // Test string: '_'
INSTANTIATE_TEST_CASE_P(Underscore, SingleLetterIdentifierTest, testing::Values('_')); INSTANTIATE_TEST_SUITE_P(Underscore, SingleLetterIdentifierTest, testing::Values('_'));
// Test string: [a-z] // Test string: [a-z]
INSTANTIATE_TEST_CASE_P(a_z, SingleLetterIdentifierTest, CLOSED_RANGE('a', 'z')); INSTANTIATE_TEST_SUITE_P(a_z, SingleLetterIdentifierTest, CLOSED_RANGE('a', 'z'));
// Test string: [A-Z] // Test string: [A-Z]
INSTANTIATE_TEST_CASE_P(A_Z, SingleLetterIdentifierTest, CLOSED_RANGE('A', 'Z')); INSTANTIATE_TEST_SUITE_P(A_Z, SingleLetterIdentifierTest, CLOSED_RANGE('A', 'Z'));
typedef std::tuple<char, char> IdentifierParams; typedef std::tuple<char, char> IdentifierParams;
class DoubleLetterIdentifierTest : public IdentifierTest, class DoubleLetterIdentifierTest : public IdentifierTest,
...@@ -63,62 +63,62 @@ TEST_P(DoubleLetterIdentifierTest, Identified) ...@@ -63,62 +63,62 @@ TEST_P(DoubleLetterIdentifierTest, Identified)
} }
// Test string: "__" // Test string: "__"
INSTANTIATE_TEST_CASE_P(Underscore_Underscore, INSTANTIATE_TEST_SUITE_P(Underscore_Underscore,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), testing::Values('_'))); testing::Combine(testing::Values('_'), testing::Values('_')));
// Test string: "_"[a-z] // Test string: "_"[a-z]
INSTANTIATE_TEST_CASE_P(Underscore_a_z, INSTANTIATE_TEST_SUITE_P(Underscore_a_z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('a', 'z'))); testing::Combine(testing::Values('_'), CLOSED_RANGE('a', 'z')));
// Test string: "_"[A-Z] // Test string: "_"[A-Z]
INSTANTIATE_TEST_CASE_P(Underscore_A_Z, INSTANTIATE_TEST_SUITE_P(Underscore_A_Z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('A', 'Z'))); testing::Combine(testing::Values('_'), CLOSED_RANGE('A', 'Z')));
// Test string: "_"[0-9] // Test string: "_"[0-9]
INSTANTIATE_TEST_CASE_P(Underscore_0_9, INSTANTIATE_TEST_SUITE_P(Underscore_0_9,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('0', '9'))); testing::Combine(testing::Values('_'), CLOSED_RANGE('0', '9')));
// Test string: [a-z]"_" // Test string: [a-z]"_"
INSTANTIATE_TEST_CASE_P(a_z_Underscore, INSTANTIATE_TEST_SUITE_P(a_z_Underscore,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), testing::Values('_'))); testing::Combine(CLOSED_RANGE('a', 'z'), testing::Values('_')));
// Test string: [a-z][a-z] // Test string: [a-z][a-z]
INSTANTIATE_TEST_CASE_P(a_z_a_z, INSTANTIATE_TEST_SUITE_P(a_z_a_z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('a', 'z'))); testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('a', 'z')));
// Test string: [a-z][A-Z] // Test string: [a-z][A-Z]
INSTANTIATE_TEST_CASE_P(a_z_A_Z, INSTANTIATE_TEST_SUITE_P(a_z_A_Z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('A', 'Z'))); testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('A', 'Z')));
// Test string: [a-z][0-9] // Test string: [a-z][0-9]
INSTANTIATE_TEST_CASE_P(a_z_0_9, INSTANTIATE_TEST_SUITE_P(a_z_0_9,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('0', '9'))); testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('0', '9')));
// Test string: [A-Z]"_" // Test string: [A-Z]"_"
INSTANTIATE_TEST_CASE_P(A_Z_Underscore, INSTANTIATE_TEST_SUITE_P(A_Z_Underscore,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), testing::Values('_'))); testing::Combine(CLOSED_RANGE('A', 'Z'), testing::Values('_')));
// Test string: [A-Z][a-z] // Test string: [A-Z][a-z]
INSTANTIATE_TEST_CASE_P(A_Z_a_z, INSTANTIATE_TEST_SUITE_P(A_Z_a_z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('a', 'z'))); testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('a', 'z')));
// Test string: [A-Z][A-Z] // Test string: [A-Z][A-Z]
INSTANTIATE_TEST_CASE_P(A_Z_A_Z, INSTANTIATE_TEST_SUITE_P(A_Z_A_Z,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('A', 'Z'))); testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('A', 'Z')));
// Test string: [A-Z][0-9] // Test string: [A-Z][0-9]
INSTANTIATE_TEST_CASE_P(A_Z_0_9, INSTANTIATE_TEST_SUITE_P(A_Z_0_9,
DoubleLetterIdentifierTest, DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('0', '9'))); testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('0', '9')));
......
...@@ -370,7 +370,7 @@ static const LineTestParam kParams[] = { ...@@ -370,7 +370,7 @@ static const LineTestParam kParams[] = {
{"#line 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}, {"#line 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW},
{"#line 10 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}}; {"#line 10 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}};
INSTANTIATE_TEST_CASE_P(All, InvalidLineTest, testing::ValuesIn(kParams)); INSTANTIATE_TEST_SUITE_P(All, InvalidLineTest, testing::ValuesIn(kParams));
struct LineExpressionTestParam struct LineExpressionTestParam
{ {
...@@ -399,6 +399,6 @@ static const LineExpressionTestParam kParamsLineExpressionTest[] = { ...@@ -399,6 +399,6 @@ static const LineExpressionTestParam kParamsLineExpressionTest[] = {
{"+9", 9}, {"(1 + 2) * 4", 12}, {"3 | 5", 7}, {"3 ^ 5", 6}, {"3 & 5", 1}, {"+9", 9}, {"(1 + 2) * 4", 12}, {"3 | 5", 7}, {"3 ^ 5", 6}, {"3 & 5", 1},
{"~5", ~5}, {"2 << 3", 16}, {"16 >> 2", 4}}; {"~5", ~5}, {"2 << 3", 16}, {"16 >> 2", 4}};
INSTANTIATE_TEST_CASE_P(All, LineExpressionTest, testing::ValuesIn(kParamsLineExpressionTest)); INSTANTIATE_TEST_SUITE_P(All, LineExpressionTest, testing::ValuesIn(kParamsLineExpressionTest));
} // namespace angle } // namespace angle
...@@ -28,9 +28,9 @@ TEST_P(InvalidNumberTest, InvalidNumberIdentified) ...@@ -28,9 +28,9 @@ TEST_P(InvalidNumberTest, InvalidNumberIdentified)
preprocess(str); preprocess(str);
} }
INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest, testing::Values("1a", "08", "0xG")); INSTANTIATE_TEST_SUITE_P(InvalidIntegers, InvalidNumberTest, testing::Values("1a", "08", "0xG"));
INSTANTIATE_TEST_CASE_P(InvalidFloats, INSTANTIATE_TEST_SUITE_P(InvalidFloats,
InvalidNumberTest, InvalidNumberTest,
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1")); testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
...@@ -50,23 +50,23 @@ TEST_P(IntegerTest, Identified) ...@@ -50,23 +50,23 @@ TEST_P(IntegerTest, Identified)
EXPECT_EQ(str, token.text); EXPECT_EQ(str, token.text);
} }
INSTANTIATE_TEST_CASE_P(DecimalInteger, INSTANTIATE_TEST_SUITE_P(DecimalInteger,
IntegerTest, IntegerTest,
testing::Combine(testing::Values(""), CLOSED_RANGE('0', '9'))); testing::Combine(testing::Values(""), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(OctalInteger, INSTANTIATE_TEST_SUITE_P(OctalInteger,
IntegerTest, IntegerTest,
testing::Combine(testing::Values("0"), CLOSED_RANGE('0', '7'))); testing::Combine(testing::Values("0"), CLOSED_RANGE('0', '7')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_0_9, INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_0_9,
IntegerTest, IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('0', '9'))); testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_a_f, INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_a_f,
IntegerTest, IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('a', 'f'))); testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('a', 'f')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_A_F, INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_A_F,
IntegerTest, IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('A', 'F'))); testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('A', 'F')));
...@@ -102,7 +102,7 @@ TEST_P(FloatScientificTest, FloatIdentified) ...@@ -102,7 +102,7 @@ TEST_P(FloatScientificTest, FloatIdentified)
expectFloat(str); expectFloat(str);
} }
INSTANTIATE_TEST_CASE_P(FloatScientific, INSTANTIATE_TEST_SUITE_P(FloatScientific,
FloatScientificTest, FloatScientificTest,
testing::Combine(CLOSED_RANGE('0', '9'), testing::Combine(CLOSED_RANGE('0', '9'),
testing::Values('e', 'E'), testing::Values('e', 'E'),
...@@ -132,15 +132,15 @@ TEST_P(FloatFractionTest, FloatIdentified) ...@@ -132,15 +132,15 @@ TEST_P(FloatFractionTest, FloatIdentified)
expectFloat(str); expectFloat(str);
} }
INSTANTIATE_TEST_CASE_P(FloatFraction_X_X, INSTANTIATE_TEST_SUITE_P(FloatFraction_X_X,
FloatFractionTest, FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), CLOSED_RANGE('0', '9'))); testing::Combine(CLOSED_RANGE('0', '9'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(FloatFraction_0_X, INSTANTIATE_TEST_SUITE_P(FloatFraction_0_X,
FloatFractionTest, FloatFractionTest,
testing::Combine(testing::Values('\0'), CLOSED_RANGE('0', '9'))); testing::Combine(testing::Values('\0'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(FloatFraction_X_0, INSTANTIATE_TEST_SUITE_P(FloatFraction_X_0,
FloatFractionTest, FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), testing::Values('\0'))); testing::Combine(CLOSED_RANGE('0', '9'), testing::Values('\0')));
......
...@@ -73,6 +73,6 @@ static const OperatorTestParam kOperators[] = {{"(", '('}, ...@@ -73,6 +73,6 @@ static const OperatorTestParam kOperators[] = {{"(", '('},
{"^=", pp::Token::OP_XOR_ASSIGN}, {"^=", pp::Token::OP_XOR_ASSIGN},
{"|=", pp::Token::OP_OR_ASSIGN}}; {"|=", pp::Token::OP_OR_ASSIGN}};
INSTANTIATE_TEST_CASE_P(All, OperatorTest, testing::ValuesIn(kOperators)); INSTANTIATE_TEST_SUITE_P(All, OperatorTest, testing::ValuesIn(kOperators));
} // namespace angle } // namespace angle
...@@ -140,7 +140,7 @@ TEST_P(InvalidPragmaTest, Identified) ...@@ -140,7 +140,7 @@ TEST_P(InvalidPragmaTest, Identified)
preprocess(str, expected); preprocess(str, expected);
} }
INSTANTIATE_TEST_CASE_P(All, INSTANTIATE_TEST_SUITE_P(All,
InvalidPragmaTest, InvalidPragmaTest,
testing::Values("#pragma 1\n", // Invalid name. testing::Values("#pragma 1\n", // Invalid name.
"#pragma foo()\n", // Missing value. "#pragma foo()\n", // Missing value.
......
...@@ -51,7 +51,7 @@ TEST_P(SpaceCharTest, SpaceIgnored) ...@@ -51,7 +51,7 @@ TEST_P(SpaceCharTest, SpaceIgnored)
expectSpace(str); expectSpace(str);
} }
INSTANTIATE_TEST_CASE_P(SingleSpaceChar, SpaceCharTest, testing::ValuesIn(kSpaceChars)); INSTANTIATE_TEST_SUITE_P(SingleSpaceChar, SpaceCharTest, testing::ValuesIn(kSpaceChars));
// This test fixture tests the processing of a string containing consecutive // This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible // whitespace characters. All tests in this fixture are ran with all possible
...@@ -72,7 +72,7 @@ TEST_P(SpaceStringTest, SpaceIgnored) ...@@ -72,7 +72,7 @@ TEST_P(SpaceStringTest, SpaceIgnored)
expectSpace(str); expectSpace(str);
} }
INSTANTIATE_TEST_CASE_P(SpaceCharCombination, INSTANTIATE_TEST_SUITE_P(SpaceCharCombination,
SpaceStringTest, SpaceStringTest,
testing::Combine(testing::ValuesIn(kSpaceChars), testing::Combine(testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars), testing::ValuesIn(kSpaceChars),
......
...@@ -196,6 +196,6 @@ static const VersionTestParam kParams[] = { ...@@ -196,6 +196,6 @@ static const VersionTestParam kParams[] = {
{"#version 100 foo\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN}, {"#version 100 foo\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN},
{"#version 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}}; {"#version 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}};
INSTANTIATE_TEST_CASE_P(All, InvalidVersionTest, testing::ValuesIn(kParams)); INSTANTIATE_TEST_SUITE_P(All, InvalidVersionTest, testing::ValuesIn(kParams));
} // namespace angle } // namespace angle
...@@ -55,7 +55,7 @@ std::vector<T> FilterTestParams(const std::vector<T> &params) ...@@ -55,7 +55,7 @@ std::vector<T> FilterTestParams(const std::vector<T> &params)
// arguments must match, and getRenderer must be implemented for that type. // arguments must match, and getRenderer must be implemented for that type.
#define ANGLE_INSTANTIATE_TEST(testName, firstParam, ...) \ #define ANGLE_INSTANTIATE_TEST(testName, firstParam, ...) \
const decltype(firstParam) testName##params[] = {firstParam, ##__VA_ARGS__}; \ const decltype(firstParam) testName##params[] = {firstParam, ##__VA_ARGS__}; \
INSTANTIATE_TEST_CASE_P(, testName, \ INSTANTIATE_TEST_SUITE_P(, testName, \
testing::ValuesIn(::angle::FilterTestParams( \ testing::ValuesIn(::angle::FilterTestParams( \
testName##params, ArraySize(testName##params))), \ testName##params, ArraySize(testName##params))), \
testing::PrintToStringParamName()) testing::PrintToStringParamName())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment