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
1bde6d4d
Commit
1bde6d4d
authored
Oct 18, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove warnings
parent
1c0ce5e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tests/tests-randomized/random-test-driver.c
tests/tests-randomized/random-test-driver.c
+7
-7
No files found.
tests/tests-randomized/random-test-driver.c
View file @
1bde6d4d
...
@@ -117,7 +117,7 @@ generate_random_data(enum asn_transfer_syntax syntax, const char *top_dirname, s
...
@@ -117,7 +117,7 @@ generate_random_data(enum asn_transfer_syntax syntax, const char *top_dirname, s
if
(
enc
.
syntax
==
syntax
)
{
if
(
enc
.
syntax
==
syntax
)
{
int
r
=
snprintf
(
dirname
,
sizeof
(
dirname
),
"%s/%s"
,
top_dirname
,
int
r
=
snprintf
(
dirname
,
sizeof
(
dirname
),
"%s/%s"
,
top_dirname
,
enc
.
dir_name
);
enc
.
dir_name
);
if
(
r
>=
sizeof
(
dirname
)
-
sizeof
(
"filename.bin"
))
{
if
(
r
<
0
||
(
size_t
)
r
>=
sizeof
(
dirname
)
-
sizeof
(
"filename.bin"
))
{
fprintf
(
stderr
,
"Too long filenames
\n
"
);
fprintf
(
stderr
,
"Too long filenames
\n
"
);
exit
(
EX_SOFTWARE
);
exit
(
EX_SOFTWARE
);
}
}
...
@@ -231,7 +231,7 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
...
@@ -231,7 +231,7 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
for
(;;)
{
for
(;;)
{
er
=
asn_encode_to_buffer
(
er
=
asn_encode_to_buffer
(
0
,
syntax
,
&
asn_DEF_T
,
structure
,
buffer
,
buffer_size
);
0
,
syntax
,
&
asn_DEF_T
,
structure
,
buffer
,
buffer_size
);
if
(
er
.
encoded
==
-
1
)
{
if
(
er
.
encoded
<
0
)
{
fprintf
(
stderr
,
"Encoded T into %zd bytes
\n
"
,
er
.
encoded
);
fprintf
(
stderr
,
"Encoded T into %zd bytes
\n
"
,
er
.
encoded
);
fprintf
(
stderr
,
"Structure %s:
\n
"
,
fprintf
(
stderr
,
"Structure %s:
\n
"
,
sizeof
(
ASN1_STR
)
>
60
?
"T"
:
ASN1_STR
);
sizeof
(
ASN1_STR
)
>
60
?
"T"
:
ASN1_STR
);
...
@@ -239,7 +239,7 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
...
@@ -239,7 +239,7 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
assert
(
er
.
encoded
>=
0
);
assert
(
er
.
encoded
>=
0
);
exit
(
EX_SOFTWARE
);
exit
(
EX_SOFTWARE
);
}
}
if
(
er
.
encoded
>
buffer_size
&&
buffer
==
tmp_buffer
)
{
if
(
(
size_t
)
er
.
encoded
>
buffer_size
&&
buffer
==
tmp_buffer
)
{
if
(
debug
)
{
if
(
debug
)
{
fprintf
(
fprintf
(
stderr
,
stderr
,
...
@@ -254,10 +254,10 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
...
@@ -254,10 +254,10 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
}
}
break
;
break
;
}
}
if
(
er
.
encoded
>
buffer_size
)
{
if
(
(
size_t
)
er
.
encoded
>
buffer_size
)
{
fprintf
(
stderr
,
"Data %zd does not fit into buffer %zu
\n
"
,
fprintf
(
stderr
,
"Data %zd does not fit into buffer %zu
\n
"
,
er
.
encoded
,
buffer_size
);
er
.
encoded
,
buffer_size
);
assert
(
er
.
encoded
<=
buffer_size
);
assert
(
(
size_t
)
er
.
encoded
<=
buffer_size
);
}
}
asn_dec_rval_t
rval
=
asn_dec_rval_t
rval
=
...
@@ -265,12 +265,12 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
...
@@ -265,12 +265,12 @@ check_random_roundtrip(enum asn_transfer_syntax syntax, size_t max_random_value_
buffer
,
er
.
encoded
);
buffer
,
er
.
encoded
);
if
(
rval
.
code
==
RC_OK
)
{
if
(
rval
.
code
==
RC_OK
)
{
/* Everything's cool... or is it? Expecting a proper consumed */
/* Everything's cool... or is it? Expecting a proper consumed */
if
(
rval
.
consumed
!=
er
.
encoded
)
{
if
(
(
ssize_t
)
rval
.
consumed
!=
er
.
encoded
)
{
fprintf
(
stderr
,
"Encoded into %zd, yet consumed %zu
\n
"
,
fprintf
(
stderr
,
"Encoded into %zd, yet consumed %zu
\n
"
,
er
.
encoded
,
rval
.
consumed
);
er
.
encoded
,
rval
.
consumed
);
fprintf
(
stderr
,
"Original random structure:
\n
"
);
fprintf
(
stderr
,
"Original random structure:
\n
"
);
asn_fprint
(
stderr
,
&
asn_DEF_T
,
structure
);
asn_fprint
(
stderr
,
&
asn_DEF_T
,
structure
);
assert
(
rval
.
consumed
==
er
.
encoded
);
assert
(
(
ssize_t
)
rval
.
consumed
==
er
.
encoded
);
exit
(
EX_SOFTWARE
);
exit
(
EX_SOFTWARE
);
}
}
}
else
{
}
else
{
...
...
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