From 63fdd1d7e95f32d9162c60a3669d1699fe810db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 18 Oct 2023 11:00:24 -0700 Subject: [PATCH] Fix RuntimeScheduler tests on iOS (#41063) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41063 Some tests for RuntimeScheduler broke because we used uninitialized values incorrectly (they're initialized with 0 on Android but with something like `0101010101...` on iOS). This fixes the tests by assigning the right initial value. Changelog: [internal] Reviewed By: sammy-SC Differential Revision: D50413220 fbshipit-source-id: e1fc223e795e2ae01d6e3ba3bc32bd052c8fc2f3 --- .../renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index 749d4e77a78dd5..b279a425b81459 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -170,7 +170,7 @@ TEST_P(RuntimeSchedulerTest, scheduleTwoTasksWithSamePriority) { runtimeScheduler_->scheduleTask( SchedulerPriority::NormalPriority, std::move(callbackOne)); - uint secondTaskCallOrder; + uint secondTaskCallOrder = 0; auto callbackTwo = createHostFunctionFromLambda( [this, &secondTaskCallOrder](bool /*unused*/) { secondTaskCallOrder = hostFunctionCallCount_; @@ -203,7 +203,7 @@ TEST_P(RuntimeSchedulerTest, scheduleTwoTasksWithDifferentPriorities) { runtimeScheduler_->scheduleTask( SchedulerPriority::LowPriority, std::move(callbackOne)); - uint userBlockingPriorityTaskCallOrder; + uint userBlockingPriorityTaskCallOrder = 0; auto callbackTwo = createHostFunctionFromLambda( [this, &userBlockingPriorityTaskCallOrder](bool /*unused*/) { userBlockingPriorityTaskCallOrder = hostFunctionCallCount_;