Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
72b10447
Commit
72b10447
authored
Oct 19, 2017
by
Vasil Velichkov
Committed by
Lev Walkin
Oct 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix several sign-compare errors in the tests
parent
97656bdd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
tests/tests-skeletons/check-INTEGER.c
tests/tests-skeletons/check-INTEGER.c
+2
-2
tests/tests-skeletons/check-OER-support.c
tests/tests-skeletons/check-OER-support.c
+3
-2
tests/tests-skeletons/check-OIDs.c
tests/tests-skeletons/check-OIDs.c
+2
-2
tests/tests-skeletons/check-PER-UniversalString.c
tests/tests-skeletons/check-PER-UniversalString.c
+1
-1
tests/tests-skeletons/check-PER-support.c
tests/tests-skeletons/check-PER-support.c
+1
-1
No files found.
tests/tests-skeletons/check-INTEGER.c
View file @
72b10447
...
...
@@ -26,7 +26,7 @@ check(uint8_t *buf, size_t size, long check_long, int check_ret) {
long
rlong
=
123
;
assert
(
buf
);
assert
(
size
>
=
0
);
assert
(
size
>
0
);
val
.
buf
=
buf
;
val
.
size
=
size
;
...
...
@@ -133,7 +133,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret)
assert
(
shared_scratch_start
<
scratch
+
sizeof
(
scratch
));
assert
(
ret
==
0
);
ret
=
snprintf
(
verify
,
sizeof
(
verify
),
"%lu"
,
check_long
);
assert
(
ret
<
sizeof
(
verify
));
assert
(
ret
<
(
int
)
sizeof
(
verify
));
ret
=
strcmp
(
scratch
,
verify
);
printf
(
" [%s] vs [%s]: %d%s
\n
"
,
scratch
,
verify
,
ret
,
...
...
tests/tests-skeletons/check-OER-support.c
View file @
72b10447
...
...
@@ -21,7 +21,7 @@ check_round_trip(int lineno, int ok, size_t length) {
size_t
enc_len
=
0
;
ssize_t
enc_len_len
=
oer_serialize_length
(
length
,
fill_buffer
,
&
enc_len
);
assert
(
enc_len_len
>
0
);
assert
(
enc_len
==
enc_len_len
);
assert
(
enc_len
==
(
size_t
)
enc_len_len
);
/* Deserialize */
size_t
recovered_length
=
0
;
...
...
@@ -31,7 +31,8 @@ check_round_trip(int lineno, int ok, size_t length) {
}
ssize_t
dec_len
=
oer_fetch_length
(
buffer
,
enc_len
,
&
recovered_length
);
if
(
ok
)
{
assert
(
dec_len
==
enc_len
);
assert
(
dec_len
>
0
);
assert
((
size_t
)
dec_len
==
enc_len
);
if
(
recovered_length
!=
length
)
{
fprintf
(
stderr
,
"Round-trip failed %zu->%zu (encoded %zd, decoded %zd)
\n
"
,
...
...
tests/tests-skeletons/check-OIDs.c
View file @
72b10447
...
...
@@ -92,13 +92,13 @@ check_ROID(int lineno, uint8_t *buf, size_t len, unsigned *ck_buf,
memset
(
arcs
,
'A'
,
sizeof
(
arcs
));
alen
=
RELATIVE_OID_get_arcs
(
oid
,
arcs
,
sizeof
(
arcs
)
/
sizeof
(
arcs
[
0
]));
assert
(
alen
>
0
);
assert
(
alen
==
ck_len
);
assert
(
(
size_t
)
alen
==
ck_len
);
/*
* Make sure they are equivalent.
*/
printf
(
"RELATIVE_OID_get_arcs() => {"
);
for
(
i
=
0
;
i
<
alen
;
i
++
)
{
for
(
i
=
0
;
i
<
(
size_t
)
alen
;
i
++
)
{
printf
(
" %"
PRIu32
,
arcs
[
i
]);
assert
(
arcs
[
i
]
==
ck_buf
[
i
]);
}
...
...
tests/tests-skeletons/check-PER-UniversalString.c
View file @
72b10447
...
...
@@ -51,7 +51,7 @@ check_round_trip_OK(asn_TYPE_descriptor_t *td, const char *buf, size_t buflen) {
uper_output_buffer
,
(
enc
.
encoded
+
7
)
/
8
,
0
,
0
);
int
st_out_ct
=
asn_check_constraints
(
td
,
st_out
,
NULL
,
NULL
);
assert
(
st_out_ct
==
0
);
assert
(
dec
.
consumed
==
enc
.
encoded
);
assert
(
dec
.
consumed
==
(
size_t
)
enc
.
encoded
);
assert
(
st_in
->
size
==
st_out
->
size
);
assert
(
memcmp
(
st_in
->
buf
,
st_out
->
buf
,
st_in
->
size
)
==
0
);
assert
(
st_out
->
size
==
buflen
);
...
...
tests/tests-skeletons/check-PER-support.c
View file @
72b10447
...
...
@@ -8,7 +8,7 @@ static void put(asn_per_outp_t *po, size_t length) {
ssize_t
may_write
=
uper_put_length
(
po
,
length
,
&
need_eom
);
fprintf
(
stderr
,
" put %zu
\n
"
,
may_write
);
assert
(
may_write
>=
0
);
assert
(
may_write
<=
length
);
assert
(
(
size_t
)
may_write
<=
length
);
assert
(
need_eom
!=
123
);
length
-=
may_write
;
if
(
need_eom
)
{
...
...
Write
Preview
Markdown
is supported
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