Change name from Configuration to Context

This commit is contained in:
Max Bruckner
2018-02-03 12:48:34 +01:00
parent 050f982608
commit 064eec8208
17 changed files with 540 additions and 537 deletions

View File

@@ -31,37 +31,37 @@ static void assert_print_object(const char * const expected, const char * const
cJSON item[1];
printbuffer formatted_buffer = { 0, 0, 0, 0, 0, default_configuration };
printbuffer unformatted_buffer = { 0, 0, 0, 0, 0, default_configuration };
parse_buffer parsebuffer = { 0, 0, 0, 0, default_configuration };
printbuffer formatted_buffer = { 0, 0, 0, 0, 0, default_context };
printbuffer unformatted_buffer = { 0, 0, 0, 0, 0, default_context };
parse_buffer parsebuffer = { 0, 0, 0, 0, default_context };
/* buffer for parsing */
parsebuffer.content = (const unsigned char*)input;
parsebuffer.length = strlen(input) + sizeof("");
parsebuffer.configuration = global_configuration;
parsebuffer.context = global_context;
/* buffer for formatted printing */
formatted_buffer.buffer = printed_formatted;
formatted_buffer.length = sizeof(printed_formatted);
formatted_buffer.offset = 0;
formatted_buffer.noalloc = true;
formatted_buffer.configuration = global_configuration;
formatted_buffer.context = global_context;
/* buffer for unformatted printing */
unformatted_buffer.buffer = printed_unformatted;
unformatted_buffer.length = sizeof(printed_unformatted);
unformatted_buffer.offset = 0;
unformatted_buffer.noalloc = true;
unformatted_buffer.configuration = global_configuration;
unformatted_buffer.context = global_context;
memset(item, 0, sizeof(item));
TEST_ASSERT_TRUE_MESSAGE(parse_object(item, &parsebuffer), "Failed to parse object.");
unformatted_buffer.configuration.format = false;
unformatted_buffer.context.format = false;
TEST_ASSERT_TRUE_MESSAGE(print_object(item, &unformatted_buffer), "Failed to print unformatted string.");
TEST_ASSERT_EQUAL_STRING_MESSAGE(input, printed_unformatted, "Unformatted object is not correct.");
formatted_buffer.configuration.format = true;
formatted_buffer.context.format = true;
TEST_ASSERT_TRUE_MESSAGE(print_object(item, &formatted_buffer), "Failed to print formatted string.");
TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, printed_formatted, "Formatted ojbect is not correct.");