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
a7d1fb39
Commit
a7d1fb39
authored
Jan 23, 2012
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check LP64 integers
parent
2e310772
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
skeletons/tests/check-INTEGER.c
skeletons/tests/check-INTEGER.c
+26
-2
skeletons/tests/check-OIDs.c
skeletons/tests/check-OIDs.c
+4
-1
No files found.
skeletons/tests/check-INTEGER.c
View file @
a7d1fb39
...
...
@@ -122,8 +122,6 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret)
assert
(
rlong
==
rlong2
);
}
return
0
;
shared_scratch_start
=
scratch
;
ret
=
INTEGER_print
(
&
asn_DEF_INTEGER
,
&
val
,
0
,
_print2buf
,
scratch
);
assert
(
shared_scratch_start
<
scratch
+
sizeof
(
scratch
));
...
...
@@ -240,6 +238,8 @@ main(int ac, char **av) {
check_xer
(
0
,
"<INTEGER>+2147483647</INTEGER>"
,
2147483647
);
check_xer
(
0
,
"<INTEGER>2147483647</INTEGER>"
,
2147483647
);
if
(
sizeof
(
long
)
==
4
)
{
check_xer
(
0
,
"<INTEGER>-2147483648</INTEGER>"
,
-
2147483648
);
check_xer
(
-
1
,
"<INTEGER>-2147483649</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>2147483648</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>2147483649</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>3147483649</INTEGER>"
,
0
);
...
...
@@ -247,6 +247,30 @@ main(int ac, char **av) {
check_xer
(
-
1
,
"<INTEGER>5147483649</INTEGER>"
,
0
);
/* special */
check_xer
(
-
1
,
"<INTEGER>9147483649</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>9999999999</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-5147483649</INTEGER>"
,
0
);
/* special */
check_xer
(
-
1
,
"<INTEGER>-9147483649</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-9999999999</INTEGER>"
,
0
);
}
if
(
sizeof
(
long
)
==
8
)
{
check_xer
(
0
,
"<INTEGER>2147483648</INTEGER>"
,
2147483648
);
check_xer
(
0
,
"<INTEGER>2147483649</INTEGER>"
,
2147483649
);
check_xer
(
0
,
"<INTEGER>3147483649</INTEGER>"
,
3147483649
);
check_xer
(
0
,
"<INTEGER>4147483649</INTEGER>"
,
4147483649
);
check_xer
(
0
,
"<INTEGER>5147483649</INTEGER>"
,
5147483649
);
check_xer
(
0
,
"<INTEGER>9147483649</INTEGER>"
,
9147483649
);
check_xer
(
0
,
"<INTEGER>9999999999</INTEGER>"
,
9999999999
);
check_xer
(
0
,
"<INTEGER>9223372036854775807</INTEGER>"
,
9223372036854775807
);
check_xer
(
-
1
,
"<INTEGER>9223372036854775808</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>10223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>50223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>100223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>500223372036854775807</INTEGER>"
,
0
);
check_xer
(
0
,
"<INTEGER>-9223372036854775808</INTEGER>"
,
-
9223372036854775808
);
check_xer
(
-
1
,
"<INTEGER>-9223372036854775809</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-10223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-50223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-100223372036854775807</INTEGER>"
,
0
);
check_xer
(
-
1
,
"<INTEGER>-500223372036854775807</INTEGER>"
,
0
);
}
return
0
;
...
...
skeletons/tests/check-OIDs.c
View file @
a7d1fb39
...
...
@@ -400,13 +400,16 @@ main() {
check_parse
(
"1.2147483647.3"
,
3
);
if
(
sizeof
(
long
)
==
4
)
{
check_parse
(
"1.2147483648.3"
,
-
1
);
/* overflow on ILP32 */
check_parse
(
"1.2147483649.3"
,
-
1
);
/* overflow on ILP32 */
check_parse
(
"1.3000000000.3"
,
-
1
);
check_parse
(
"1.4000000000.3"
,
-
1
);
check_parse
(
"1.5000000000.3"
,
-
1
);
check_parse
(
"1.6000000000.3"
,
-
1
);
check_parse
(
"1.9000000000.3"
,
-
1
);
}
else
{
}
else
if
(
sizeof
(
long
)
==
8
)
{
check_parse
(
"1.2147483648.3"
,
3
);
check_parse
(
"1.9223372036854775807.3"
,
3
);
check_parse
(
"1.9223372036854775808.3"
,
-
1
);
}
check_parse
(
"1.900a0000000.3"
,
-
1
);
check_parse
(
"1.900a.3"
,
-
1
);
...
...
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