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
c698ee5b
Commit
c698ee5b
authored
Oct 21, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more border cases
parent
cfeecfb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
skeletons/tests/check-INTEGER.c
skeletons/tests/check-INTEGER.c
+23
-1
No files found.
skeletons/tests/check-INTEGER.c
View file @
c698ee5b
#include <INTEGER.c>
#include <
ber_codec
_prim.c>
#include <
asn_codecs
_prim.c>
#include <ber_decoder.c>
#include <ber_tlv_length.c>
#include <ber_tlv_tag.c>
#include <der_encoder.c>
#include <xer_decoder.c>
#include <xer_support.c>
#include <constraints.c>
static
char
*
shared_scratch_start
;
...
...
@@ -44,6 +46,20 @@ check(uint8_t *buf, int size, long check_long, int check_ret) {
assert
(
ret
==
check_ret
);
assert
(
rlong
==
check_long
);
if
(
check_ret
==
0
)
{
INTEGER_t
val2
;
long
rlong2
;
val2
.
buf
=
0
;
val2
.
size
=
0
;
ret
=
asn_long2INTEGER
(
&
val2
,
rlong
);
assert
(
ret
==
0
);
assert
(
val2
.
buf
);
assert
(
val2
.
size
<=
val
.
size
);
/* At least as compact */
ret
=
asn_INTEGER2long
(
&
val
,
&
rlong2
);
assert
(
ret
==
0
);
assert
(
rlong
==
rlong2
);
}
shared_scratch_start
=
scratch
;
ret
=
INTEGER_print
(
&
asn_DEF_INTEGER
,
&
val
,
0
,
_print2buf
,
scratch
);
assert
(
shared_scratch_start
<
scratch
+
sizeof
(
scratch
));
...
...
@@ -74,6 +90,9 @@ main(int ac, char **av) {
uint8_t
buf8
[]
=
{
0x7f
,
0x7e
,
0x7d
,
0x7c
};
uint8_t
buf9
[]
=
{
0
,
0x7f
,
0x7e
,
0x7d
,
0x7c
};
uint8_t
buf10
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0x7f
,
0x7e
,
0x7d
,
0x7c
};
uint8_t
buf11
[]
=
{
0x80
,
0
,
0
,
0
};
uint8_t
buf12
[]
=
{
0x80
,
0
};
uint8_t
buf13
[]
=
{
0x80
};
#define CHECK(buf, val, ret) check(buf, sizeof(buf), val, ret)
...
...
@@ -87,6 +106,9 @@ main(int ac, char **av) {
CHECK
(
buf8
,
0x7F7E7D7C
,
0
);
CHECK
(
buf9
,
0x7F7E7D7C
,
0
);
CHECK
(
buf10
,
0x7F7E7D7C
,
0
);
CHECK
(
buf11
,
0x80000000
,
0
);
CHECK
(
buf12
,
-
32768
,
0
);
CHECK
(
buf13
,
-
128
,
0
);
return
0
;
}
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