From: David Neto Date: Mon, 21 Sep 2015 15:36:44 +0000 (-0400) Subject: Put the test fixture into spvtest namespace. X-Git-Tag: upstream/2018.6~1511^2~119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b5fd4962ee3c9fedfe1bb0c7b2e9c2cba637218;p=platform%2Fupstream%2FSPIRV-Tools.git Put the test fixture into spvtest namespace. All test utility code should go into the spvtest namespace. --- diff --git a/test/AssemblyFormat.cpp b/test/AssemblyFormat.cpp index d9b646d..8cd51d7 100755 --- a/test/AssemblyFormat.cpp +++ b/test/AssemblyFormat.cpp @@ -28,7 +28,7 @@ namespace { -using test_fixture::TextToBinaryTest; +using spvtest::TextToBinaryTest; TEST_F(TextToBinaryTest, EncodeAAFTextAsAAF) { SetText("%2 = OpConstant %1 1000"); diff --git a/test/BinaryDestroy.cpp b/test/BinaryDestroy.cpp index 2dc7de5..98d7ba8 100644 --- a/test/BinaryDestroy.cpp +++ b/test/BinaryDestroy.cpp @@ -36,7 +36,7 @@ TEST(BinaryDestroy, Null) { spvBinaryDestroy(nullptr); } -using BinaryDestroySomething = test_fixture::TextToBinaryTest; +using BinaryDestroySomething = spvtest::TextToBinaryTest; // Checks safety of destroying a validly constructed binary. TEST_F(BinaryDestroySomething, Default) { diff --git a/test/Comment.cpp b/test/Comment.cpp index ff7d823..f3a29b6 100644 --- a/test/Comment.cpp +++ b/test/Comment.cpp @@ -29,7 +29,7 @@ namespace { -using test_fixture::TextToBinaryTest; +using spvtest::TextToBinaryTest; TEST_F(TextToBinaryTest, Whitespace) { SetText(R"( diff --git a/test/ImmediateInt.cpp b/test/ImmediateInt.cpp index ec7fec0..35589e2 100644 --- a/test/ImmediateInt.cpp +++ b/test/ImmediateInt.cpp @@ -34,10 +34,10 @@ namespace { +using spvtest::TextToBinaryTest; using ::testing::ElementsAre; using ::testing::HasSubstr; using ::testing::StrEq; -using test_fixture::TextToBinaryTest; const auto kCAF = SPV_ASSEMBLY_SYNTAX_FORMAT_CANONICAL; diff --git a/test/TestFixture.h b/test/TestFixture.h index 2eb48f0..8d27ab4 100644 --- a/test/TestFixture.h +++ b/test/TestFixture.h @@ -28,7 +28,7 @@ #include "UnitSPIRV.h" -namespace test_fixture { +namespace spvtest { // Common setup for TextToBinary tests. SetText() should be called to populate // the actual test text. @@ -164,6 +164,6 @@ class TextToBinaryTestBase : public T { using TextToBinaryTest = TextToBinaryTestBase<::testing::Test>; -} // namespace test_fixture +} // namespace spvtest #endif // _TEXT_FIXTURE_H_ diff --git a/test/TextToBinary.Annotation.cpp b/test/TextToBinary.Annotation.cpp index 0ab5c1b..8924d15 100755 --- a/test/TextToBinary.Annotation.cpp +++ b/test/TextToBinary.Annotation.cpp @@ -38,8 +38,8 @@ namespace { using spvtest::MakeInstruction; using spvtest::MakeVector; +using spvtest::TextToBinaryTest; using ::testing::Eq; -using test_fixture::TextToBinaryTest; // Test OpDecorate @@ -55,7 +55,7 @@ struct DecorateSimpleCase { }; using OpDecorateSimpleTest = - test_fixture::TextToBinaryTestBase<::testing::TestWithParam>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) { // This string should assemble, but should not validate. @@ -124,7 +124,7 @@ struct DecorateEnumCase { std::string enum_name; }; -using OpDecorateEnumTest = test_fixture::TextToBinaryTestBase< +using OpDecorateEnumTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(OpDecorateEnumTest, AnyEnumDecoration) { @@ -259,7 +259,7 @@ struct DecorateLinkageCase { std::string external_name; }; -using OpDecorateLinkageTest = test_fixture::TextToBinaryTestBase< +using OpDecorateLinkageTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) { diff --git a/test/TextToBinary.Constant.cpp b/test/TextToBinary.Constant.cpp index 70b7f91..bc0a7ff 100755 --- a/test/TextToBinary.Constant.cpp +++ b/test/TextToBinary.Constant.cpp @@ -39,7 +39,7 @@ using ::testing::Eq; // Test Sampler Addressing Mode enum values -using SamplerAddressingModeTest = test_fixture::TextToBinaryTestBase< +using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) { @@ -66,7 +66,7 @@ INSTANTIATE_TEST_CASE_P( // Test Sampler Filter Mode enum values -using SamplerFilterModeTest = test_fixture::TextToBinaryTestBase< +using SamplerFilterModeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) { diff --git a/test/TextToBinary.ControlFlow.cpp b/test/TextToBinary.ControlFlow.cpp index 06d817e..946cb0e 100755 --- a/test/TextToBinary.ControlFlow.cpp +++ b/test/TextToBinary.ControlFlow.cpp @@ -36,11 +36,10 @@ namespace { using spvtest::MakeInstruction; using ::testing::Eq; -using test_fixture::TextToBinaryTest; // Test OpSelectionMerge -using OpSelectionMergeTest = test_fixture::TextToBinaryTestBase< +using OpSelectionMergeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) { @@ -71,7 +70,7 @@ TEST_F(OpSelectionMergeTest, CombinedSelectionControlMask) { // Test OpLoopMerge -using OpLoopMergeTest = test_fixture::TextToBinaryTestBase< +using OpLoopMergeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) { diff --git a/test/TextToBinary.Debug.cpp b/test/TextToBinary.Debug.cpp index 35f7262..ba1a9c5 100755 --- a/test/TextToBinary.Debug.cpp +++ b/test/TextToBinary.Debug.cpp @@ -67,7 +67,7 @@ const LanguageCase kLanguageCases[] = { // clang-format on using OpSourceTest = - test_fixture::TextToBinaryTestBase<::testing::TestWithParam>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; TEST_P(OpSourceTest, AnyLanguage) { std::string input = std::string("OpSource ") + GetParam().language_name + @@ -83,7 +83,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest, // Test OpSourceExtension using OpSourceExtensionTest = - test_fixture::TextToBinaryTestBase<::testing::TestWithParam>; + spvtest::TextToBinaryTestBase<::testing::TestWithParam>; TEST_P(OpSourceExtensionTest, AnyExtension) { // TODO(dneto): utf-8, quoting, escaping diff --git a/test/TextToBinary.Function.cpp b/test/TextToBinary.Function.cpp index 39e8a1c..382001a 100755 --- a/test/TextToBinary.Function.cpp +++ b/test/TextToBinary.Function.cpp @@ -35,12 +35,12 @@ namespace { using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest;; using ::testing::Eq; -using test_fixture::TextToBinaryTest;; // Test OpFunction -using OpFunctionControlTest = test_fixture::TextToBinaryTestBase< +using OpFunctionControlTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) { diff --git a/test/TextToBinary.Group.cpp b/test/TextToBinary.Group.cpp index dc0d214..68d326c 100755 --- a/test/TextToBinary.Group.cpp +++ b/test/TextToBinary.Group.cpp @@ -39,7 +39,7 @@ using ::testing::Eq; // Test GroupOperation enum -using GroupOperationTest = test_fixture::TextToBinaryTestBase< +using GroupOperationTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(GroupOperationTest, AnyGroupOperation) { diff --git a/test/TextToBinary.Image.cpp b/test/TextToBinary.Image.cpp index 1854662..b6ecdfc 100644 --- a/test/TextToBinary.Image.cpp +++ b/test/TextToBinary.Image.cpp @@ -46,7 +46,7 @@ struct ImageOperandsCase { // Test all kinds of image operands. -using ImageOperandsTest = test_fixture::TextToBinaryTestBase< +using ImageOperandsTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(ImageOperandsTest, Sample) { diff --git a/test/TextToBinary.Literal.cpp b/test/TextToBinary.Literal.cpp index bff4c72..c95f879 100644 --- a/test/TextToBinary.Literal.cpp +++ b/test/TextToBinary.Literal.cpp @@ -30,7 +30,7 @@ namespace { -using test_fixture::TextToBinaryTest; +using spvtest::TextToBinaryTest; TEST_F(TextToBinaryTest, LiteralStringInPlaceOfLiteralNumber) { EXPECT_EQ( diff --git a/test/TextToBinary.Memory.cpp b/test/TextToBinary.Memory.cpp index dbb4725..41ed3a3 100755 --- a/test/TextToBinary.Memory.cpp +++ b/test/TextToBinary.Memory.cpp @@ -37,8 +37,8 @@ namespace { using spvtest::MakeInstruction; +using spvtest::TextToBinaryTest; using ::testing::Eq; -using test_fixture::TextToBinaryTest; // An example case for an enumerated value. template @@ -51,7 +51,7 @@ struct EnumCaseWithOperands { // Test assembly of Memory Access masks -using MemoryAccessTest = test_fixture::TextToBinaryTestBase< +using MemoryAccessTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) { @@ -86,7 +86,7 @@ TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) { // Test Storage Class enum values -using StorageClassTest = test_fixture::TextToBinaryTestBase< +using StorageClassTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(StorageClassTest, AnyStorageClass) { diff --git a/test/TextToBinary.Miscellaneous.cpp b/test/TextToBinary.Miscellaneous.cpp index b08813e..5125ebe 100644 --- a/test/TextToBinary.Miscellaneous.cpp +++ b/test/TextToBinary.Miscellaneous.cpp @@ -34,11 +34,11 @@ namespace { -using SpirvVector = test_fixture::TextToBinaryTest::SpirvVector; +using SpirvVector = spvtest::TextToBinaryTest::SpirvVector; using spv::Op; using spvtest::MakeInstruction; using ::testing::Eq; -using TextToBinaryMisc = test_fixture::TextToBinaryTest; +using TextToBinaryMisc = spvtest::TextToBinaryTest; TEST_F(TextToBinaryMisc, OpNop) { EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(OpNop, {}))); diff --git a/test/TextToBinary.ModeSetting.cpp b/test/TextToBinary.ModeSetting.cpp index 2bad4c5..53799cf 100755 --- a/test/TextToBinary.ModeSetting.cpp +++ b/test/TextToBinary.ModeSetting.cpp @@ -54,7 +54,7 @@ struct MemoryModelCase { std::string memory_name; }; -using OpMemoryModelTest = test_fixture::TextToBinaryTestBase< +using OpMemoryModelTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(OpMemoryModelTest, AnyMemoryModelCase) { @@ -97,7 +97,7 @@ struct EntryPointCase { std::string entry_point_name; }; -using OpEntryPointTest = test_fixture::TextToBinaryTestBase< +using OpEntryPointTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(OpEntryPointTest, AnyEntryPointCase) { @@ -140,7 +140,7 @@ struct ExecutionModeCase { std::vector operands; }; -using OpExecutionModeTest = test_fixture::TextToBinaryTestBase< +using OpExecutionModeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>; TEST_P(OpExecutionModeTest, AnyExecutionMode) { @@ -199,7 +199,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryExecutionMode, OpExecutionModeTest, // Test OpCapability -using OpCapabilityTest = test_fixture::TextToBinaryTestBase< +using OpCapabilityTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(OpCapabilityTest, AnyCapability) { diff --git a/test/TextToBinary.TypeDeclaration.cpp b/test/TextToBinary.TypeDeclaration.cpp index 9648218..909058b 100755 --- a/test/TextToBinary.TypeDeclaration.cpp +++ b/test/TextToBinary.TypeDeclaration.cpp @@ -39,7 +39,7 @@ using ::testing::Eq; // Test Dim enums via OpTypeImage -using DimTest = test_fixture::TextToBinaryTestBase< +using DimTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(DimTest, AnyDim) { @@ -69,7 +69,7 @@ INSTANTIATE_TEST_CASE_P( // Test ImageFormat enums via OpTypeImage -using ImageFormatTest = test_fixture::TextToBinaryTestBase< +using ImageFormatTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(ImageFormatTest, AnyImageFormat) { @@ -132,7 +132,7 @@ INSTANTIATE_TEST_CASE_P( // Test AccessQualifier enums via OpTypePipe. -using OpTypePipeTest = test_fixture::TextToBinaryTestBase< +using OpTypePipeTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(OpTypePipeTest, AnyAccessQualifier) { diff --git a/test/TextToBinary.cpp b/test/TextToBinary.cpp index 61ab12e..c1446a6 100755 --- a/test/TextToBinary.cpp +++ b/test/TextToBinary.cpp @@ -33,7 +33,7 @@ namespace { -using test_fixture::TextToBinaryTest; +using spvtest::TextToBinaryTest; TEST(GetWord, Simple) { EXPECT_EQ("", spvGetWord("")); @@ -462,7 +462,7 @@ TEST_F(TextToBinaryTest, BadSwitchTruncatedCase) { diagnostic->error); } -using TextToBinaryFloatValueTest = test_fixture::TextToBinaryTestBase< +using TextToBinaryFloatValueTest = spvtest::TextToBinaryTestBase< ::testing::TestWithParam>>; TEST_P(TextToBinaryFloatValueTest, NormalValues) {