Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nettle
nettle
Commits
cd229411
Commit
cd229411
authored
Sep 29, 2002
by
Niels Möller
Browse files
(test_main): Updated calls to
sexp_iterator_assoc. Rev: src/nettle/testsuite/sexp-test.c:1.4
parent
0f6b2ce6
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/sexp-test.c
View file @
cd229411
...
...
@@ -35,12 +35,11 @@ test_main(void)
&&
i
.
atom_length
==
1
&&
MEMEQ
(
1
,
"x"
,
i
.
atom
));
{
struct
sexp_assoc_key
keys
[
2
]
=
{
{
LDATA
(
"n"
)
},
{
LDATA
(
"e"
)
}
};
static
const
uint8_t
*
keys
[
2
]
=
{
"n"
,
"e"
};
struct
sexp_iterator
v
[
2
];
sexp_iterator_init
(
&
i
,
LDATA
(
"((1:n2:xx3:foo)0:(1:y)(1:e))"
));
ASSERT
(
sexp_iterator_next
(
&
i
)
ASSERT
(
sexp_iterator_next
(
&
i
)
&&
sexp_iterator_enter_list
(
&
i
)
&&
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
ASSERT
(
sexp_iterator_next
(
&
v
[
0
])
&&
v
[
0
].
type
==
SEXP_ATOM
...
...
@@ -56,12 +55,13 @@ test_main(void)
ASSERT
(
sexp_iterator_next
(
&
v
[
1
])
&&
v
[
1
].
type
==
SEXP_END
);
sexp_iterator_init
(
&
i
,
LDATA
(
"((1:n))"
));
ASSERT
(
sexp_iterator_next
(
&
i
)
ASSERT
(
sexp_iterator_next
(
&
i
)
&&
sexp_iterator_enter_list
(
&
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
));
ASSERT
(
sexp_iterator_next
(
&
i
)
&&
sexp_iterator_enter_list
(
&
i
)
&&
!
sexp_iterator_assoc
(
&
i
,
2
,
keys
,
v
));
}
SUCCESS
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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