aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/testSeqExtension.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-09-11 10:48:49 +0200
committerBjörn Gustavsson <[email protected]>2013-09-18 11:45:00 +0200
commit233089914b1d70c0b0ddc46b1977998aa4bd3780 (patch)
tree497aab1c757bf252f0a0b1d0fbde449ccaa0b0fc /lib/asn1/test/testSeqExtension.erl
parent973fae5673fee766fd5477fbf3663b2722cab9d7 (diff)
downloadotp-233089914b1d70c0b0ddc46b1977998aa4bd3780.tar.gz
otp-233089914b1d70c0b0ddc46b1977998aa4bd3780.tar.bz2
otp-233089914b1d70c0b0ddc46b1977998aa4bd3780.zip
asn1_test_lib: Add roundtrip functions and use them everywhere
Even if the roundtrip functions are very simply, putting them here makes it possible to change its behavior in one place (e.g. if we are to change encode and decode not to wrap the result in a ok tuple in some future release).
Diffstat (limited to 'lib/asn1/test/testSeqExtension.erl')
-rw-r--r--lib/asn1/test/testSeqExtension.erl8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/asn1/test/testSeqExtension.erl b/lib/asn1/test/testSeqExtension.erl
index b996634996..8473459c36 100644
--- a/lib/asn1/test/testSeqExtension.erl
+++ b/lib/asn1/test/testSeqExtension.erl
@@ -108,18 +108,14 @@ main(Erule, DataDir, Opts) ->
ok.
roundtrip(Type, Value) ->
- {ok,Encoded} = 'SeqExtension':encode(Type, Value),
- {ok,Value} = 'SeqExtension':decode(Type, Encoded),
- ok.
+ asn1_test_lib:roundtrip('SeqExtension', Type, Value).
v_roundtrip2(Erule, Type, Value) ->
Encoded = asn1_test_lib:hex_to_bin(v(Erule, Type)),
Encoded = roundtrip2(Type, Value).
roundtrip2(Type, Value) ->
- {ok,Encoded} = 'SeqExtension2':encode(Type, Value),
- {ok,Value} = 'SeqExtension2':decode(Type, Encoded),
- Encoded.
+ asn1_test_lib:roundtrip_enc('SeqExtension2', Type, Value).
v(ber, 'SeqExt66') -> "30049F41 017D";
v(per, 'SeqExt66') -> "C0420000 00000000 00004001 FA";