Skip to content

Commit 424ce4c

Browse files
committed
Revert "feat: add tests for #842" to fix test failures
This reverts commit 5b502cd. Related to #860
1 parent 3249730 commit 424ce4c

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ if(ENABLE_CJSON_TEST)
6262

6363
option(ENABLE_VALGRIND OFF "Enable the valgrind memory checker for the tests.")
6464
if (ENABLE_VALGRIND)
65-
add_compile_definitions(ENABLE_VALGRIND)
6665
find_program(MEMORYCHECK_COMMAND valgrind)
6766
if ("${MEMORYCHECK_COMMAND}" MATCHES "MEMORYCHECK_COMMAND-NOTFOUND")
6867
message(WARNING "Valgrind couldn't be found.")

tests/misc_tests.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -732,23 +732,6 @@ static void cjson_set_bool_value_must_not_break_objects(void)
732732
cJSON_Delete(sobj);
733733
}
734734

735-
static void deallocated_pointers_should_be_set_to_null(void)
736-
{
737-
/* deallocated pointers should be set to null */
738-
/* however, valgrind on linux reports when attempting to access a freed memory, we have to skip it */
739-
#ifndef ENABLE_VALGRIND
740-
cJSON *string = cJSON_CreateString("item");
741-
cJSON *root = cJSON_CreateObject();
742-
743-
cJSON_Delete(string);
744-
free(string->valuestring);
745-
746-
cJSON_AddObjectToObject(root, "object");
747-
cJSON_Delete(root->child);
748-
free(root->child->string);
749-
#endif
750-
}
751-
752735
int CJSON_CDECL main(void)
753736
{
754737
UNITY_BEGIN();
@@ -779,7 +762,6 @@ int CJSON_CDECL main(void)
779762
RUN_TEST(cjson_delete_item_from_array_should_not_broken_list_structure);
780763
RUN_TEST(cjson_set_valuestring_to_object_should_not_leak_memory);
781764
RUN_TEST(cjson_set_bool_value_must_not_break_objects);
782-
RUN_TEST(deallocated_pointers_should_be_set_to_null);
783765

784766
return UNITY_END();
785767
}

0 commit comments

Comments
 (0)