mirror of
https://github.com/DaveGamble/cJSON
synced 2024-12-22 06:40:04 +00:00
Support default __stdcall calling convention on tests as well
This commit is contained in:
parent
ad2cb5b7ea
commit
f25b8448e4
@ -49,6 +49,8 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
|
||||
-Wswitch-enum
|
||||
)
|
||||
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# Disable warning c4001 - nonstandard extension 'single line comment' was used
|
||||
# Define _CRT_SECURE_NO_WARNINGS to disable deprecation warnings for "insecure" C library functions
|
||||
list(APPEND custom_compiler_flags
|
||||
/GS
|
||||
/Za
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "unity/src/unity.h"
|
||||
#include "common.h"
|
||||
|
||||
static void *failing_malloc(size_t size)
|
||||
static void * CJSON_CDECL failing_malloc(size_t size)
|
||||
{
|
||||
(void)size;
|
||||
return NULL;
|
||||
@ -378,7 +378,7 @@ static void cjson_add_array_should_fail_on_allocation_failure(void)
|
||||
cJSON_Delete(root);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
|
||||
|
@ -186,7 +186,7 @@ static void cjson_compare_should_compare_objects(void)
|
||||
false))
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
|
||||
|
@ -410,7 +410,7 @@ static void cjson_functions_shouldnt_crash_with_null_pointers(void)
|
||||
cJSON_Delete(item);
|
||||
}
|
||||
|
||||
static void *failing_realloc(void *pointer, size_t size)
|
||||
static void * CJSON_CDECL failing_realloc(void *pointer, size_t size)
|
||||
{
|
||||
(void)size;
|
||||
(void)pointer;
|
||||
@ -527,7 +527,7 @@ static void cjson_add_item_to_object_should_not_use_after_free_when_string_is_al
|
||||
cJSON_Delete(object);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
|
||||
|
@ -152,7 +152,7 @@ static void parse_array_should_not_parse_non_arrays(void)
|
||||
assert_not_array("\"[]hello world!\n\"");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
memset(item, 0, sizeof(cJSON));
|
||||
|
@ -195,7 +195,7 @@ static void test12_should_not_be_parsed(void)
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(file_test1_should_be_parsed_and_printed);
|
||||
|
@ -64,7 +64,7 @@ static void parse_hex4_should_parse_mixed_case(void)
|
||||
TEST_ASSERT_EQUAL_INT(0xBEEF, parse_hex4((const unsigned char*)"BEEF"));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(parse_hex4_should_parse_all_combinations);
|
||||
|
@ -96,7 +96,7 @@ static void parse_number_should_parse_negative_reals(void)
|
||||
assert_parse_number("-123e-128", 0, -123e-128);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
memset(item, 0, sizeof(cJSON));
|
||||
|
@ -162,7 +162,7 @@ static void parse_object_should_not_parse_non_objects(void)
|
||||
assert_not_object("\"{}hello world!\n\"");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
memset(item, 0, sizeof(cJSON));
|
||||
|
@ -119,7 +119,7 @@ static void parse_string_should_parse_bug_94(void)
|
||||
reset(item);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item and error pointer */
|
||||
memset(item, 0, sizeof(cJSON));
|
||||
|
@ -96,7 +96,7 @@ static void parse_value_should_parse_object(void)
|
||||
reset(item);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
memset(item, 0, sizeof(cJSON));
|
||||
|
@ -97,7 +97,7 @@ static void parse_with_opts_should_parse_utf8_bom(void)
|
||||
cJSON_Delete(without_bom);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
|
||||
|
@ -87,7 +87,7 @@ static void print_array_should_print_arrays_with_multiple_elements(void)
|
||||
assert_print_array("[1, null, true, false, [], \"hello\", {\n\t}]", "[1,null,true,false,[],\"hello\",{}]");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
UNITY_BEGIN();
|
||||
|
@ -89,7 +89,7 @@ static void print_number_should_print_non_number(void)
|
||||
/* assert_print_number("null", -INFTY); */
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
UNITY_BEGIN();
|
||||
|
@ -88,7 +88,7 @@ static void print_object_should_print_objects_with_multiple_elements(void)
|
||||
assert_print_object("{\n\t\"one\":\t1,\n\t\"NULL\":\tnull,\n\t\"TRUE\":\ttrue,\n\t\"FALSE\":\tfalse,\n\t\"array\":\t[],\n\t\"world\":\t\"hello\",\n\t\"object\":\t{\n\t}\n}", "{\"one\":1,\"NULL\":null,\"TRUE\":true,\"FALSE\":false,\"array\":[],\"world\":\"hello\",\"object\":{}}");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
UNITY_BEGIN();
|
||||
|
@ -65,7 +65,7 @@ static void print_string_should_print_utf8(void)
|
||||
assert_print_string("\"ü猫慕\"", "ü猫慕");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
UNITY_BEGIN();
|
||||
|
@ -90,7 +90,7 @@ static void print_value_should_print_object(void)
|
||||
assert_print_value("{}");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
/* initialize cJSON item */
|
||||
UNITY_BEGIN();
|
||||
|
@ -246,7 +246,7 @@ static void supports_full_hd_should_check_for_full_hd_support(void)
|
||||
TEST_ASSERT_FALSE(supports_full_hd(monitor_without_hd));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int CJSON_CDECL main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user