File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ if(ENABLE_CJSON_TEST)
62
62
63
63
option (ENABLE_VALGRIND OFF "Enable the valgrind memory checker for the tests." )
64
64
if (ENABLE_VALGRIND)
65
- add_compile_definitions (ENABLE_VALGRIND)
66
65
find_program (MEMORYCHECK_COMMAND valgrind)
67
66
if ("${MEMORYCHECK_COMMAND} " MATCHES "MEMORYCHECK_COMMAND-NOTFOUND" )
68
67
message (WARNING "Valgrind couldn't be found." )
Original file line number Diff line number Diff line change @@ -732,23 +732,6 @@ static void cjson_set_bool_value_must_not_break_objects(void)
732
732
cJSON_Delete (sobj );
733
733
}
734
734
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
-
752
735
int CJSON_CDECL main (void )
753
736
{
754
737
UNITY_BEGIN ();
@@ -779,7 +762,6 @@ int CJSON_CDECL main(void)
779
762
RUN_TEST (cjson_delete_item_from_array_should_not_broken_list_structure );
780
763
RUN_TEST (cjson_set_valuestring_to_object_should_not_leak_memory );
781
764
RUN_TEST (cjson_set_bool_value_must_not_break_objects );
782
- RUN_TEST (deallocated_pointers_should_be_set_to_null );
783
765
784
766
return UNITY_END ();
785
767
}
You can’t perform that action at this time.
0 commit comments