diff options
author | Petri Lehtinen <petri@digip.org> | 2019-10-19 20:35:28 +0300 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2019-10-21 08:56:03 +0300 |
commit | a8f5fa5f5a2b7613aa2aa27b4a4df83b5a0ecd1b (patch) | |
tree | 366ad4f7e39808675d35d9c941fd51a8c86b0bda /test/suites/api/test_dump.c | |
parent | 7c0297abe8f4fb4aafd642c3130628185dc78978 (diff) | |
download | jansson-a8f5fa5f5a2b7613aa2aa27b4a4df83b5a0ecd1b.zip jansson-a8f5fa5f5a2b7613aa2aa27b4a4df83b5a0ecd1b.tar.gz jansson-a8f5fa5f5a2b7613aa2aa27b4a4df83b5a0ecd1b.tar.bz2 |
Tweak clang-format configuration a bit
Set ColumnLimit to 90, remove AllowShortCaseLabelsOnASingleLine.
Diffstat (limited to 'test/suites/api/test_dump.c')
-rw-r--r-- | test/suites/api/test_dump.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/suites/api/test_dump.c b/test/suites/api/test_dump.c index de90dc6..e8cb519 100644 --- a/test/suites/api/test_dump.c +++ b/test/suites/api/test_dump.c @@ -42,8 +42,7 @@ static void encode_null() { /* Don't test json_dump_file to avoid creating a file */ - if (json_dump_callback(NULL, encode_null_callback, NULL, JSON_ENCODE_ANY) != - -1) + if (json_dump_callback(NULL, encode_null_callback, NULL, JSON_ENCODE_ANY) != -1) fail("json_dump_callback didn't fail for NULL"); } @@ -176,20 +175,17 @@ static void escape_slashes() { char *result; json = json_object(); - json_object_set_new(json, "url", - json_string("https://github.com/akheron/jansson")); + json_object_set_new(json, "url", json_string("https://github.com/akheron/jansson")); result = json_dumps(json, 0); - if (!result || - strcmp(result, "{\"url\": \"https://github.com/akheron/jansson\"}")) + if (!result || strcmp(result, "{\"url\": \"https://github.com/akheron/jansson\"}")) fail("json_dumps failed to not escape slashes"); free(result); result = json_dumps(json, JSON_ESCAPE_SLASH); if (!result || - strcmp(result, - "{\"url\": \"https:\\/\\/github.com\\/akheron\\/jansson\"}")) + strcmp(result, "{\"url\": \"https:\\/\\/github.com\\/akheron\\/jansson\"}")) fail("json_dumps failed to escape slashes"); free(result); @@ -275,8 +271,8 @@ static void dumpfd() { } static void embed() { - static const char *plains[] = {"{\"bar\":[],\"foo\":{}}", "[[],{}]", "{}", - "[]", NULL}; + static const char *plains[] = {"{\"bar\":[],\"foo\":{}}", "[[],{}]", "{}", "[]", + NULL}; size_t i; @@ -290,8 +286,8 @@ static void embed() { psize = strlen(plain) - 2; embed = calloc(1, psize); parse = json_loads(plain, 0, NULL); - esize = json_dumpb(parse, embed, psize, - JSON_COMPACT | JSON_SORT_KEYS | JSON_EMBED); + esize = + json_dumpb(parse, embed, psize, JSON_COMPACT | JSON_SORT_KEYS | JSON_EMBED); json_decref(parse); if (esize != psize) fail("json_dumpb(JSON_EMBED) returned an invalid size"); |