Put the test fixture into spvtest namespace.
authorDavid Neto <dneto@google.com>
Mon, 21 Sep 2015 15:36:44 +0000 (11:36 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
All test utility code should go into the spvtest namespace.

18 files changed:
test/AssemblyFormat.cpp
test/BinaryDestroy.cpp
test/Comment.cpp
test/ImmediateInt.cpp
test/TestFixture.h
test/TextToBinary.Annotation.cpp
test/TextToBinary.Constant.cpp
test/TextToBinary.ControlFlow.cpp
test/TextToBinary.Debug.cpp
test/TextToBinary.Function.cpp
test/TextToBinary.Group.cpp
test/TextToBinary.Image.cpp
test/TextToBinary.Literal.cpp
test/TextToBinary.Memory.cpp
test/TextToBinary.Miscellaneous.cpp
test/TextToBinary.ModeSetting.cpp
test/TextToBinary.TypeDeclaration.cpp
test/TextToBinary.cpp

index d9b646d..8cd51d7 100755 (executable)
@@ -28,7 +28,7 @@
 
 namespace {
 
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
 
 TEST_F(TextToBinaryTest, EncodeAAFTextAsAAF) {
   SetText("%2 = OpConstant %1 1000");
index 2dc7de5..98d7ba8 100644 (file)
@@ -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) {
index ff7d823..f3a29b6 100644 (file)
@@ -29,7 +29,7 @@
 
 namespace {
 
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
 
 TEST_F(TextToBinaryTest, Whitespace) {
   SetText(R"(
index ec7fec0..35589e2 100644 (file)
 
 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;
 
index 2eb48f0..8d27ab4 100644 (file)
@@ -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_
index 0ab5c1b..8924d15 100755 (executable)
@@ -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<DecorateSimpleCase>>;
+    spvtest::TextToBinaryTestBase<::testing::TestWithParam<DecorateSimpleCase>>;
 
 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<DecorateEnumCase>>;
 
 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<DecorateLinkageCase>>;
 
 TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) {
index 70b7f91..bc0a7ff 100755 (executable)
@@ -39,7 +39,7 @@ using ::testing::Eq;
 
 // Test Sampler Addressing Mode enum values
 
-using SamplerAddressingModeTest = test_fixture::TextToBinaryTestBase<
+using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<EnumCase<spv::SamplerAddressingMode>>>;
 
 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<EnumCase<spv::SamplerFilterMode>>>;
 
 TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
index 06d817e..946cb0e 100755 (executable)
@@ -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<EnumCase<spv::SelectionControlMask>>>;
 
 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<EnumCase<spv::LoopControlMask>>>;
 
 TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
index 35f7262..ba1a9c5 100755 (executable)
@@ -67,7 +67,7 @@ const LanguageCase kLanguageCases[] = {
 // clang-format on
 
 using OpSourceTest =
-    test_fixture::TextToBinaryTestBase<::testing::TestWithParam<LanguageCase>>;
+    spvtest::TextToBinaryTestBase<::testing::TestWithParam<LanguageCase>>;
 
 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<const char*>>;
+    spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
 
 TEST_P(OpSourceExtensionTest, AnyExtension) {
   // TODO(dneto): utf-8, quoting, escaping
index 39e8a1c..382001a 100755 (executable)
 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<EnumCase<spv::FunctionControlMask>>>;
 
 TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
index dc0d214..68d326c 100755 (executable)
@@ -39,7 +39,7 @@ using ::testing::Eq;
 
 // Test GroupOperation enum
 
-using GroupOperationTest = test_fixture::TextToBinaryTestBase<
+using GroupOperationTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<EnumCase<spv::GroupOperation>>>;
 
 TEST_P(GroupOperationTest, AnyGroupOperation) {
index 1854662..b6ecdfc 100644 (file)
@@ -46,7 +46,7 @@ struct ImageOperandsCase {
 
 // Test all kinds of image operands.
 
-using ImageOperandsTest = test_fixture::TextToBinaryTestBase<
+using ImageOperandsTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<ImageOperandsCase>>;
 
 TEST_P(ImageOperandsTest, Sample) {
index bff4c72..c95f879 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace {
 
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
 
 TEST_F(TextToBinaryTest, LiteralStringInPlaceOfLiteralNumber) {
   EXPECT_EQ(
index dbb4725..41ed3a3 100755 (executable)
@@ -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 <typename E>
@@ -51,7 +51,7 @@ struct EnumCaseWithOperands {
 
 // Test assembly of Memory Access masks
 
-using MemoryAccessTest = test_fixture::TextToBinaryTestBase<
+using MemoryAccessTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<EnumCaseWithOperands<spv::MemoryAccessMask>>>;
 
 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<EnumCaseWithOperands<spv::StorageClass>>>;
 
 TEST_P(StorageClassTest, AnyStorageClass) {
index b08813e..5125ebe 100644 (file)
 
 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, {})));
index 2bad4c5..53799cf 100755 (executable)
@@ -54,7 +54,7 @@ struct MemoryModelCase {
   std::string memory_name;
 };
 
-using OpMemoryModelTest = test_fixture::TextToBinaryTestBase<
+using OpMemoryModelTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<MemoryModelCase>>;
 
 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<EntryPointCase>>;
 
 TEST_P(OpEntryPointTest, AnyEntryPointCase) {
@@ -140,7 +140,7 @@ struct ExecutionModeCase {
   std::vector<uint32_t> operands;
 };
 
-using OpExecutionModeTest = test_fixture::TextToBinaryTestBase<
+using OpExecutionModeTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<ExecutionModeCase>>;
 
 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<EnumCase<spv::Capability>>>;
 
 TEST_P(OpCapabilityTest, AnyCapability) {
index 9648218..909058b 100755 (executable)
@@ -39,7 +39,7 @@ using ::testing::Eq;
 
 // Test Dim enums via OpTypeImage
 
-using DimTest = test_fixture::TextToBinaryTestBase<
+using DimTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<EnumCase<spv::Dim>>>;
 
 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<EnumCase<spv::ImageFormat>>>;
 
 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<EnumCase<spv::AccessQualifier>>>;
 
 TEST_P(OpTypePipeTest, AnyAccessQualifier) {
index 61ab12e..c1446a6 100755 (executable)
@@ -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<std::pair<std::string, uint32_t>>>;
 
 TEST_P(TextToBinaryFloatValueTest, NormalValues) {