aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-02-25 11:36:01 +0100
committerBjörn Gustavsson <[email protected]>2014-02-28 11:57:05 +0100
commite45fb925416ae43a3956366bf015aa74b77b7cfe (patch)
tree8d696ad8cb750bfc5e91d338d688d55957122fcb /lib/asn1/test
parent7505ac9334c0e0a62dd81f9e0fdee8a1a5a7eb01 (diff)
downloadotp-e45fb925416ae43a3956366bf015aa74b77b7cfe.tar.gz
otp-e45fb925416ae43a3956366bf015aa74b77b7cfe.tar.bz2
otp-e45fb925416ae43a3956366bf015aa74b77b7cfe.zip
asn1ct_check: Clean up error checking for INSTANCE OF
This will also eliminate a dialyzer warning for unmatched returns, and increase the coverage.
Diffstat (limited to 'lib/asn1/test')
-rw-r--r--lib/asn1/test/asn1_SUITE_data/INSTANCEOF.asn14
-rw-r--r--lib/asn1/test/error_SUITE.erl22
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/INSTANCEOF.asn1 b/lib/asn1/test/asn1_SUITE_data/INSTANCEOF.asn1
index 8c4f3a8f7e..b4ea943040 100644
--- a/lib/asn1/test/asn1_SUITE_data/INSTANCEOF.asn1
+++ b/lib/asn1/test/asn1_SUITE_data/INSTANCEOF.asn1
@@ -16,7 +16,9 @@ Names ::= SEQUENCE {
thirdName [2] INSTANCE OF OTHER-NAME ({TI})
}
-OTHER-NAME ::= TYPE-IDENTIFIER
+OTHER-NAME ::= YET-ANOTHER-NAME
+
+YET-ANOTHER-NAME ::= TYPE-IDENTIFIER
TI OTHER-NAME ::= {{INTEGER IDENTIFIED BY {2 4}} |
{Seq IDENTIFIED BY {2 3 4}} |
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index 2e4863301f..09327f6e12 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -19,7 +19,8 @@
-module(error_SUITE).
-export([suite/0,all/0,groups/0,
- already_defined/1,bitstrings/1,enumerated/1,integers/1,objects/1,values/1]).
+ already_defined/1,bitstrings/1,enumerated/1,
+ instance_of/1,integers/1,objects/1,values/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -33,6 +34,7 @@ groups() ->
[already_defined,
bitstrings,
enumerated,
+ instance_of,
integers,
objects,
values]}].
@@ -117,6 +119,23 @@ enumerated(Config) ->
} = run(P, Config),
ok.
+instance_of(Config) ->
+ M = 'InstanceOf',
+ P = {M,
+ <<"InstanceOf DEFINITIONS AUTOMATIC TAGS ::= BEGIN\n"
+ "XX ::= INSTANCE OF CL ({TI})\n"
+ "CL ::= CLASS {\n"
+ "&id INTEGER,\n"
+ "&Type\n"
+ "}\n"
+ "o1 CL ::= {&id 1, &Type OCTET STRING}\n"
+ "TI CL ::= { o1 }\n"
+ "END\n">>},
+ {error,
+ [{structured_error,{M,2},asn1ct_check,{illegal_instance_of,'CL'}}
+ ]} = run(P, Config),
+ ok.
+
integers(Config) ->
M = 'Integers',
P = {M,
@@ -132,6 +151,7 @@ integers(Config) ->
]} = run(P, Config),
ok.
+
objects(Config) ->
M = 'Objects',
P = {M,