diff options
author | Björn Gustavsson <[email protected]> | 2013-09-11 10:48:49 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-09-18 11:45:00 +0200 |
commit | 233089914b1d70c0b0ddc46b1977998aa4bd3780 (patch) | |
tree | 497aab1c757bf252f0a0b1d0fbde449ccaa0b0fc /lib/asn1/test/testConstraints.erl | |
parent | 973fae5673fee766fd5477fbf3663b2722cab9d7 (diff) | |
download | otp-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/testConstraints.erl')
-rw-r--r-- | lib/asn1/test/testConstraints.erl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl index 03a09492af..ed0cae0076 100644 --- a/lib/asn1/test/testConstraints.erl +++ b/lib/asn1/test/testConstraints.erl @@ -216,14 +216,10 @@ roundtrip(Type, Value) -> roundtrip('Constraints', Type, Value). roundtrip(Module, Type, Value) -> - {ok,Encoded} = Module:encode(Type, Value), - {ok,Value} = Module:decode(Type, Encoded), - Encoded. + asn1_test_lib:roundtrip_enc(Module, Type, Value). roundtrip_enc(Type, Value, Enc) -> - Module = 'Constraints', - {ok,Encoded} = Module:encode(Type, Value), - {ok,Value} = Module:decode(Type, Encoded), + Encoded = asn1_test_lib:roundtrip_enc('Constraints', Type, Value), case Enc of none -> ok; Encoded -> ok |