diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-29 23:04:55 -0600 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-29 23:04:55 -0600 |
commit | adfc260f9bb69adfce623882276b8578279baf63 (patch) | |
tree | 7ef7500de33f243d6a4e6dd192f22f57f235a216 /gdata/gdata-parser.c | |
parent | e18bec0f183b660cb7c4066dcc9e6577a819a895 (diff) | |
download | libgdata-tasks-integration.tar.gz |
core: Finish JSON supporttasks-integration
This adds test cases which cover all of the new code, and fixes a
number of small bugs. extra_json support is now complete.
Diffstat (limited to 'gdata/gdata-parser.c')
-rw-r--r-- | gdata/gdata-parser.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c index 02222934..1bb926bf 100644 --- a/gdata/gdata-parser.c +++ b/gdata/gdata-parser.c @@ -769,11 +769,8 @@ gdata_parser_string_from_json_member (JsonReader *reader, const gchar *member_na return FALSE; } - /* Check if the output string has already been set */ - if (options & P_NO_DUPES && *output != NULL) { - *success = gdata_parser_error_duplicate_json_element (reader, error); - return TRUE; - } + /* Check if the output string has already been set. The JSON parser guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == NULL); /* Get the string and check it for NULLness or emptiness. Check for parser errors first. */ text = json_reader_get_string_value (reader); @@ -838,11 +835,8 @@ gdata_parser_int64_time_from_json_member (JsonReader *reader, const gchar *membe return FALSE; } - /* Check if the output time val has already been set */ - if (options & P_NO_DUPES && *output != -1) { - *success = gdata_parser_error_duplicate_json_element (reader, error); - return TRUE; - } + /* Check if the output time val has already been set. The JSON parser guarantees this can't happen. */ + g_assert (!(options & P_NO_DUPES) || *output == -1); /* Get the string and check it for NULLness. Check for errors first. */ text = json_reader_get_string_value (reader); |