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
6db40f4c
Commit
6db40f4c
authored
Jul 25, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check OER in 32-bit and 64-bit modes
parent
8b6a8005
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
1 deletion
+109
-1
asn1c/tests/Makefile.am
asn1c/tests/Makefile.am
+2
-1
asn1c/tests/check-src/check-135.-gen-OER.c
asn1c/tests/check-src/check-135.-gen-OER.c
+0
-0
asn1c/tests/check-src/check64-136.-gen-OER.c
asn1c/tests/check-src/check64-136.-gen-OER.c
+45
-0
tests/135-oer-short-OK.asn1
tests/135-oer-short-OK.asn1
+30
-0
tests/136-oer-long-OK.asn1
tests/136-oer-long-OK.asn1
+32
-0
No files found.
asn1c/tests/Makefile.am
View file @
6db40f4c
...
@@ -27,6 +27,7 @@ TESTS += check-src/check-127.-gen-PER.c
...
@@ -27,6 +27,7 @@ TESTS += check-src/check-127.-gen-PER.c
TESTS
+=
check-src/check-131.-gen-PER.c
TESTS
+=
check-src/check-131.-gen-PER.c
TESTS
+=
check-src/check-132.-gen-PER.c
TESTS
+=
check-src/check-132.-gen-PER.c
TESTS
+=
check-src/check-133.-gen-PER.c
TESTS
+=
check-src/check-133.-gen-PER.c
TESTS
+=
check-src/check-135.-gen-OER.c
TESTS
+=
check-src/check-19.c
TESTS
+=
check-src/check-19.c
TESTS
+=
check-src/check-22.-fwide-types.c
TESTS
+=
check-src/check-22.-fwide-types.c
TESTS
+=
check-src/check-24.-fwide-types.c
TESTS
+=
check-src/check-24.-fwide-types.c
...
@@ -58,7 +59,7 @@ TESTS += check-src/check-92.c
...
@@ -58,7 +59,7 @@ TESTS += check-src/check-92.c
if
TEST_64BIT
if
TEST_64BIT
TESTS
+=
check-src/check64-134.-gen-PER.c
TESTS
+=
check-src/check64-134.-gen-PER.c
TESTS
+=
check-src/check64-13
5
.-gen-OER.c
TESTS
+=
check-src/check64-13
6
.-gen-OER.c
endif
endif
EXTRA_DIST
=
\
EXTRA_DIST
=
\
...
...
asn1c/tests/check-src/check
64
-135.-gen-OER.c
→
asn1c/tests/check-src/check-135.-gen-OER.c
View file @
6db40f4c
File moved
asn1c/tests/check-src/check64-136.-gen-OER.c
0 → 100644
View file @
6db40f4c
/*
* Verify OER with constrained INTEGER code gen.
*/
#undef NDEBUG
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <T.h>
int
main
()
{
uint8_t
tmpbuf
[
128
];
T_t
empty_t
;
T_t
*
decoded_t
=
0
;
/* "= 0" is important */
memset
(
&
empty_t
,
0
,
sizeof
(
empty_t
));
/* Fill in complex INTEGER */
asn_long2INTEGER
(
&
empty_t
.
unsigned33
,
0
);
asn_enc_rval_t
er
=
oer_encode_to_buffer
(
&
asn_DEF_T
,
0
,
&
empty_t
,
tmpbuf
,
sizeof
(
tmpbuf
));
assert
(
er
.
encoded
!=
-
1
);
asn_dec_rval_t
dr
=
oer_decode
(
0
,
&
asn_DEF_T
,
(
void
**
)
&
decoded_t
,
tmpbuf
,
er
.
encoded
);
assert
(
dr
.
code
==
RC_OK
);
if
(
dr
.
consumed
!=
er
.
encoded
)
{
ASN_DEBUG
(
"Consumed %zu, expected %zu"
,
dr
.
consumed
,
er
.
encoded
);
assert
(
dr
.
consumed
==
er
.
encoded
);
}
fprintf
(
stderr
,
"Original:
\n
"
);
xer_fprint
(
stderr
,
&
asn_DEF_T
,
&
empty_t
);
fprintf
(
stderr
,
"Decoded:
\n
"
);
xer_fprint
(
stderr
,
&
asn_DEF_T
,
decoded_t
);
return
0
;
}
tests/135-oer-short-OK.asn1
0 → 100644
View file @
6db40f4c
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .135
ModuleOERShort
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 135 }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- Supported only on 64-bit platforms.
T ::= SEQUENCE {
unsigned8 [0] INTEGER (0..255), -- OER 1 byte
unsigned16 [1] INTEGER (0..65535), -- OER 2 bytes
unsigned16stack [2] INTEGER (0..32767)(0..255), -- OER 1 byte
unsigned16stack-ext [15] INTEGER (0..32767)(0..255,...), -- OER 2 bytes
...,
signed8 [10] INTEGER (-128..127) DEFAULT 3, -- OER 1 byte
signed16 [11] INTEGER (-32768..32767), -- OER 2 bytes
signed16stack [12] INTEGER (-32768..32767)(-128..127), -- OER 1 byte
signed16stack-ext [5] INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
signed32 [7] INTEGER (-2000000000..2000000000), -- OER 4 bytes
...,
minmax [6] INTEGER (MIN..MAX) OPTIONAL
}
END
tests/136-oer-long-OK.asn1
0 → 100644
View file @
6db40f4c
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .136
ModuleOERLong
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 136 }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- Supported only on 64-bit platforms.
T ::= SEQUENCE {
unsigned8 [0] INTEGER (0..255), -- OER 1 byte
unsigned16 [1] INTEGER (0..65535), -- OER 2 bytes
unsigned16stack [2] INTEGER (0..32767)(0..255), -- OER 1 byte
unsigned16stack-ext [15] INTEGER (0..32767)(0..255,...), -- OER 2 bytes
unsigned33 [3] INTEGER (0..5000000000), -- OER 8 bytes
...,
signed8 [10] INTEGER (-128..127) DEFAULT 3, -- OER 1 byte
signed16 [11] INTEGER (-32768..32767), -- OER 2 bytes
signed16stack [12] INTEGER (-32768..32767)(-128..127), -- OER 1 byte
signed16stack-ext [5] INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
signed32 [7] INTEGER (-2000000000..2000000000), -- OER 4 bytes
signed33ext [8] INTEGER (-4000000000..4000000000,...),-- OER vrble
...,
minmax [6] INTEGER (MIN..MAX) OPTIONAL
}
END
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