diff options
author | Björn Gustavsson <[email protected]> | 2014-09-02 13:16:53 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-01-12 11:40:24 +0100 |
commit | 33b19f4ed08f84459ed762dbb50ea0cf148ebfd3 (patch) | |
tree | b52738b8a711fddf218bfa16df02335a865d6a9c /lib/asn1/test/testInfObjExtract.erl | |
parent | 8e43bffda5069aecdd2375eb409e9c03b7ff692b (diff) | |
download | otp-33b19f4ed08f84459ed762dbb50ea0cf148ebfd3.tar.gz otp-33b19f4ed08f84459ed762dbb50ea0cf148ebfd3.tar.bz2 otp-33b19f4ed08f84459ed762dbb50ea0cf148ebfd3.zip |
Rewrite matching of object definitions using the simplified syntax
Rewrite the confusing and buggy matching of an object definition
against the simplified syntax.
While we are at it, we will also add proper error handling.
Diffstat (limited to 'lib/asn1/test/testInfObjExtract.erl')
-rw-r--r-- | lib/asn1/test/testInfObjExtract.erl | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/asn1/test/testInfObjExtract.erl b/lib/asn1/test/testInfObjExtract.erl index 4e148824fe..d3ea368391 100644 --- a/lib/asn1/test/testInfObjExtract.erl +++ b/lib/asn1/test/testInfObjExtract.erl @@ -23,17 +23,31 @@ -export([main/0]). main() -> - roundtrip('DataSeq-1', {'DataSeq-1',1,true}), - roundtrip('DataSeq-1', {'DataSeq-1',2,<<"abc">>}), - roundtrip('DataSeq-1', {'DataSeq-1',3,<<42:5>>}), - roundtrip_error('DataSeq-1', {'DataSeq-1',4,42}), - - roundtrip('DataSeq-2', {'DataSeq-2',1,true}), - roundtrip_error('DataSeq-2', {'DataSeq',2,<<"abc">>}), - roundtrip_error('DataSeq-2', {'DataSeq',3,<<42:5>>}), - roundtrip_error('DataSeq-2', {'DataSeq',999,42}), + roundtrip_data_object_13('DataSeq-1'), + + roundtrip_data_object_1('DataSeq-2'), + roundtrip_data_object_1('DataSeq-3'), + roundtrip_data_object_1('DataSeq-4'), + + roundtrip_data_object_13('DataSeq-5'), + roundtrip_data_object_13('DataSeq-6'), + ok. +roundtrip_data_object_13(SeqType) -> + roundtrip(SeqType, {SeqType,1,true}), + roundtrip(SeqType, {SeqType,2,<<"abc">>}), + roundtrip(SeqType, {SeqType,3,<<42:5>>}), + roundtrip_error(SeqType, {SeqType,4,42}). + +roundtrip_data_object_1(SeqType) -> + roundtrip(SeqType, {SeqType,1,false}), + roundtrip(SeqType, {SeqType,1,true}), + roundtrip_error(SeqType, {SeqType,1,42}), + roundtrip_error(SeqType, {SeqType,2,<<"abc">>}), + roundtrip_error(SeqType, {SeqType,3,<<42:5>>}), + roundtrip_error(SeqType, {SeqType,999,42}). + roundtrip(T, V) -> asn1_test_lib:roundtrip('InfObjExtract', T, V). |