1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 1997-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(testChoTypeRefSet).
22
23-export([set/1]).
24
25-include_lib("common_test/include/ct.hrl").
26
27-record('ChoSet', {setInt, setOs}).
28-record('ChoSetImp', {setInt, setOs}).
29-record('ChoSetExp', {setInt, setOs}).
30
31set(_Rules) ->
32    roundtrip('ChoTRset', {choSet,#'ChoSet'{setInt=88,
33					    setOs = <<"A string">>}}),
34    roundtrip('ChoTRset', {choSetI,#'ChoSet'{setInt=88,
35					     setOs = <<"A string">>}}),
36    roundtrip('ChoTRset', {choSetE,#'ChoSet'{setInt=88,
37					     setOs = <<"A string">>}}),
38    roundtrip('ChoTRset', {'choSet-I',#'ChoSetImp'{setInt=88,
39						   setOs = <<"A string">>}}),
40    roundtrip('ChoTRset', {'choSetI-I',#'ChoSetImp'{setInt=88,
41						    setOs = <<"A string">>}}),
42    roundtrip('ChoTRset', {'choSetE-I',#'ChoSetImp'{setInt=88,
43						    setOs = <<"A string">>}}),
44    roundtrip('ChoTRset', {'choSet-E',#'ChoSetExp'{setInt=88,
45						   setOs = <<"A string">>}}),
46    roundtrip('ChoTRset', {'choSetI-E',#'ChoSetExp'{setInt=88,
47						    setOs = <<"A string">>}}),
48    roundtrip('ChoTRset', {'choSetE-E',#'ChoSetExp'{setInt=88,
49						    setOs = <<"A string">>}}),
50    ok.
51
52roundtrip(Type, Value) ->
53    asn1_test_lib:roundtrip('ChoTypeRefSet', Type, Value).
54