diff --git a/native/tests/unit-test/src/scheduler_test.cpp b/native/tests/unit-test/src/scheduler_test.cpp index 769cbacb9e2..d791a221449 100644 --- a/native/tests/unit-test/src/scheduler_test.cpp +++ b/native/tests/unit-test/src/scheduler_test.cpp @@ -31,7 +31,7 @@ using namespace cc; TEST(schedulerTest, performInCocosThreadOrder) { - auto scheduler = std::make_shared(); + auto *scheduler = new Scheduler(); std::vector orderResult; @@ -62,5 +62,8 @@ TEST(schedulerTest, performInCocosThreadOrder) { scheduler->runFunctionsToBePerformedInCocosThread(); const std::vector expectedResult{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; - EXPECT_EQ(orderResult, expectedResult); + EXPECT_TRUE(orderResult == expectedResult); + + delete scheduler; + scheduler = nullptr; }