aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/ValueTest.asn
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-09-22 14:21:55 +0200
committerBjörn Gustavsson <[email protected]>2015-01-12 11:40:24 +0100
commitb92e491aa5bfbaefb0f938bbb245a580837cb8c8 (patch)
tree23d176c1983dd35a25d398b7ab29ef62afc82788 /lib/asn1/test/asn1_SUITE_data/ValueTest.asn
parentd73a835b66911935024019fd55089a1e0f7a81d2 (diff)
downloadotp-b92e491aa5bfbaefb0f938bbb245a580837cb8c8.tar.gz
otp-b92e491aa5bfbaefb0f938bbb245a580837cb8c8.tar.bz2
otp-b92e491aa5bfbaefb0f938bbb245a580837cb8c8.zip
Refactor code involving calls to get_fieldname_element/3
Refactor and clean up code. While at it, add error handling and test cases. (Also add test cases for the existing values in ValueTest.asn while we are it.) Add support for defining INTEGER constants by extracting fields from objects. Example: int-from-object INTEGER ::= object.&id When extracting values from objects in constraints, only one level of extraction would work. That is, the following would work: SomeName ::= INTEGER (object.&int) but not: SomeName ::= INTEGER (object.&obj.&int)
Diffstat (limited to 'lib/asn1/test/asn1_SUITE_data/ValueTest.asn')
-rw-r--r--lib/asn1/test/asn1_SUITE_data/ValueTest.asn22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/ValueTest.asn b/lib/asn1/test/asn1_SUITE_data/ValueTest.asn
index 8db2fcf17d..51da9d8afb 100644
--- a/lib/asn1/test/asn1_SUITE_data/ValueTest.asn
+++ b/lib/asn1/test/asn1_SUITE_data/ValueTest.asn
@@ -1,4 +1,4 @@
-ValueTest DEFINITIONS ::=
+ValueTest DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
@@ -41,7 +41,6 @@ objectdescriptor ObjectDescriptor ::= "ObjectDescriptor"
graphicstring GraphicString ::= "GraphicString"
generalstring GeneralString ::= "GeneralString"
bmpstring1 BMPString ::= "BMPString"
---bmpstring2 BMPString ::= [{0,0,0,66},{0,0,0,77},{0,0,0,80},{0,0,0,115},{0,0,0,116},{0,0,0,114},{0,0,0,105},{0,0,0,110},{0,0,0,103}]
latinCapitalLetterA UniversalString ::= {0,0,0,65}
greekCapitalLetterSigma UniversalString ::= {0,0,3,145}
my-universalstring UniversalString ::= {"This is a capital A: ",
@@ -61,4 +60,23 @@ someInteger INTEGER ::= 42
integerSeq1 IntegerSeq ::= { a otherInteger }
otherInteger INTEGER ::= someInteger
+--
+-- Values from objects.
+--
+int-from-object-1 INTEGER ::= int-holder-2.&obj.&id
+int-from-object-2 INTEGER ::= int-holder-2.&id
+
+INT-HOLDER ::= CLASS {
+ &id INTEGER UNIQUE,
+ &obj INT-HOLDER OPTIONAL
+} WITH SYNTAX {
+ ID &id
+ [OBJ &obj]
+}
+
+int-holder-1 INT-HOLDER ::= { ID 2 }
+int-holder-2 INT-HOLDER ::= { ID 4 OBJ int-holder-1 }
+
+II ::= INTEGER (int-from-object-1..int-from-object-2)
+
END