Skip to content

Commit

Permalink
#341 Fix nested structures
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Sep 17, 2015
1 parent 9b14fb4 commit 519c5f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/corto/lang/src/cx_string_deser.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ static cx_int16 cx_string_deserParseValue(cx_string value, struct cx_string_dese
/* Can typically occur when mixing short with default notation. */
if (info->parsed) {
cx_seterr("member '%s' is already parsed", cx_nameof(info->m));
goto error;
}

/* Only parse references and primitives */
Expand Down Expand Up @@ -468,6 +469,7 @@ static cx_string cx_string_deserParse(cx_string str, struct cx_string_deserIndex
}
}
proceed = FALSE;
ptr--;
break;

case '\n':
Expand Down
8 changes: 4 additions & 4 deletions packages/corto/lang/test/src/test_StringDeserializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ cx_void _test_StringDeserializer_tc_deserCompositeNestedMixed(test_StringDeseria
test_assert(ret == 0);
test_assert(cx_typeof(o) == (cx_type)test_Line_o);
test_Line *l = o;
test_assert(l->start.x == 10);
test_assert(l->start.y == 20);
test_assert(l->stop.x == 30);
test_assert(l->stop.y == 40);
test_assert(l->start.x == 40);
test_assert(l->start.y == 30);
test_assert(l->stop.x == 10);
test_assert(l->stop.y == 20);
cx_delete(o);

/* $end */
Expand Down

0 comments on commit 519c5f0

Please sign in to comment.