4
%% Copyright Ericsson AB 2004-2010. 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(test_undecoded_rest).
22
-export([compile/3,test/1]).
24
-include_lib("test_server/include/test_server.hrl").
29
compile(Config,Rules,Opt) ->
31
?line DataDir = ?config(data_dir,Config),
32
?line OutDir = ?config(priv_dir,Config),
33
?line true = code:add_patha(?config(priv_dir,Config)),
35
?line ok = asn1ct:compile(DataDir ++ "P-Record",[Rules,{outdir,OutDir}]++Opt).
39
?line {ok,Msg} = asn1ct:value('P-Record','PersonnelRecord'),
40
?line {ok,Bytes} = asn1_wrapper:encode('P-Record','PersonnelRecord',Msg),
42
fun(B) when is_list(B) ->
44
(B) when is_binary(B) ->
45
iolist_to_binary([B,<<55,55,55>>])
50
?line {ok,Msg,R}=asn1_wrapper:decode('P-Record','PersonnelRecord',
55
BStr when is_bitstring(BStr) ->
56
PadLen = (8 - (bit_size(BStr) rem 8)) rem 8,
57
case <<0:PadLen,BStr/bitstring>> of
62
?line {ok,Msg} = asn1_wrapper:decode('P-Record','PersonnelRecord',