aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/error_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-07-10 15:55:17 +0200
committerBjörn Gustavsson <[email protected]>2013-08-30 10:13:17 +0200
commit6b4c51b72dd5b17c26c624f09e88e038d7edfcb5 (patch)
tree4fcc17011d86f857be67a21a64a14ac545e2a4bd /lib/asn1/test/error_SUITE.erl
parent8fb5a3b6241a988c80dc1faac9bfb396c1aa32b7 (diff)
downloadotp-6b4c51b72dd5b17c26c624f09e88e038d7edfcb5.tar.gz
otp-6b4c51b72dd5b17c26c624f09e88e038d7edfcb5.tar.bz2
otp-6b4c51b72dd5b17c26c624f09e88e038d7edfcb5.zip
Clean up checking of objects
Diffstat (limited to 'lib/asn1/test/error_SUITE.erl')
-rw-r--r--lib/asn1/test/error_SUITE.erl47
1 files changed, 45 insertions, 2 deletions
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index a94a6d95a0..6451f81c01 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -19,7 +19,7 @@
-module(error_SUITE).
-export([suite/0,all/0,groups/0,
- already_defined/1,enumerated/1]).
+ already_defined/1,enumerated/1,objects/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -30,7 +30,8 @@ all() ->
groups() ->
[{p,parallel(),[already_defined,
- enumerated]}].
+ enumerated,
+ objects]}].
parallel() ->
case erlang:system_info(schedulers) > 1 of
@@ -95,6 +96,48 @@ enumerated(Config) ->
} = run(P, Config),
ok.
+objects(Config) ->
+ M = 'Objects',
+ P = {M,
+ <<"Objects DEFINITIONS AUTOMATIC TAGS ::= BEGIN\n"
+ " obj1 CL ::= { &wrong 42 }\n"
+ " obj2 CL ::= { &wrong 1, &Wrong INTEGER }\n"
+ " obj3 CL ::= { &Data OCTET STRING }\n"
+ " obj4 SMALL ::= { &code 42 }\n"
+ " InvalidSet CL ::= { obj1 }\n"
+
+ " CL ::= CLASS {\n"
+ " &code INTEGER UNIQUE,\n"
+ " &enum ENUMERATED { a, b, c},\n"
+ " &Data,\n"
+ " &object CL,\n"
+ " &Set CL,\n"
+ " &vartypevalue &Data,\n"
+ " &VarTypeValue &Data\n"
+ " }\n"
+
+ " SMALL ::= CLASS {\n"
+ " &code INTEGER UNIQUE,\n"
+ " &i INTEGER\n"
+ " }\n"
+ "END\n">>},
+ {error,
+ [
+ {structured_error,{M,2},asn1ct_check,
+ {invalid_fields,[wrong],obj1}},
+ {structured_error,{M,3},asn1ct_check,
+ {invalid_fields,['Wrong',wrong],obj2}},
+ {structured_error,{M,4},asn1ct_check,
+ {missing_mandatory_fields,['Set','VarTypeValue',code,
+ enum,object,vartypevalue],obj3}},
+ {structured_error,{M,5},asn1ct_check,
+ {missing_mandatory_fields,[i],obj4}},
+ {structured_error,{M,6},asn1ct_check,
+ {invalid_fields,[wrong],'InvalidSet'}}
+ ]
+ } = run(P, Config),
+ ok.
+
run({Mod,Spec}, Config) ->