diff options
Diffstat (limited to 'lib/asn1/test/testSetExtension.erl')
-rw-r--r-- | lib/asn1/test/testSetExtension.erl | 73 |
1 files changed, 13 insertions, 60 deletions
diff --git a/lib/asn1/test/testSetExtension.erl b/lib/asn1/test/testSetExtension.erl index e2ebb4bec8..4e2463326b 100644 --- a/lib/asn1/test/testSetExtension.erl +++ b/lib/asn1/test/testSetExtension.erl @@ -18,8 +18,6 @@ %% %% -module(testSetExtension). - - -include("External.hrl"). -export([main/1]). @@ -31,64 +29,19 @@ -record('SetExt4',{bool, int}). main(_Rules) -> - - ?line {ok,Bytes11} = - asn1_wrapper:encode('SetExtension','SetExt1',#'SetExt1'{}), - ?line {ok,{'SetExt1'}} = - asn1_wrapper:decode('SetExtension','SetExt1',lists:flatten(Bytes11)), - - ?line {ok,Bytes21} = - asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{bool = true,int = 99}), - ?line {ok,{'SetExt2',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(Bytes21)), - - ?line {ok,Bytes22} = - asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{int = 99,bool = true}), - ?line {ok,{'SetExt2',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(Bytes22)), - - ?line {ok,Bytes31} = - asn1_wrapper:encode('SetExtension','SetExt3',#'SetExt3'{bool = true,int = 99}), - ?line {ok,{'SetExt3',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt3',lists:flatten(Bytes31)), - - ?line {ok,Bytes32} = - asn1_wrapper:encode('SetExtension','SetExt3',#'SetExt3'{int = 99,bool = true}), - ?line {ok,{'SetExt3',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt3',lists:flatten(Bytes32)), - - ?line {ok,Bytes41} = - asn1_wrapper:encode('SetExtension','SetExt4',#'SetExt4'{bool = true,int = 99}), - ?line {ok,{'SetExt4',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt4',lists:flatten(Bytes41)), - - ?line {ok,Bytes42} = - asn1_wrapper:encode('SetExtension','SetExt4',#'SetExt4'{int = 99,bool = true}), - ?line {ok,{'SetExt4',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt4',lists:flatten(Bytes42)), - - - %% Test of extension , needs to be improved and extended - - ?line {ok,BytesX11} = - asn1_wrapper:encode('SetExtension','SetExt1',#'SetExt1'{}), - ?line {ok,{'SetExt1'}} = - asn1_wrapper:decode('SetExtension','SetExt1',lists:flatten(BytesX11)), - - ?line {ok,BytesX21} = - asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{bool = true,int = 99}), - ?line {ok,{'SetExt2',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(BytesX21)), - - ?line {ok,BytesX22} = - asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{int = 99,bool = true}), - ?line {ok,{'SetExt2',true,99}} = - asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(BytesX22)), - - - - - + roundtrip('SetExt1', #'SetExt1'{}), + roundtrip('SetExt2', #'SetExt2'{bool=true,int=99}), + roundtrip('SetExt2', #'SetExt2'{bool=true,int=99}), + roundtrip('SetExt3', #'SetExt3'{bool=true,int=99}), + roundtrip('SetExt3', #'SetExt3'{bool=true,int=99}), + roundtrip('SetExt4', #'SetExt4'{bool=true,int=99}), + roundtrip('SetExt4', #'SetExt4'{bool=true,int=99}), + roundtrip('SetExt1', #'SetExt1'{}), + roundtrip('SetExt2', #'SetExt2'{bool=true,int=99}), + roundtrip('SetExt2', #'SetExt2'{bool=true,int=99}), ok. +roundtrip(T, V) -> + asn1_test_lib:roundtrip('SetExtension', T, V). + |