4
%% Copyright Ericsson AB 1997-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(testSetExtension).
23
-include("External.hrl").
27
-include("test_server.hrl").
29
-record('SetExt1',{}).
30
-record('SetExt2',{bool, int}).
31
-record('SetExt3',{bool, int}).
32
-record('SetExt4',{bool, int}).
35
compile(Config,Rules,Options) ->
37
?line DataDir = ?config(data_dir,Config),
38
?line OutDir = ?config(priv_dir,Config),
39
?line true = code:add_patha(?config(priv_dir,Config)),
40
?line ok = asn1ct:compile(DataDir ++ "SetExtension",
41
[Rules,{outdir,OutDir}]++Options).
48
asn1_wrapper:encode('SetExtension','SetExt1',#'SetExt1'{}),
49
?line {ok,{'SetExt1'}} =
50
asn1_wrapper:decode('SetExtension','SetExt1',lists:flatten(Bytes11)),
53
asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{bool = true,int = 99}),
54
?line {ok,{'SetExt2',true,99}} =
55
asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(Bytes21)),
58
asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{int = 99,bool = true}),
59
?line {ok,{'SetExt2',true,99}} =
60
asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(Bytes22)),
63
asn1_wrapper:encode('SetExtension','SetExt3',#'SetExt3'{bool = true,int = 99}),
64
?line {ok,{'SetExt3',true,99}} =
65
asn1_wrapper:decode('SetExtension','SetExt3',lists:flatten(Bytes31)),
68
asn1_wrapper:encode('SetExtension','SetExt3',#'SetExt3'{int = 99,bool = true}),
69
?line {ok,{'SetExt3',true,99}} =
70
asn1_wrapper:decode('SetExtension','SetExt3',lists:flatten(Bytes32)),
73
asn1_wrapper:encode('SetExtension','SetExt4',#'SetExt4'{bool = true,int = 99}),
74
?line {ok,{'SetExt4',true,99}} =
75
asn1_wrapper:decode('SetExtension','SetExt4',lists:flatten(Bytes41)),
78
asn1_wrapper:encode('SetExtension','SetExt4',#'SetExt4'{int = 99,bool = true}),
79
?line {ok,{'SetExt4',true,99}} =
80
asn1_wrapper:decode('SetExtension','SetExt4',lists:flatten(Bytes42)),
83
%% Test of extension , needs to be improved and extended
86
asn1_wrapper:encode('SetExtension','SetExt1',#'SetExt1'{}),
87
?line {ok,{'SetExt1'}} =
88
asn1_wrapper:decode('SetExtension','SetExt1',lists:flatten(BytesX11)),
91
asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{bool = true,int = 99}),
92
?line {ok,{'SetExt2',true,99}} =
93
asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(BytesX21)),
96
asn1_wrapper:encode('SetExtension','SetExt2',#'SetExt2'{int = 99,bool = true}),
97
?line {ok,{'SetExt2',true,99}} =
98
asn1_wrapper:decode('SetExtension','SetExt2',lists:flatten(BytesX22)),