| 279 | } |
| 280 | |
| 281 | static void cjson_add_string_should_add_string(void) |
| 282 | { |
| 283 | cJSON *root = cJSON_CreateObject(); |
| 284 | cJSON *string = NULL; |
| 285 | |
| 286 | cJSON_AddStringToObject(root, "string", "Hello World!"); |
| 287 | |
| 288 | TEST_ASSERT_NOT_NULL(string = cJSON_GetObjectItemCaseSensitive(root, "string")); |
| 289 | TEST_ASSERT_EQUAL_INT(string->type, cJSON_String); |
| 290 | TEST_ASSERT_EQUAL_STRING(string->valuestring, "Hello World!"); |
| 291 | |
| 292 | cJSON_Delete(root); |
| 293 | } |
| 294 | |
| 295 | static void cjson_add_string_should_fail_with_null_pointers(void) |
| 296 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…