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
439979b1
Commit
439979b1
authored
Nov 15, 2002
by
Niels Möller
Browse files
* testsuite/sexp-test.c (test_main): Test sexp_iterator_get_uint32.
Rev: src/nettle/testsuite/sexp-test.c:1.10
parent
eb26bf0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/sexp-test.c
View file @
439979b1
...
...
@@ -5,7 +5,8 @@ int
test_main
(
void
)
{
struct
sexp_iterator
i
;
uint32_t
x
;
ASSERT
(
sexp_iterator_first
(
&
i
,
LDATA
(
""
)));
ASSERT
(
i
.
type
==
SEXP_END
);
...
...
@@ -20,6 +21,18 @@ test_main(void)
ASSERT
(
i
.
type
==
SEXP_LIST
&&
!
sexp_iterator_enter_list
(
&
i
));
/* Check integers. */
ASSERT
(
sexp_iterator_first
(
&
i
,
LDATA
(
"1:
\0
"
"1:
\x11
"
"2:
\x00\x11
"
"2:
\x00\x80
"
"5:
\x00\xaa\xbb\xcc\xdd
"
)));
ASSERT
(
sexp_iterator_get_uint32
(
&
i
,
&
x
)
&&
x
==
0
);
ASSERT
(
sexp_iterator_get_uint32
(
&
i
,
&
x
)
&&
x
==
0x11
);
ASSERT
(
sexp_iterator_get_uint32
(
&
i
,
&
x
)
&&
x
==
0x11
);
ASSERT
(
sexp_iterator_get_uint32
(
&
i
,
&
x
)
&&
x
==
0x80
);
ASSERT
(
sexp_iterator_get_uint32
(
&
i
,
&
x
)
&&
x
==
0xaabbccdd
);
ASSERT
(
sexp_iterator_first
(
&
i
,
LDATA
(
"3:foo0:[3:bar]12:xxxxxxxxxxxx"
)));
ASSERT
(
i
.
type
==
SEXP_ATOM
&&
!
i
.
display_length
&&
!
i
.
display
...
...
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