1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20%%
21-module(test_x691).
22-export([cases/1]).
23
24-include_lib("common_test/include/ct.hrl").
25
26cases(Erule) ->
27    _ = [begin
28	     Mod = module(Name),
29	     Msg = msg(Name),
30	     Hex = encval(Name, Erule),
31	     Enc = asn1_test_lib:hex_to_bin(Hex),
32	     Enc = asn1_test_lib:roundtrip_enc(Mod, 'PersonnelRecord', Msg)
33	 end || Name <- [a1,a2,a3]],
34    ok.
35
36module(a1) -> 'P-RecordA1';
37module(a2) -> 'P-RecordA2';
38module(a3) -> 'P-RecordA3'.
39
40msg(a1) ->
41    {'PersonnelRecord',
42     {'Name',"John", "P", "Smith"},
43      "Director",
44      51,
45      "19710917",
46      {'Name', "Mary", "T", "Smith"},
47      [{'ChildInformation',
48	{'Name',  "Ralph", "T", "Smith"},
49	"19571111"},
50       {'ChildInformation',
51	{'Name', "Susan", "B", "Jones"},
52	"19590717"}]};
53msg(a2) ->
54    msg(a1);
55msg(a3) ->
56    {'PersonnelRecord',
57     {'Name',"John", "P", "Smith"},
58     "Director",
59     51,
60     "19710917",
61     {'Name', "Mary", "T", "Smith"},
62     [{'ChildInformation',
63       {'Name', "Ralph", "T", "Smith"},
64       "19571111",
65       asn1_NOVALUE},
66      {'ChildInformation',
67       {'Name', "Susan", "B", "Jones"},
68       "19590717",
69       female}]}.
70
71encval(a1, per) ->
72    "80044A6F 686E0150 05536D69 74680133 08446972 6563746F 72083139 37313039 3137044D 61727901 5405536D 69746802 0552616C 70680154 05536D69 74680831 39353731 31313105 53757361 6E014205 4A6F6E65 73083139 35393037 3137";
73encval(a1, uper) ->
74    "824ADFA3 700D005A 7B74F4D0 02661113 4F2CB8FA 6FE410C5 CB762C1C B16E0937 0F2F2035 0169EDD3 D340102D 2C3B3868 01A80B4F 6E9E9A02 18B96ADD 8B162C41 69F5E787 700C2059 5BF765E6 10C5CB57 2C1BB16E";
75encval(a2, per) ->
76    "864A6F68 6E501053 6D697468 01330844 69726563 746F7219 7109170C 4D617279 5410536D 69746802 1052616C 70685410 536D6974 68195711 11105375 73616E42 104A6F6E 65731959 0717";
77encval(a2, uper) ->
78    "865D51D2 888A5125 F1809984 44D3CB2E 3E9BF90C B8848B86 7396E8A8 8A5125F1 81089B93 D71AA229 4497C632 AE222222 985CE521 885D54C1 70CAC838 B8";
79encval(a3, per) ->
80    "40C04A6F 686E5008 536D6974 68000033 08446972 6563746F 72001971 0917034D 61727954 08536D69 74680100 52616C70 68540853 6D697468 00195711 11820053 7573616E 42084A6F 6E657300 19590717 010140";
81encval(a3, uper) ->
82    "40CBAA3A 5108A512 5F180330 889A7965 C7D37F20 CB8848B8 19CE5BA2 A114A24B E3011372 7AE35422 94497C61 95711118 22985CE5 21842EAA 60B832B2 0E2E0202 80".
83