diff options
author | Björn Gustavsson <[email protected]> | 2014-10-13 15:59:27 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-01-12 11:40:24 +0100 |
commit | 8e43bffda5069aecdd2375eb409e9c03b7ff692b (patch) | |
tree | e4728d73b01d4f40d32a7048c7c8185857105074 /lib/asn1/test/error_SUITE.erl | |
parent | 56ab55449e38de8b28df5e2b7e3e6bbebfecd1ba (diff) | |
download | otp-8e43bffda5069aecdd2375eb409e9c03b7ff692b.tar.gz otp-8e43bffda5069aecdd2375eb409e9c03b7ff692b.tar.bz2 otp-8e43bffda5069aecdd2375eb409e9c03b7ff692b.zip |
Simplify handling of an empty object definition
When the parser sees:
something SOMETHING ::= {}
it has no way of knowing whether 'something' is an value or an
object. It depends on how SOMETHING is defined. For example:
SOMETHING ::= SEQUENCE {}
or
SOMETHING ::= CLASS { &id OPTIONAL }
Because of that ambiguity, there is no way to avoid a special case
when we check an object definition. However, there is no need to
invent an entire new checking function for this special case. It is
much easier to just pretend that the parser gave us
{object,defaultsyntax,[]} and let check_objectdefn/3 check it in the
usual way.
Diffstat (limited to 'lib/asn1/test/error_SUITE.erl')
-rw-r--r-- | lib/asn1/test/error_SUITE.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl index 630daf75c6..f03c2eab16 100644 --- a/lib/asn1/test/error_SUITE.erl +++ b/lib/asn1/test/error_SUITE.erl @@ -227,6 +227,7 @@ objects(Config) -> " obj3 CL ::= { &Data OCTET STRING }\n" " obj4 SMALL ::= { &code 42 }\n" " InvalidSet CL ::= { obj1 }\n" + " obj5 CL ::= {}\n" " CL ::= CLASS {\n" " &code INTEGER UNIQUE,\n" @@ -255,7 +256,11 @@ objects(Config) -> {structured_error,{M,5},asn1ct_check, {missing_mandatory_fields,[i],obj4}}, {structured_error,{M,6},asn1ct_check, - {invalid_fields,[wrong],'InvalidSet'}} + {invalid_fields,[wrong],'InvalidSet'}}, + {structured_error,{M,7},asn1ct_check, + {missing_mandatory_fields, + ['Data','Set','VarTypeValue',code,enum,object, + vartypevalue],obj5}} ] } = run(P, Config), ok. |