Commit 7ba605d5 authored by Niels Möller's avatar Niels Möller

* sexp.c (sexp_iterator_assoc): Advance the iterator to the

element after a matching tag, before recording it.
* testsuite/sexp-test.c (test_main): Updated test.

Rev: src/nettle/testsuite/sexp-test.c:1.8
parent 697039a8
...@@ -41,7 +41,7 @@ test_main(void) ...@@ -41,7 +41,7 @@ test_main(void)
ASSERT(sexp_iterator_enter_list(&i) ASSERT(sexp_iterator_enter_list(&i)
&& sexp_iterator_assoc(&i, 2, keys, v)); && sexp_iterator_assoc(&i, 2, keys, v));
ASSERT(sexp_iterator_next(&v[0]) && v[0].type == SEXP_ATOM ASSERT(v[0].type == SEXP_ATOM
&& !v[0].display_length && !v[0].display && !v[0].display_length && !v[0].display
&& v[0].atom_length == 2 && MEMEQ(2, "xx", v[0].atom) && v[0].atom_length == 2 && MEMEQ(2, "xx", v[0].atom)
...@@ -51,7 +51,7 @@ test_main(void) ...@@ -51,7 +51,7 @@ test_main(void)
&& sexp_iterator_next(&v[0]) && v[0].type == SEXP_END); && sexp_iterator_next(&v[0]) && v[0].type == SEXP_END);
ASSERT(sexp_iterator_next(&v[1]) && v[1].type == SEXP_END); ASSERT(v[1].type == SEXP_END);
ASSERT(sexp_iterator_first(&i, LDATA("((1:n))"))); ASSERT(sexp_iterator_first(&i, LDATA("((1:n))")));
ASSERT(sexp_iterator_enter_list(&i) ASSERT(sexp_iterator_enter_list(&i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment