diff options
author | dan sinclair <dj2@everburning.com> | 2018-07-07 09:38:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-07 09:38:00 -0400 |
commit | 3dad1cda1168b56e5326305b395c25afa06feff2 (patch) | |
tree | 5b51a44170f0a4a1992de292ed5afea9b4bb4a3b /test | |
parent | 76e0bde19633fc8c45f7de52029e3d517b2e1561 (diff) |
Change libspirv to spvtools namespace (#1678)
This CL changes all of the libspirv namespace code to spvtools to match
the rest of the code base.
Diffstat (limited to 'test')
25 files changed, 97 insertions, 91 deletions
diff --git a/test/assembly_context_test.cpp b/test/assembly_context_test.cpp index 65a40aad..030d5ea5 100644 --- a/test/assembly_context_test.cpp +++ b/test/assembly_context_test.cpp @@ -19,7 +19,7 @@ #include "source/instruction.h" -using libspirv::AssemblyContext; +using spvtools::AssemblyContext; using spvtest::AutoText; using spvtest::Concatenate; using ::testing::Eq; diff --git a/test/binary_parse_test.cpp b/test/binary_parse_test.cpp index f3b9d80f..fab89377 100644 --- a/test/binary_parse_test.cpp +++ b/test/binary_parse_test.cpp @@ -33,9 +33,9 @@ static bool operator==(const spv_parsed_operand_t& a, a.number_bit_width == b.number_bit_width; } +namespace spvtools { namespace { -using ::libspirv::SetContextMessageConsumer; using ::spvtest::Concatenate; using ::spvtest::MakeInstruction; using ::spvtest::MakeVector; @@ -895,4 +895,5 @@ INSTANTIATE_TEST_CASE_P( "Invalid selection control operand: 7 has invalid mask component 4"}, }), ); -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/c_interface_test.cpp b/test/c_interface_test.cpp index 8ec44771..77844052 100644 --- a/test/c_interface_test.cpp +++ b/test/c_interface_test.cpp @@ -18,15 +18,13 @@ #include "spirv-tools/libspirv.h" #include "table.h" +namespace spvtools { namespace { -using namespace spvtools; - // TODO(antiagainst): Use public C API for setting the consumer once exists. #ifndef SPIRV_TOOLS_SHAREDLIB -void SetContextMessageConsumer(spv_context context, - spvtools::MessageConsumer consumer) { - libspirv::SetContextMessageConsumer(context, consumer); +void SetContextMessageConsumer(spv_context context, MessageConsumer consumer) { + spvtools::SetContextMessageConsumer(context, consumer); } #else void SetContextMessageConsumer(spv_context, spvtools::MessageConsumer) {} @@ -299,4 +297,5 @@ TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForValidating) { spvContextDestroy(context); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/comp/markv_codec_test.cpp b/test/comp/markv_codec_test.cpp index 2688fbb2..2502e329 100644 --- a/test/comp/markv_codec_test.cpp +++ b/test/comp/markv_codec_test.cpp @@ -28,7 +28,6 @@ namespace spvtools { namespace comp { namespace { -using libspirv::SetContextMessageConsumer; using spvtest::ScopedContext; using MarkvTest = ::testing::TestWithParam<MarkvModelType>; diff --git a/test/diagnostic_test.cpp b/test/diagnostic_test.cpp index 3861b20a..60f5cbef 100644 --- a/test/diagnostic_test.cpp +++ b/test/diagnostic_test.cpp @@ -18,9 +18,9 @@ #include "gmock/gmock.h" #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::DiagnosticStream; using ::testing::Eq; // Returns a newly created diagnostic value. @@ -134,7 +134,7 @@ TEST(DiagnosticStream, DiagnosticFromLambdaReturnCanStillBeUsed) { }; { - auto emitter = [&consumer]() -> libspirv::DiagnosticStream { + auto emitter = [&consumer]() -> DiagnosticStream { DiagnosticStream ds0({}, consumer, "", SPV_ERROR_INVALID_BINARY); ds0 << "First"; return ds0; @@ -145,4 +145,5 @@ TEST(DiagnosticStream, DiagnosticFromLambdaReturnCanStillBeUsed) { EXPECT_THAT(messages.str(), Eq("FirstSecond")); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/enum_set_test.cpp b/test/enum_set_test.cpp index 81671e63..f4b2467e 100644 --- a/test/enum_set_test.cpp +++ b/test/enum_set_test.cpp @@ -18,10 +18,9 @@ #include "enum_set.h" #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::CapabilitySet; -using libspirv::EnumSet; using spvtest::ElementsIn; using ::testing::Eq; using ::testing::ValuesIn; @@ -285,4 +284,5 @@ INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest, static_cast<SpvCapability>(0x7fffffff)}}, }), ); -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/enum_string_mapping_test.cpp b/test/enum_string_mapping_test.cpp index ade61cb3..94080bd7 100644 --- a/test/enum_string_mapping_test.cpp +++ b/test/enum_string_mapping_test.cpp @@ -20,10 +20,9 @@ #include "extensions.h" #include "gtest/gtest.h" +namespace spvtools { namespace { -using ::libspirv::Extension; - using ::testing::Values; using ::testing::ValuesIn; @@ -38,8 +37,7 @@ TEST_P(ExtensionTest, TestExtensionFromString) { const Extension extension = param.first; const std::string extension_str = param.second; Extension result_extension; - ASSERT_TRUE(libspirv::GetExtensionFromString(extension_str.c_str(), - &result_extension)); + ASSERT_TRUE(GetExtensionFromString(extension_str.c_str(), &result_extension)); EXPECT_EQ(extension, result_extension); } @@ -47,21 +45,20 @@ TEST_P(ExtensionTest, TestExtensionToString) { const std::pair<Extension, std::string>& param = GetParam(); const Extension extension = param.first; const std::string extension_str = param.second; - const std::string result_str = libspirv::ExtensionToString(extension); + const std::string result_str = ExtensionToString(extension); EXPECT_EQ(extension_str, result_str); } TEST_P(UnknownExtensionTest, TestExtensionFromStringFails) { Extension result_extension; - ASSERT_FALSE( - libspirv::GetExtensionFromString(GetParam().c_str(), &result_extension)); + ASSERT_FALSE(GetExtensionFromString(GetParam().c_str(), &result_extension)); } TEST_P(CapabilityTest, TestCapabilityToString) { const std::pair<SpvCapability, std::string>& param = GetParam(); const SpvCapability capability = param.first; const std::string capability_str = param.second; - const std::string result_str = libspirv::CapabilityToString(capability); + const std::string result_str = CapabilityToString(capability); EXPECT_EQ(capability_str, result_str); } @@ -192,4 +189,5 @@ INSTANTIATE_TEST_CASE_P( {SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"}, {SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})), ); -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/name_mapper_test.cpp b/test/name_mapper_test.cpp index d2a5f4e4..1cce8bc5 100644 --- a/test/name_mapper_test.cpp +++ b/test/name_mapper_test.cpp @@ -19,15 +19,14 @@ #include "source/name_mapper.h" -using libspirv::FriendlyNameMapper; -using libspirv::NameMapper; using spvtest::ScopedContext; using ::testing::Eq; +namespace spvtools { namespace { TEST(TrivialNameTest, Samples) { - auto mapper = libspirv::GetTrivialNameMapper(); + auto mapper = GetTrivialNameMapper(); EXPECT_EQ(mapper(1), "1"); EXPECT_EQ(mapper(1999), "1999"); EXPECT_EQ(mapper(1024), "1024"); @@ -343,4 +342,5 @@ INSTANTIATE_TEST_CASE_P( {"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"}, }), ); -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/opcode_require_capabilities_test.cpp b/test/opcode_require_capabilities_test.cpp index 2aa1b86e..6a537823 100644 --- a/test/opcode_require_capabilities_test.cpp +++ b/test/opcode_require_capabilities_test.cpp @@ -16,9 +16,9 @@ #include "enum_set.h" +namespace spvtools { namespace { -using libspirv::CapabilitySet; using spvtest::ElementsIn; // Capabilities required by an Opcode. @@ -74,4 +74,5 @@ INSTANTIATE_TEST_CASE_P( SpvOpGetKernelMaxNumSubgroups, CapabilitySet{SpvCapabilitySubgroupDispatch}}), ); -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/operand_capabilities_test.cpp b/test/operand_capabilities_test.cpp index bb1bac35..49934cfb 100644 --- a/test/operand_capabilities_test.cpp +++ b/test/operand_capabilities_test.cpp @@ -21,9 +21,9 @@ #include "enum_set.h" #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::CapabilitySet; using spvtest::ElementsIn; using std::get; using std::tuple; @@ -47,7 +47,7 @@ using EnumCapabilityTest = TEST_P(EnumCapabilityTest, Sample) { const auto env = get<0>(GetParam()); const auto context = spvContextCreate(env); - const libspirv::AssemblyGrammar grammar(context); + const AssemblyGrammar grammar(context); spv_operand_desc entry; ASSERT_EQ(SPV_SUCCESS, @@ -730,4 +730,5 @@ INSTANTIATE_TEST_CASE_P( #undef CASE1 #undef CASE2 -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/opt/feature_manager_test.cpp b/test/opt/feature_manager_test.cpp index f67388a8..b87e63d2 100644 --- a/test/opt/feature_manager_test.cpp +++ b/test/opt/feature_manager_test.cpp @@ -19,7 +19,7 @@ #include "opt/build_module.h" #include "opt/ir_context.h" -using namespace spvtools; +namespace spvtools { using FeatureManagerTest = ::testing::Test; @@ -34,7 +34,7 @@ OpMemoryModel Logical GLSL450 ASSERT_NE(context, nullptr); EXPECT_FALSE(context->get_feature_mgr()->HasExtension( - libspirv::Extension::kSPV_KHR_variable_pointers)); + Extension::kSPV_KHR_variable_pointers)); } TEST_F(FeatureManagerTest, OneExtension) { @@ -49,7 +49,7 @@ OpExtension "SPV_KHR_variable_pointers" ASSERT_NE(context, nullptr); EXPECT_TRUE(context->get_feature_mgr()->HasExtension( - libspirv::Extension::kSPV_KHR_variable_pointers)); + Extension::kSPV_KHR_variable_pointers)); } TEST_F(FeatureManagerTest, NotADifferentExtension) { @@ -64,7 +64,7 @@ OpExtension "SPV_KHR_variable_pointers" ASSERT_NE(context, nullptr); EXPECT_FALSE(context->get_feature_mgr()->HasExtension( - libspirv::Extension::kSPV_KHR_storage_buffer_storage_class)); + Extension::kSPV_KHR_storage_buffer_storage_class)); } TEST_F(FeatureManagerTest, TwoExtensions) { @@ -80,9 +80,9 @@ OpExtension "SPV_KHR_storage_buffer_storage_class" ASSERT_NE(context, nullptr); EXPECT_TRUE(context->get_feature_mgr()->HasExtension( - libspirv::Extension::kSPV_KHR_variable_pointers)); + Extension::kSPV_KHR_variable_pointers)); EXPECT_TRUE(context->get_feature_mgr()->HasExtension( - libspirv::Extension::kSPV_KHR_storage_buffer_storage_class)); + Extension::kSPV_KHR_storage_buffer_storage_class)); } // Test capability checks. @@ -132,3 +132,5 @@ OpMemoryModel Logical GLSL450 EXPECT_TRUE(context->get_feature_mgr()->HasCapability(SpvCapabilityMatrix)); EXPECT_FALSE(context->get_feature_mgr()->HasCapability(SpvCapabilityKernel)); } + +} // namespace spvtools diff --git a/test/stats/stats_aggregate_test.cpp b/test/stats/stats_aggregate_test.cpp index 11c71aa6..7071f5a3 100644 --- a/test/stats/stats_aggregate_test.cpp +++ b/test/stats/stats_aggregate_test.cpp @@ -20,10 +20,9 @@ #include "test_fixture.h" #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::SetContextMessageConsumer; -using libspirv::SpirvStats; using spvtest::ScopedContext; void DiagnosticsMessageHandler(spv_message_level_t level, const char*, @@ -47,7 +46,7 @@ void DiagnosticsMessageHandler(spv_message_level_t level, const char*, } } -// Calls libspirv::AggregateStats for binary compiled from |code|. +// Calls AggregateStats for binary compiled from |code|. void CompileAndAggregateStats(const std::string& code, SpirvStats* stats, spv_target_env env = SPV_ENV_UNIVERSAL_1_1) { ScopedContext ctx(env); @@ -482,3 +481,4 @@ OpMemoryModel Logical GLSL450 } } // namespace +} // namespace spvtools diff --git a/test/stats/stats_analyzer_test.cpp b/test/stats/stats_analyzer_test.cpp index 9608af8d..7d5f2f9c 100644 --- a/test/stats/stats_analyzer_test.cpp +++ b/test/stats/stats_analyzer_test.cpp @@ -21,10 +21,9 @@ #include "test_fixture.h" #include "tools/stats/stats_analyzer.h" +namespace spvtools { namespace { -using libspirv::SpirvStats; - // Fills |stats| with some synthetic header stats, as if aggregated from 100 // modules (100 used for simpler percentage evaluation). void FillDefaultStats(SpirvStats* stats) { @@ -170,3 +169,4 @@ TEST(StatsAnalyzer, OpcodeMarkov) { } } // namespace +} // namespace spvtools diff --git a/test/text_advance_test.cpp b/test/text_advance_test.cpp index ffc8dbb2..ebbe2157 100644 --- a/test/text_advance_test.cpp +++ b/test/text_advance_test.cpp @@ -14,9 +14,9 @@ #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::AssemblyContext; using spvtest::AutoText; TEST(TextAdvance, LeadingNewLines) { @@ -128,4 +128,5 @@ TEST(TextAdvance, SkipOverCRLFs) { EXPECT_EQ(2u, pos.line); EXPECT_EQ(4u, pos.index); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/text_literal_test.cpp b/test/text_literal_test.cpp index dc75a8e1..56d44883 100644 --- a/test/text_literal_test.cpp +++ b/test/text_literal_test.cpp @@ -21,6 +21,8 @@ #include <string> using ::testing::Eq; + +namespace spvtools { namespace { TEST(TextLiteral, GoodI32) { @@ -166,31 +168,30 @@ using IntegerTest = spvtest::TextToBinaryTestBase<::testing::TestWithParam<TextLiteralCase>>; std::vector<uint32_t> successfulEncode(const TextLiteralCase& test, - libspirv::IdTypeClass type) { + IdTypeClass type) { spv_instruction_t inst; std::string message; auto capture_message = [&message](spv_message_level_t, const char*, const spv_position_t&, const char* m) { message = m; }; - libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; + IdType expected_type{test.bitwidth, test.is_signed, type}; EXPECT_EQ(SPV_SUCCESS, - libspirv::AssemblyContext(nullptr, capture_message) + AssemblyContext(nullptr, capture_message) .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, expected_type, &inst)) << message; return inst.words; } -std::string failedEncode(const TextLiteralCase& test, - libspirv::IdTypeClass type) { +std::string failedEncode(const TextLiteralCase& test, IdTypeClass type) { spv_instruction_t inst; std::string message; auto capture_message = [&message](spv_message_level_t, const char*, const spv_position_t&, const char* m) { message = m; }; - libspirv::IdType expected_type{test.bitwidth, test.is_signed, type}; + IdType expected_type{test.bitwidth, test.is_signed, type}; EXPECT_EQ(SPV_ERROR_INVALID_TEXT, - libspirv::AssemblyContext(nullptr, capture_message) + AssemblyContext(nullptr, capture_message) .binaryEncodeNumericLiteral(test.text, SPV_ERROR_INVALID_TEXT, expected_type, &inst)); return message; @@ -198,17 +199,15 @@ std::string failedEncode(const TextLiteralCase& test, TEST_P(IntegerTest, IntegerBounds) { if (GetParam().success) { - EXPECT_THAT( - successfulEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq(GetParam().expected_values)); + EXPECT_THAT(successfulEncode(GetParam(), IdTypeClass::kScalarIntegerType), + Eq(GetParam().expected_values)); } else { std::stringstream ss; ss << "Integer " << GetParam().text << " does not fit in a " << GetParam().bitwidth << "-bit " << (GetParam().is_signed ? "signed" : "unsigned") << " integer"; - EXPECT_THAT( - failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq(ss.str())); + EXPECT_THAT(failedEncode(GetParam(), IdTypeClass::kScalarIntegerType), + Eq(ss.str())); } } @@ -286,9 +285,8 @@ using IntegerLeadingMinusTest = TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) { EXPECT_FALSE(GetParam().success); - EXPECT_THAT( - failedEncode(GetParam(), libspirv::IdTypeClass::kScalarIntegerType), - Eq("Cannot put a negative number in an unsigned literal")); + EXPECT_THAT(failedEncode(GetParam(), IdTypeClass::kScalarIntegerType), + Eq("Cannot put a negative number in an unsigned literal")); } // clang-format off @@ -380,14 +378,14 @@ TEST(OverflowIntegerParse, Decimal) { std::string expected_message0 = "Invalid signed integer literal: " + signed_input; EXPECT_THAT(failedEncode(Make_Bad_Signed(64, signed_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), + IdTypeClass::kScalarIntegerType), Eq(expected_message0)); std::string unsigned_input = "18446744073709551616"; std::string expected_message1 = "Invalid unsigned integer literal: " + unsigned_input; EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, unsigned_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), + IdTypeClass::kScalarIntegerType), Eq(expected_message1)); // TODO(dneto): When the given number doesn't have a leading sign, @@ -395,7 +393,7 @@ TEST(OverflowIntegerParse, Decimal) { // asked for a signed number. This is kind of weird, but it's an // artefact of how we do the parsing. EXPECT_THAT(failedEncode(Make_Bad_Signed(64, unsigned_input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), + IdTypeClass::kScalarIntegerType), Eq(expected_message1)); } @@ -403,11 +401,12 @@ TEST(OverflowIntegerParse, Hex) { std::string input = "0x10000000000000000"; std::string expected_message = "Invalid unsigned integer literal: " + input; EXPECT_THAT(failedEncode(Make_Bad_Signed(64, input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), + IdTypeClass::kScalarIntegerType), Eq(expected_message)); EXPECT_THAT(failedEncode(Make_Bad_Unsigned(64, input.c_str()), - libspirv::IdTypeClass::kScalarIntegerType), + IdTypeClass::kScalarIntegerType), Eq(expected_message)); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/text_start_new_inst_test.cpp b/test/text_start_new_inst_test.cpp index 6c3e5541..75615677 100644 --- a/test/text_start_new_inst_test.cpp +++ b/test/text_start_new_inst_test.cpp @@ -16,9 +16,9 @@ #include <string> +namespace spvtools { namespace { -using libspirv::AssemblyContext; using spvtest::AutoText; TEST(TextStartsWithOp, YesAtStart) { @@ -71,4 +71,5 @@ TEST(TextStartsWithOp, NoForNearlyValueGeneration) { EXPECT_FALSE(AssemblyContext(AutoText("%foo"), nullptr).isStartOfNewInst()); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/text_to_binary_test.cpp b/test/text_to_binary_test.cpp index e9a709b6..4c2ad586 100644 --- a/test/text_to_binary_test.cpp +++ b/test/text_to_binary_test.cpp @@ -25,10 +25,9 @@ #include "test_fixture.h" #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::AssemblyContext; -using libspirv::AssemblyGrammar; using spvtest::AutoText; using spvtest::Concatenate; using spvtest::MakeInstruction; @@ -266,4 +265,5 @@ TEST(CreateContext, VulkanEnvironment) { spvContextDestroy(c); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/text_word_get_test.cpp b/test/text_word_get_test.cpp index dccc7133..54e84932 100644 --- a/test/text_word_get_test.cpp +++ b/test/text_word_get_test.cpp @@ -14,9 +14,9 @@ #include "unit_spirv.h" +namespace spvtools { namespace { -using libspirv::AssemblyContext; using spvtest::AutoText; #define TAB "\t" @@ -248,4 +248,5 @@ TEST(TextWordGet, CRLF) { EXPECT_STREQ("d", word.c_str()); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/unit_spirv.h b/test/unit_spirv.h index e65927b7..b37a35d4 100644 --- a/test/unit_spirv.h +++ b/test/unit_spirv.h @@ -224,7 +224,7 @@ inline std::vector<spv_target_env> AllTargetEnvironments() { // Returns the capabilities in a CapabilitySet as an ordered vector. inline std::vector<SpvCapability> ElementsIn( - const libspirv::CapabilitySet& capabilities) { + const spvtools::CapabilitySet& capabilities) { std::vector<SpvCapability> result; capabilities.ForEach([&result](SpvCapability c) { result.push_back(c); }); return result; diff --git a/test/val/val_cfg_test.cpp b/test/val/val_cfg_test.cpp index 69df2e67..8aa3066f 100644 --- a/test/val/val_cfg_test.cpp +++ b/test/val/val_cfg_test.cpp @@ -40,12 +40,10 @@ using std::vector; using ::testing::HasSubstr; using ::testing::MatchesRegex; -using libspirv::BasicBlock; -using libspirv::ValidationState_t; - using ValidateCFG = spvtest::ValidateBase<SpvCapability>; using spvtest::ScopedContext; +namespace spvtools { namespace { string nameOps() { return ""; } @@ -1822,4 +1820,6 @@ OpFunctionEnd } /// TODO(umar): Nested CFG constructs + } // namespace +} // namespace spvtools diff --git a/test/val/val_decoration_test.cpp b/test/val/val_decoration_test.cpp index eaeb5184..e819d19d 100644 --- a/test/val/val_decoration_test.cpp +++ b/test/val/val_decoration_test.cpp @@ -19,9 +19,9 @@ #include "unit_spirv.h" #include "val_fixtures.h" +namespace spvtools { namespace { -using libspirv::Decoration; using std::string; using std::vector; using ::testing::Eq; @@ -2663,4 +2663,5 @@ TEST_F(ValidateDecorations, UniformBufferArraySizeCalculationPackBad) { "offset 60 overlaps previous member ending at offset 63")); } -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/val/val_extensions_test.cpp b/test/val/val_extensions_test.cpp index d5ecacda..5675308a 100644 --- a/test/val/val_extensions_test.cpp +++ b/test/val/val_extensions_test.cpp @@ -24,10 +24,9 @@ #include "unit_spirv.h" #include "val_fixtures.h" +namespace spvtools { namespace { -using ::libspirv::Extension; - using ::testing::HasSubstr; using ::testing::Not; using ::testing::Values; @@ -316,4 +315,5 @@ INSTANTIATE_TEST_CASE_P( })); // clang-format on -} // anonymous namespace +} // namespace +} // namespace spvtools diff --git a/test/val/val_fixtures.h b/test/val/val_fixtures.h index 9d98467b..1615bbeb 100644 --- a/test/val/val_fixtures.h +++ b/test/val/val_fixtures.h @@ -60,7 +60,7 @@ class ValidateBase : public ::testing::Test, spv_binary binary_; spv_diagnostic diagnostic_; spv_validator_options options_; - std::unique_ptr<libspirv::ValidationState_t> vstate_; + std::unique_ptr<spvtools::ValidationState_t> vstate_; }; template <typename T> diff --git a/test/val/val_layout_test.cpp b/test/val/val_layout_test.cpp index 092f5695..5806f426 100644 --- a/test/val/val_layout_test.cpp +++ b/test/val/val_layout_test.cpp @@ -34,7 +34,6 @@ using std::tie; using std::tuple; using std::vector; -using libspirv::spvResultToString; using ::testing::Eq; using ::testing::HasSubstr; using ::testing::StrEq; @@ -43,6 +42,7 @@ using pred_type = function<spv_result_t(int)>; using ValidateLayout = spvtest::ValidateBase<tuple<int, tuple<string, pred_type, pred_type>>>; +namespace spvtools { namespace { // returns true if order is equal to VAL @@ -640,3 +640,4 @@ TEST_F(ValidateLayout, ModuleProcessedInvalidInBasicBlock) { // TODO(umar): Test optional instructions } // namespace +} // namespace spvtools diff --git a/test/val/val_state_test.cpp b/test/val/val_state_test.cpp index 56020477..d9d7a072 100644 --- a/test/val/val_state_test.cpp +++ b/test/val/val_state_test.cpp @@ -28,11 +28,9 @@ #include "val/validation_state.h" #include "validate.h" +namespace spvtools { namespace { -using libspirv::CapabilitySet; -using libspirv::Extension; -using libspirv::ExtensionSet; -using libspirv::ValidationState_t; + using std::vector; // This is all we need for these tests. @@ -136,4 +134,6 @@ TEST_F(ValidationState_HasAnyOfExtensions, MultiCapMask) { EXPECT_TRUE(state_.HasAnyOfExtensions(set1)); EXPECT_FALSE(state_.HasAnyOfExtensions(set2)); } + } // namespace +} // namespace spvtools |