aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/testNBAPsystem.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-09-13 12:56:06 +0200
committerBjörn Gustavsson <[email protected]>2013-09-18 11:45:01 +0200
commitb379d700e1450a3fc7e76bb75369fa6b5eb2d327 (patch)
tree88a7ef2503b735b8cf8f51444e472facbcc2db5a /lib/asn1/test/testNBAPsystem.erl
parentb8f57af261d72f9f078ddf7190201209dd846d53 (diff)
downloadotp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.tar.gz
otp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.tar.bz2
otp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.zip
Eliminate the use of asn1_wrapper
The asn1_wrapper made some sense when encode functions could either produce a list or a binary, depending on the backend. Now encode functions always produce a binary. To improve readbility of the test suites, eliminate the asn1_wrapper functions by replacing them with calls to one of the roundtrip functions in asn1_test_lib. When it is not possible to use the roundtrip functions, call the module in question directly. While at it, also remove ?line macros that are near to the touched code and use asn1_test_lib:hex_to_bin/1 instead of home-brewn hex conversion routines.
Diffstat (limited to 'lib/asn1/test/testNBAPsystem.erl')
-rw-r--r--lib/asn1/test/testNBAPsystem.erl23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl
index 794bf46daa..57cb483374 100644
--- a/lib/asn1/test/testNBAPsystem.erl
+++ b/lib/asn1/test/testNBAPsystem.erl
@@ -96,23 +96,16 @@ test(_Erule,Config) ->
ticket_5812(Config) ->
?line Msg = v_5812(),
- ?line {ok,B2} = asn1_wrapper:encode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- Msg),
+ {ok,B2} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg),
V = <<0,28,74,0,3,48,0,0,1,0,123,64,41,0,0,0,126,64,35,95,208,2,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,145,0,1,205,0,0,0,0,2,98,64,1,128>>,
?line ok = compare(V,B2),
- ?line {ok,Msg2} = asn1_wrapper:decode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',B2),
+ {ok,Msg2} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B2),
?line ok = check_record_names(Msg2,Config).
enc_audit_req_msg() ->
Msg = {initiatingMessage, audit_req_msg()},
- ?line {ok,B}=asn1_wrapper:encode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- Msg),
- ?line {ok,_Msg}=asn1_wrapper:decode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- B),
+ {ok,B} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg),
+ {ok,_Msg} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B),
?line {initiatingMessage,
#'InitiatingMessage'{value=#'AuditRequest'{protocolIEs=[{_,114,ignore,_}],
protocolExtensions = asn1_NOVALUE}}} = _Msg,
@@ -121,12 +114,8 @@ enc_audit_req_msg() ->
cell_setup_req_msg_test() ->
Msg = {initiatingMessage, cell_setup_req_msg()},
- ?line {ok,B}=asn1_wrapper:encode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- Msg),
- ?line {ok,_Msg}=asn1_wrapper:decode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- B),
+ {ok,B} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg),
+ {ok,_Msg} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B),
io:format("Msg: ~P~n~n_Msg: ~P~n",[Msg,15,_Msg,15]),
ok.