mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Initial TrustInSoft CI configuration
This commit is contained in:
committed by
Jakub Zwolakowski
parent
d2735278ed
commit
11de03fbd2
@@ -640,7 +640,9 @@ static void cjson_set_valuestring_to_object_should_not_leak_memory(void)
|
||||
ptr1 = item1->valuestring;
|
||||
return_value = cJSON_SetValuestring(cJSON_GetObjectItem(root, "one"), long_valuestring);
|
||||
TEST_ASSERT_NOT_NULL(return_value);
|
||||
#ifndef __TRUSTINSOFT_ANALYZER__ /* ptr1 was already freed, comparing it with another pointer is Undefined Behavior */
|
||||
TEST_ASSERT_NOT_EQUAL_MESSAGE(ptr1, return_value, "new valuestring longer than old should reallocate memory")
|
||||
#endif /* __TRUSTINSOFT_ANALYZER__ */
|
||||
TEST_ASSERT_EQUAL_STRING(long_valuestring, cJSON_GetObjectItem(root, "one")->valuestring);
|
||||
|
||||
return_value = cJSON_SetValuestring(cJSON_GetObjectItem(root, "two"), long_valuestring);
|
||||
|
||||
@@ -34,7 +34,12 @@ static void parse_hex4_should_parse_all_combinations(void)
|
||||
unsigned char digits_lower[6];
|
||||
unsigned char digits_upper[6];
|
||||
/* test all combinations */
|
||||
#if defined(__TRUSTINSOFT_ANALYZER__)
|
||||
/* Reduce the test's size for TIS CI. */
|
||||
for (number = 0; number <= 0xFFF; number++)
|
||||
#else
|
||||
for (number = 0; number <= 0xFFFF; number++)
|
||||
#endif
|
||||
{
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_lower, "%.4x", number), "sprintf failed.");
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_upper, "%.4X", number), "sprintf failed.");
|
||||
|
||||
Reference in New Issue
Block a user