aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-10-17 12:48:40 +0200
committerBjörn Gustavsson <[email protected]>2015-01-12 11:40:25 +0100
commit572b880ce6ad60ca0ad63aa9b4f8da01702834cf (patch)
tree051aca2a55819b0fd8423833ad713d94abec6d6d /lib/asn1/test
parent2b7c2f721034560dae0ef3120c6dc276a906f71f (diff)
downloadotp-572b880ce6ad60ca0ad63aa9b4f8da01702834cf.tar.gz
otp-572b880ce6ad60ca0ad63aa9b4f8da01702834cf.tar.bz2
otp-572b880ce6ad60ca0ad63aa9b4f8da01702834cf.zip
Check more errors in the simplified syntax
An optional group must not contain mandatory class fields. All mandatory fields must be included in the simplified syntax.
Diffstat (limited to 'lib/asn1/test')
-rw-r--r--lib/asn1/test/error_SUITE.erl46
1 files changed, 44 insertions, 2 deletions
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index f718847c9c..4534abc0c4 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -471,6 +471,38 @@ syntax(Config) ->
" BAD &Bad\n"
" }\n"
+ " BAD-SYNTAX-3 ::= CLASS {\n"
+ " &code INTEGER UNIQUE\n"
+ " } WITH SYNTAX {\n"
+ " [ID &code]\n"
+ " }\n"
+
+ " BAD-SYNTAX-4 ::= CLASS {\n"
+ " &code INTEGER UNIQUE\n"
+ " } WITH SYNTAX {\n"
+ " ID\n"
+ " }\n"
+
+ " BAD-SYNTAX-5 ::= CLASS {\n"
+ " &code INTEGER UNIQUE,\n"
+ " &Type\n"
+ " } WITH SYNTAX {\n"
+ " ID\n"
+ " }\n"
+
+ " BAD-SYNTAX-6 ::= CLASS {\n"
+ " &code INTEGER UNIQUE\n"
+ " } WITH SYNTAX {\n"
+ " ID &code, &code\n"
+ " }\n"
+
+ " BAD-SYNTAX-7 ::= CLASS {\n"
+ " &code INTEGER UNIQUE,\n"
+ " &Type\n"
+ " } WITH SYNTAX {\n"
+ " ID &Type, &code, &code, &Type\n"
+ " }\n"
+
" CL ::= CLASS {\n"
" &code INTEGER UNIQUE,\n"
" &enum ENUMERATED { a, b, c} OPTIONAL,\n"
@@ -531,8 +563,18 @@ syntax(Config) ->
{structured_error,{M,22},asn1ct_check,
{syntax_undefined_field,bad}},
{structured_error,{M,27},asn1ct_check,
- {syntax_undefined_field,'Bad'}}
- ]
+ {syntax_undefined_field,'Bad'}},
+ {structured_error,{M,32},asn1ct_check,
+ {syntax_mandatory_in_optional_group,code}},
+ {structured_error,{M,37},asn1ct_check,
+ {syntax_missing_mandatory_fields,[code]}},
+ {structured_error,{M,42},asn1ct_check,
+ {syntax_missing_mandatory_fields,['Type',code]}},
+ {structured_error,{M,48},asn1ct_check,
+ {syntax_duplicated_fields,[code]}},
+ {structured_error,{M,53},asn1ct_check,
+ {syntax_duplicated_fields,['Type',code]}}
+ ]
} = run(P, Config),
ok.