aboutsummaryrefslogtreecommitdiff
path: root/test/opt/eliminate_dead_functions_test.cpp
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2018-07-11 09:24:49 -0400
committerGitHub <noreply@github.com>2018-07-11 09:24:49 -0400
commit2cce2c5b97a9a4a253e626322e33bab9d8eb00c1 (patch)
tree0da7c8b0933968ce17c4471a7b8bb4d50119598e /test/opt/eliminate_dead_functions_test.cpp
parent7d6c90c9129c7cae8e3ac0ecf2bea278d99fd653 (diff)
downloadspirv-tools-2cce2c5b97a9a4a253e626322e33bab9d8eb00c1.tar.gz
Move tests into namespaces (#1689)
This CL moves the test into namespaces based on their directories.
Diffstat (limited to 'test/opt/eliminate_dead_functions_test.cpp')
-rw-r--r--test/opt/eliminate_dead_functions_test.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/opt/eliminate_dead_functions_test.cpp b/test/opt/eliminate_dead_functions_test.cpp
index c780717d..b49b41b0 100644
--- a/test/opt/eliminate_dead_functions_test.cpp
+++ b/test/opt/eliminate_dead_functions_test.cpp
@@ -20,11 +20,11 @@
#include "pass_fixture.h"
#include "pass_utils.h"
+namespace spvtools {
+namespace opt {
namespace {
-using namespace spvtools;
using ::testing::HasSubstr;
-
using EliminateDeadFunctionsBasicTest = PassTest<::testing::Test>;
TEST_F(EliminateDeadFunctionsBasicTest, BasicDeleteDeadFunction) {
@@ -61,7 +61,7 @@ TEST_F(EliminateDeadFunctionsBasicTest, BasicDeleteDeadFunction) {
};
SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndCheck<opt::EliminateDeadFunctionsPass>(
+ SinglePassRunAndCheck<EliminateDeadFunctionsPass>(
JoinAllInsts(Concat(common_code, dead_function)),
JoinAllInsts(common_code), /* skip_nop = */ true);
}
@@ -98,9 +98,9 @@ TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepLiveFunction) {
SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
std::string assembly = JoinAllInsts(text);
- auto result = SinglePassRunAndDisassemble<opt::EliminateDeadFunctionsPass>(
+ auto result = SinglePassRunAndDisassemble<EliminateDeadFunctionsPass>(
assembly, /* skip_nop = */ true, /* do_validation = */ false);
- EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result));
+ EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
EXPECT_EQ(assembly, std::get<0>(result));
}
@@ -137,9 +137,9 @@ TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepExportFunctions) {
SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
std::string assembly = JoinAllInsts(text);
- auto result = SinglePassRunAndDisassemble<opt::EliminateDeadFunctionsPass>(
+ auto result = SinglePassRunAndDisassemble<EliminateDeadFunctionsPass>(
assembly, /* skip_nop = */ true, /* do_validation = */ false);
- EXPECT_EQ(opt::Pass::Status::SuccessWithoutChange, std::get<1>(result));
+ EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
EXPECT_EQ(assembly, std::get<0>(result));
}
@@ -200,7 +200,10 @@ OpFunctionEnd
)";
SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndCheck<opt::EliminateDeadFunctionsPass>(text, expected_output,
- /* skip_nop = */ true);
+ SinglePassRunAndCheck<EliminateDeadFunctionsPass>(text, expected_output,
+ /* skip_nop = */ true);
}
-} // anonymous namespace
+
+} // namespace
+} // namespace opt
+} // namespace spvtools