Skip to content

Commit 30346bc

Browse files
Copilotkanjoe24
andcommitted
Fix INT64/UINT64 profile assert macros and unused param warnings in weak stubs
Co-authored-by: kanjoe24 <165808281+kanjoe24@users.noreply.github.com> Agent-Logs-Url: https://github.com/rdkcentral/ut-core/sessions/d484a2b7-dbe0-41a6-a7c2-c04929eb352d
1 parent 08cfaa3 commit 30346bc

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

include/ut_kvp_profile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ extern "C"
8787
#define UT_ASSERT_KVP_EQUAL_PROFILE_UINT32(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_UINT32(key), checkValue);
8888

8989
/**! Asserts that a UINT64 KVP field matches the expected value. */
90-
#define UT_ASSERT_KVP_EQUAL_PROFILE_UINT64(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_UINT64(key), checkValue);
90+
#define UT_ASSERT_KVP_EQUAL_PROFILE_UINT64(checkValue, key) UT_ASSERT(UT_KVP_PROFILE_GET_UINT64(key) == (checkValue));
9191

9292
/**! Asserts that an INT8 KVP field matches the expected value. */
9393
#define UT_ASSERT_KVP_EQUAL_PROFILE_INT8(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_INT8(key), checkValue);
@@ -99,7 +99,7 @@ extern "C"
9999
#define UT_ASSERT_KVP_EQUAL_PROFILE_INT32(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_INT32(key), checkValue);
100100

101101
/**! Asserts that an INT64 KVP field matches the expected value. */
102-
#define UT_ASSERT_KVP_EQUAL_PROFILE_INT64(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_INT64(key), checkValue);
102+
#define UT_ASSERT_KVP_EQUAL_PROFILE_INT64(checkValue, key) UT_ASSERT(UT_KVP_PROFILE_GET_INT64(key) == (checkValue));
103103

104104
/**! Asserts that a KVP list field matches the expected value. */
105105
#define UT_ASSERT_KVP_EQUAL_PROFILE_LIST_COUNT(checkValue, key) UT_ASSERT_EQUAL(UT_KVP_PROFILE_GET_LIST_COUNT(key), checkValue);

tests/src/c_source/ut_test_kvp_profile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void test_ut_kvp_profile_int64(void)
228228
UT_ASSERT_KVP_EQUAL_PROFILE_INT64( checkFieldNegative, "decodeTest.checkInt64Negative" );
229229

230230
result = UT_KVP_PROFILE_GET_INT64("decodeTest.checkInt64Positive");
231-
UT_ASSERT_EQUAL(result, checkFieldPositive);
231+
UT_ASSERT(result == checkFieldPositive);
232232

233233
UT_LOG_STEP("test_ut_kvp_profile_int64 - end");
234234
}

tests/src_weak/ut_test_weak_kvp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ uint64_t __attribute__((weak)) ut_kvp_getUInt64Field(ut_kvp_instance_t *pInstanc
185185
*/
186186
int8_t __attribute__((weak)) ut_kvp_getInt8Field(ut_kvp_instance_t *pInstance, const char *pszKey)
187187
{
188+
(void)pInstance;
189+
(void)pszKey;
188190
printf("Weak implementation of [%s]", __func__);
189191
return 0;
190192
}
@@ -200,6 +202,8 @@ int8_t __attribute__((weak)) ut_kvp_getInt8Field(ut_kvp_instance_t *pInstance, c
200202
*/
201203
int16_t __attribute__((weak)) ut_kvp_getInt16Field(ut_kvp_instance_t *pInstance, const char *pszKey)
202204
{
205+
(void)pInstance;
206+
(void)pszKey;
203207
printf("Weak implementation of [%s]", __func__);
204208
return 0;
205209
}
@@ -215,6 +219,8 @@ int16_t __attribute__((weak)) ut_kvp_getInt16Field(ut_kvp_instance_t *pInstance,
215219
*/
216220
int32_t __attribute__((weak)) ut_kvp_getInt32Field(ut_kvp_instance_t *pInstance, const char *pszKey)
217221
{
222+
(void)pInstance;
223+
(void)pszKey;
218224
printf("Weak implementation of [%s]", __func__);
219225
return 0;
220226
}
@@ -230,6 +236,8 @@ int32_t __attribute__((weak)) ut_kvp_getInt32Field(ut_kvp_instance_t *pInstance,
230236
*/
231237
int64_t __attribute__((weak)) ut_kvp_getInt64Field(ut_kvp_instance_t *pInstance, const char *pszKey)
232238
{
239+
(void)pInstance;
240+
(void)pszKey;
233241
printf("Weak implementation of [%s]", __func__);
234242
return 0;
235243
}

0 commit comments

Comments
 (0)