Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wim Lewis
nettle
Commits
2903889b
Commit
2903889b
authored
Sep 28, 2002
by
Niels Möller
Browse files
* testsuite/sexp-test.c (test_main): Reordered sexp_iterator_assoc
tests. Rev: src/nettle/testsuite/sexp-test.c:1.2
parent
848b37be
Changes
1
Show whitespace changes
Inline
Side-by-side
testsuite/sexp-test.c
View file @
2903889b
...
...
@@ -39,13 +39,9 @@ test_main(void)
{
{
LDATA
(
"n"
)
},
{
LDATA
(
"e"
)
}
};
struct
sexp_iterator
v
[
2
];
sexp_iterator_init
(
&
i
,
LDATA
(
"((1:n))"
));
ASSERT
(
!
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
sexp_iterator_init
(
&
i
,
LDATA
(
"((1:n)(1:n3:foo))"
));
ASSERT
(
!
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
sexp_iterator_init
(
&
i
,
LDATA
(
"((1:n2:xx3:foo)0:(1:y)(1:e))"
));
ASSERT
(
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
ASSERT
(
sexp_iterator_next
(
&
i
)
&&
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
ASSERT
(
sexp_iterator_next
(
&
v
[
0
])
&&
v
[
0
].
type
==
SEXP_ATOM
&&
!
v
[
0
].
display_length
&&
!
v
[
0
].
display
...
...
@@ -56,6 +52,18 @@ test_main(void)
&&
v
[
0
].
atom_length
==
3
&&
MEMEQ
(
3
,
"foo"
,
v
[
0
].
atom
)
&&
sexp_iterator_next
(
&
v
[
0
])
&&
v
[
0
].
type
==
SEXP_END
);
ASSERT
(
sexp_iterator_next
(
&
v
[
1
])
&&
v
[
1
].
type
==
SEXP_END
);
#if 0
sexp_iterator_init(&i, LDATA("((1:n))"));
ASSERT(sexp_iterator_next(&i)
&& !sexp_iterator_assoc(&i, 2, keys, v));
sexp_iterator_init(&i, LDATA("((1:n)(1:n3:foo))"));
ASSERT(sexp_iterator_next(&i)
&& !sexp_iterator_assoc(&i, 2, keys, v));
#endif
}
SUCCESS
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment