diff options
author | David Robillard <d@drobilla.net> | 2017-09-23 14:42:00 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-09-23 15:59:22 +0200 |
commit | f8c8f7e02605c10af0b6bc9f1261e893dc825e97 (patch) | |
tree | 7364e3d1bba9b7920d32a03c4a680eadcf685169 /src | |
parent | 7f965c4bcb94be0ba0c0e73ef7c5c226bad91b8e (diff) | |
download | serd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.tar.gz serd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.tar.bz2 serd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.zip |
Report errors for all failing test cases
Diffstat (limited to 'src')
-rw-r--r-- | src/reader.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/reader.c b/src/reader.c index bdfd23d3..73821584 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1561,9 +1561,13 @@ read_wrappedGraph(SerdReader* reader, ReadContext* ctx) while (peek_byte(reader) != '}') { ctx->subject = 0; Ref subj = read_subject(reader, *ctx, &ctx->subject, &s_type); - if (!subj || - (!read_triples(reader, *ctx, &ate_dot) && s_type != '[')) { + if (!subj && ctx->subject) { + return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad subject\n"); + } else if (!subj) { return false; + } else if (!read_triples(reader, *ctx, &ate_dot) && s_type != '[') { + return r_err(reader, SERD_ERR_BAD_SYNTAX, + "missing predicate object list\n"); } pop_node(reader, subj); read_ws_star(reader); @@ -1637,7 +1641,8 @@ read_statement(SerdReader* reader) read_ws_star(reader); } else if (read_ws_star(reader) && peek_byte(reader) == '{') { if (s_type == '(' || (s_type == '[' && !*ctx.flags)) { - return false; // invalid graph with complex label + return r_err(reader, SERD_ERR_BAD_SYNTAX, + "invalid graph name\n"); } ctx.graph = subj; ctx.subject = subj = 0; |