diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2013-03-12 08:35:48 +0100 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2013-03-12 08:49:12 +0100 |
commit | 5588449531f1a41d05e5d2d4fe5976db643a18e3 (patch) | |
tree | 8cbbc7f41ff0aac9fd0096af4e63de18d44aee91 /lib/asn1/test | |
parent | 7c1786ef06498a80f982aa08da30e3775184c5d3 (diff) | |
download | erlang-5588449531f1a41d05e5d2d4fe5976db643a18e3.tar.gz |
PER: Ensure that the complete encoding is at least one byte
If the encoding is empty (i.e. if a top-level type is single-valued
and therefore not encoding), the result should be a single zero
byte.
Diffstat (limited to 'lib/asn1/test')
-rw-r--r-- | lib/asn1/test/testPrim.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/asn1/test/testPrim.erl b/lib/asn1/test/testPrim.erl index 0d4427ba69..91fb9fffca 100644 --- a/lib/asn1/test/testPrim.erl +++ b/lib/asn1/test/testPrim.erl @@ -513,6 +513,14 @@ enum(Rules) -> case catch asn1_wrapper:encode('Prim','Enum',4) of Enum -> Enum end, ok end, + + case Rules of + Per when Per =:= per; Per =:= uper -> + {ok,<<0>>} = 'Prim':encode('SingleEnumVal', true), + {ok,<<0>>} = 'Prim':encode('SingleEnumValExt', true); + ber -> + ok + end, ok. |