From 630b2decfa6a4913ada49886e63f91dfb6543d44 Mon Sep 17 00:00:00 2001 From: Joo-Chul Kevin Lee Date: Fri, 26 Jan 2024 16:06:08 +0900 Subject: [PATCH] merge_bridging : fix unittest issues --- api/oc_core_res.c | 3 ++- api/unittest/coreresourcetest.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/oc_core_res.c b/api/oc_core_res.c index 71bb3645c..0fe70adeb 100644 --- a/api/oc_core_res.c +++ b/api/oc_core_res.c @@ -467,7 +467,8 @@ oc_core_add_new_device_at_index(oc_add_new_device_t cfg, size_t index) if (index > device_count) { OC_ERR( - "designated device index is bigger than current number of all Devices"); + "designated device index (%d) is bigger than current number of all Devices", + g_device_count); return NULL; } else if (index < device_count) { /* diff --git a/api/unittest/coreresourcetest.cpp b/api/unittest/coreresourcetest.cpp index d85e6447d..8d7e02676 100644 --- a/api/unittest/coreresourcetest.cpp +++ b/api/unittest/coreresourcetest.cpp @@ -185,7 +185,12 @@ TEST_F(TestCoreResource, CoreDevice_P) ASSERT_NE(addcoredevice, nullptr); size_t numcoredevice = oc_core_get_num_devices(); EXPECT_EQ(1, numcoredevice); + +#ifdef OC_HAS_FEATURE_BRIDGE + oc_core_remove_device_at_index(numcoredevice-1); +#else oc_connectivity_shutdown(kDevice1ID); +#endif } static void