Skip to content

Commit bf29bd6

Browse files
authored
[executorch] Migrate runtime/platform tests to new namespace
Differential Revision: D60428953 Pull Request resolved: #4606
1 parent 9b0b8e7 commit bf29bd6

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

runtime/platform/test/clock_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ TEST(ClockTest, ConvertTicksToNsSanity) {
2828
InterceptWith iw(spy);
2929

3030
spy.tick_ns_multiplier = {3, 2};
31-
auto ns = torch::executor::ticks_to_ns(10);
31+
auto ns = executorch::runtime::ticks_to_ns(10);
3232
ASSERT_EQ(15, ns); // 10 ticks * 3/2 = 15 ns
3333

3434
spy.tick_ns_multiplier = {2, 7};
35-
ns = torch::executor::ticks_to_ns(14);
35+
ns = executorch::runtime::ticks_to_ns(14);
3636
ASSERT_EQ(4, ns); // 14 ticks * 2/7 = 4 ns
3737
}

runtime/platform/test/executor_pal_override_test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <gtest/gtest.h>
1515

1616
using namespace ::testing;
17-
using torch::executor::LogLevel;
17+
using executorch::runtime::LogLevel;
1818

1919
class PalSpy : public PlatformIntercept {
2020
public:
@@ -75,15 +75,16 @@ class PalSpy : public PlatformIntercept {
7575
// Demonstrate what would happen if we didn't intercept the PAL calls.
7676
TEST(ExecutorPalOverrideTest, DiesIfNotIntercepted) {
7777
ET_EXPECT_DEATH(
78-
torch::executor::runtime_init(), "et_pal_init call was not intercepted");
78+
executorch::runtime::runtime_init(),
79+
"et_pal_init call was not intercepted");
7980
}
8081

8182
TEST(ExecutorPalOverrideTest, InitIsRegistered) {
8283
PalSpy spy;
8384
InterceptWith iw(spy);
8485

8586
EXPECT_EQ(spy.init_call_count, 0);
86-
torch::executor::runtime_init();
87+
executorch::runtime::runtime_init();
8788
EXPECT_EQ(spy.init_call_count, 1);
8889
}
8990

runtime/platform/test/logging_test.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include <executorch/runtime/platform/log.h>
1212
#include <executorch/runtime/platform/runtime.h>
1313

14-
namespace torch {
15-
namespace executor {
14+
using namespace executorch::runtime;
1615

1716
class LoggingTest : public ::testing::Test {
1817
public:
@@ -32,6 +31,3 @@ TEST_F(LoggingTest, LogLevels) {
3231
TEST_F(LoggingTest, LogFormatting) {
3332
ET_LOG(Info, "Sample log with integer: %u", 100);
3433
}
35-
36-
} // namespace executor
37-
} // namespace torch

0 commit comments

Comments
 (0)