mirror of https://gerrit.osmocom.org/asn1c
add OER INTEGER constraint check
This commit is contained in:
parent
b33425f16b
commit
b2284470f9
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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() {
|
||||
T_t t;
|
||||
|
||||
memset(&t, 0, sizeof(t));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
-- OK: Everything is fine
|
||||
-- Also see .127 for narrower integer types.
|
||||
|
||||
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
|
||||
-- .spelio.software.asn1c.test (9363.1.5.1)
|
||||
-- .134
|
||||
|
||||
ModuleOERLong
|
||||
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
|
||||
spelio(9363) software(1) asn1c(5) test(1) 135 }
|
||||
DEFINITIONS AUTOMATIC TAGS ::=
|
||||
BEGIN
|
||||
|
||||
-- Supported only on 64-bit platforms.
|
||||
T ::= SEQUENCE {
|
||||
unsigned8 INTEGER (0..255), -- OER 1 byte
|
||||
unsigned16 INTEGER (0..65535), -- OER 2 bytes
|
||||
unsigned16stack INTEGER (0..32767)(0..255), -- OER 1 byte
|
||||
unsigned16stack-ext INTEGER (0..32767)(0..255,...), -- OER 2 bytes
|
||||
unsigned33 INTEGER (0..5000000000), -- OER 8 bytes
|
||||
signed8 INTEGER (-128..127), -- OER 1 byte
|
||||
signed16 INTEGER (-32768..32767), -- OER 2 bytes
|
||||
signed16stack INTEGER (-32768..32767)(-128..127), -- OER 1 byte
|
||||
signed16stack-ext INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
|
||||
signed32 INTEGER (-2000000000..2000000000), -- OER 4 bytes
|
||||
signed33ext INTEGER (-4000000000..4000000000,...) -- OER vrble
|
||||
}
|
||||
|
||||
END
|
Loading…
Reference in New Issue