From 54b936367df0b8300fbdf9b1e7c608e3c3f69b38 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Tue, 3 Feb 2026 09:31:34 +0800 Subject: [PATCH] [test] conditionally test RCP restoration (#12339) This commit makes the `shouldNotDuplicateSrcMatchEntriesOnRestoreProperties` test conditional, because RCP restoration is not always enabled. --- tests/gtest/radio_spinel_rcp_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/gtest/radio_spinel_rcp_test.cpp b/tests/gtest/radio_spinel_rcp_test.cpp index 9370c1072..272be46ea 100644 --- a/tests/gtest/radio_spinel_rcp_test.cpp +++ b/tests/gtest/radio_spinel_rcp_test.cpp @@ -32,7 +32,7 @@ #include #include "common/error.hpp" -#include "gmock/gmock.h" +#include "lib/spinel/openthread-spinel-config.h" #include "mac/mac_frame.hpp" #include "mac/mac_types.hpp" @@ -491,6 +491,7 @@ TEST(RadioSpinelSrcMatch, shouldBeAbleToClearAllRadioSrcMatchExtEntres) ASSERT_EQ(platform.SrcMatchCountExtEntries(), 0); } +#if OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0 TEST(RadioSpinelSrcMatch, shouldNotDuplicateSrcMatchEntriesOnRestoreProperties) { constexpr uint16_t kTestShortAddr = 0x1234; @@ -518,3 +519,4 @@ TEST(RadioSpinelSrcMatch, shouldNotDuplicateSrcMatchEntriesOnRestoreProperties) ASSERT_EQ(platform.SrcMatchHasShortEntry(kTestShortAddr), 1); ASSERT_EQ(platform.SrcMatchHasExtEntry(kTestExtAddrReversed), 1); } +#endif // OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0