aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/testSetOptional.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-12-13 15:16:46 +0100
committerBjörn Gustavsson <[email protected]>2012-12-17 17:23:51 +0100
commitaa80ef4b708705187296578c702208a1c7bc0a05 (patch)
tree05940432885b1336bd7098510f3a22b52851c301 /lib/asn1/test/testSetOptional.erl
parent32cf2c76b94baf02cc8eea63f24cc4afda39025e (diff)
downloadotp-aa80ef4b708705187296578c702208a1c7bc0a05.tar.gz
otp-aa80ef4b708705187296578c702208a1c7bc0a05.tar.bz2
otp-aa80ef4b708705187296578c702208a1c7bc0a05.zip
testSetOptional: Correct test case for decoding of corrupt data
Eliminate the spawning of the process since the original bug is fixed.
Diffstat (limited to 'lib/asn1/test/testSetOptional.erl')
-rw-r--r--lib/asn1/test/testSetOptional.erl21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/asn1/test/testSetOptional.erl b/lib/asn1/test/testSetOptional.erl
index cef90bc843..d40dc87110 100644
--- a/lib/asn1/test/testSetOptional.erl
+++ b/lib/asn1/test/testSetOptional.erl
@@ -21,7 +21,7 @@
-include("External.hrl").
-export([main/1]).
--export([ticket_7533/1,decoder/4]).
+-export([ticket_7533/1]).
-include_lib("test_server/include/test_server.hrl").
-record('SetOpt1',{bool1 = asn1_NOVALUE, int1, set1 = asn1_NOVALUE}).
@@ -186,21 +186,8 @@ ticket_7533(Ber) when Ber == ber ->
?line {ok,B} = asn1_wrapper:encode('SetOptional','SetOpt1',Val),
?line {ok,Val} = asn1_wrapper:decode('SetOptional','SetOpt1',B),
- CorruptVal = [49,14,1,1,255,2,1,12] ++ lists:duplicate(8,0),
- Pid = spawn(?MODULE,decoder,[self(),'SetOptional','SetOpt1',CorruptVal]),
- receive
- {ok,Pid,Result} ->
- io:format("Decode result: ~p~n",[Result]),
- ok
- after 10000 ->
- io:format("Decode timeout~n",[]),
- exit(Pid,normal)
- end;
+ CorruptVal = <<49,14,1,1,255,2,1,12,0:8/unit:8>>,
+ {error,_} = 'SetOptional':decode('SetOpt1', CorruptVal),
+ ok;
ticket_7533(_) ->
ok.
-
-decoder(Parent,Module,Type,Val) ->
- io:format("Decoding~n",[]),
- ?line {ok,Res} = asn1_wrapper:decode(Module,Type,Val),
- io:format("Decode res: ~p~n",[Res]),
- Parent ! {ok,self(),Res}.