4
%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
20
-module(testParamBasic).
23
-export([compile_der/2]).
26
-include("test_server.hrl").
28
-record('T11',{number, string=asn1_DEFAULT}).
29
-record('T12',{number, string=asn1_DEFAULT}).
30
-record('T21',{number, string}).
31
-record('T22',{number, string}).
34
compile(Config,Rules,Options) ->
36
?line DataDir = ?config(data_dir,Config),
37
?line OutDir = ?config(priv_dir,Config),
38
?line true = code:add_patha(?config(priv_dir,Config)),
39
?line ok = asn1ct:compile(DataDir ++ "ParamBasic",
40
[Rules,{outdir,OutDir}]++Options).
42
compile_der(Config,Rules) ->
43
?line DataDir = ?config(data_dir,Config),
44
?line OutDir = ?config(priv_dir,Config),
45
?line true = code:add_patha(?config(priv_dir,Config)),
46
?line ok = asn1ct:compile(DataDir ++ "ParamBasic",
47
[der,Rules,{outdir,OutDir}]).
52
asn1_wrapper:encode('ParamBasic','T11',
55
?line {ok,{'T11',11,"hello"}} =
56
asn1_wrapper:decode('ParamBasic','T11',Bytes11),
59
asn1_wrapper:encode('ParamBasic','T12',
61
string = [1,0,1,0,1]}),
62
?line {ok,{'T12',11,[1,0,1,0,1]}} =
63
asn1_wrapper:decode('ParamBasic','T12',Bytes12),
66
asn1_wrapper:encode('ParamBasic','T21',
69
?line {ok,{'T21',11,"hello"}} =
70
asn1_wrapper:decode('ParamBasic','T21',Bytes13),
73
asn1_wrapper:encode('ParamBasic','T22',
75
string = [1,0,1,0,1]}),
76
?line {ok,{'T22',11,[1,0,1,0,1]}} =
77
asn1_wrapper:decode('ParamBasic','T22',Bytes14),
82
?line {ok,[48,3,128,1,11]} =
83
asn1_wrapper:encode('ParamBasic','T11',
86
?line {ok,{'T11',11,"hej"}} =
87
asn1_wrapper:decode('ParamBasic','T11',[48,3,128,1,11]),
89
?line {ok,[48,3,128,1,11]} =
90
asn1_wrapper:encode('ParamBasic','T12',
94
?line {ok,{'T12',11,[1,0,1,0]}} =
95
asn1_wrapper:decode('ParamBasic','T12',[48,3,128,1,11]);