diff options
author | Björn Gustavsson <[email protected]> | 2014-02-25 11:36:01 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-02-28 11:57:05 +0100 |
commit | e45fb925416ae43a3956366bf015aa74b77b7cfe (patch) | |
tree | 8d696ad8cb750bfc5e91d338d688d55957122fcb /lib/asn1/test/error_SUITE.erl | |
parent | 7505ac9334c0e0a62dd81f9e0fdee8a1a5a7eb01 (diff) | |
download | otp-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/error_SUITE.erl')
-rw-r--r-- | lib/asn1/test/error_SUITE.erl | 22 |
1 files changed, 21 insertions, 1 deletions
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, |