From e1f6470dae441e1a90f64240f39466b0d5f4ddb9 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 2 May 2017 01:54:49 +0200 Subject: [PATCH] json_patch_tests.c: Use case sensitive functions --- tests/json_patch_tests.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/json_patch_tests.c b/tests/json_patch_tests.c index 90cbaba..3d4df41 100644 --- a/tests/json_patch_tests.c +++ b/tests/json_patch_tests.c @@ -59,7 +59,7 @@ static cJSON_bool test_apply_patch(const cJSON * const test) cJSON_bool successful = false; /* extract all the data out of the test */ - comment = cJSON_GetObjectItem(test, "comment"); + comment = cJSON_GetObjectItemCaseSensitive(test, "comment"); if (cJSON_IsString(comment)) { printf("Testing \"%s\"\n", comment->valuestring); @@ -69,34 +69,34 @@ static cJSON_bool test_apply_patch(const cJSON * const test) printf("Testing unkown\n"); } - disabled = cJSON_GetObjectItem(test, "disabled"); + disabled = cJSON_GetObjectItemCaseSensitive(test, "disabled"); if (cJSON_IsTrue(disabled)) { printf("SKIPPED\n"); return true; } - doc = cJSON_GetObjectItem(test, "doc"); + doc = cJSON_GetObjectItemCaseSensitive(test, "doc"); TEST_ASSERT_NOT_NULL_MESSAGE(doc, "No \"doc\" in the test."); - patch = cJSON_GetObjectItem(test, "patch"); + patch = cJSON_GetObjectItemCaseSensitive(test, "patch"); TEST_ASSERT_NOT_NULL_MESSAGE(patch, "No \"patch\"in the test."); /* Make a working copy of 'doc' */ object = cJSON_Duplicate(doc, true); TEST_ASSERT_NOT_NULL(object); - expected = cJSON_GetObjectItem(test, "expected"); - error_element = cJSON_GetObjectItem(test, "error"); + expected = cJSON_GetObjectItemCaseSensitive(test, "expected"); + error_element = cJSON_GetObjectItemCaseSensitive(test, "error"); if (error_element != NULL) { /* excepting an error */ - TEST_ASSERT_TRUE_MESSAGE(0 != cJSONUtils_ApplyPatches(object, patch), "Test didn't fail as it's supposed to."); + TEST_ASSERT_TRUE_MESSAGE(0 != cJSONUtils_ApplyPatchesCaseSensitive(object, patch), "Test didn't fail as it's supposed to."); successful = true; } else { /* apply the patch */ - TEST_ASSERT_EQUAL_INT_MESSAGE(0, cJSONUtils_ApplyPatches(object, patch), "Failed to apply patches."); + TEST_ASSERT_EQUAL_INT_MESSAGE(0, cJSONUtils_ApplyPatchesCaseSensitive(object, patch), "Failed to apply patches."); successful = true; if (expected != NULL) @@ -131,21 +131,21 @@ static cJSON_bool test_generate_test(cJSON *test __attribute__((unused))) char *printed_patch = NULL; - disabled = cJSON_GetObjectItem(test, "disabled"); + disabled = cJSON_GetObjectItemCaseSensitive(test, "disabled"); if (cJSON_IsTrue(disabled)) { printf("SKIPPED\n"); return true; } - doc = cJSON_GetObjectItem(test, "doc"); + doc = cJSON_GetObjectItemCaseSensitive(test, "doc"); TEST_ASSERT_NOT_NULL_MESSAGE(doc, "No \"doc\" in the test."); /* Make a working copy of 'doc' */ object = cJSON_Duplicate(doc, true); TEST_ASSERT_NOT_NULL(object); - expected = cJSON_GetObjectItem(test, "expected"); + expected = cJSON_GetObjectItemCaseSensitive(test, "expected"); if (expected == NULL) { cJSON_Delete(object); @@ -153,7 +153,7 @@ static cJSON_bool test_generate_test(cJSON *test __attribute__((unused))) return true; } - patch = cJSONUtils_GeneratePatches(doc, expected); + patch = cJSONUtils_GeneratePatchesCaseSensitive(doc, expected); TEST_ASSERT_NOT_NULL_MESSAGE(patch, "Failed to generate patches."); printed_patch = cJSON_Print(patch); @@ -161,7 +161,7 @@ static cJSON_bool test_generate_test(cJSON *test __attribute__((unused))) free(printed_patch); /* apply the generated patch */ - TEST_ASSERT_EQUAL_INT_MESSAGE(0, cJSONUtils_ApplyPatches(object, patch), "Failed to apply generated patch."); + TEST_ASSERT_EQUAL_INT_MESSAGE(0, cJSONUtils_ApplyPatchesCaseSensitive(object, patch), "Failed to apply generated patch."); successful = cJSON_Compare(object, expected, true);