aboutsummaryrefslogtreecommitdiffstats
path: root/lib/orber/test/cdrcoding_10_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/orber/test/cdrcoding_10_SUITE.erl')
-rw-r--r--lib/orber/test/cdrcoding_10_SUITE.erl237
1 files changed, 98 insertions, 139 deletions
diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl
index 3eb35572c1..24de589615 100644
--- a/lib/orber/test/cdrcoding_10_SUITE.erl
+++ b/lib/orber/test/cdrcoding_10_SUITE.erl
@@ -26,13 +26,12 @@
%%-----------------------------------------------------------------
-module(cdrcoding_10_SUITE).
-
-include("idl_output/Module.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("orber/include/corba.hrl").
-include_lib("orber/src/orber_iiop.hrl").
--define(default_timeout, ?t:minutes(20)).
+-define(default_timeout, test_server:minutes(20)).
%%-----------------------------------------------------------------
%% External exports
@@ -80,14 +79,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
Path = code:which(?MODULE),
code:add_pathz(filename:join(filename:dirname(Path), "idl_output")),
- ?line Dog=test_server:timetrap(?default_timeout),
+ Dog=test_server:timetrap(?default_timeout),
[{watchdog, Dog}|Config].
end_per_testcase(_Case, Config) ->
Path = code:which(?MODULE),
code:del_path(filename:join(filename:dirname(Path), "idl_output")),
- Dog = ?config(watchdog, Config),
+ Dog = proplists:get_value(watchdog, Config),
test_server:timetrap_cancel(Dog),
ok.
@@ -126,49 +125,40 @@ end_per_suite(Config) when is_list(Config) ->
% 'oe_orber_test':'oe_unregister'(),
% ok.
-do_register(doc) -> [];
-do_register(suite) -> [];
do_register(Config) when is_list(Config) ->
io:format("Pwd: ~p, mod: ~p~n",[c:pwd(), c:m('oe_orber_test')]),
'oe_orber_test':'oe_register'(),
ok.
-do_unregister(doc) -> [];
-do_unregister(suite) -> [];
+
do_unregister(Config) when is_list(Config) ->
'oe_orber_test':'oe_unregister'(),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: null
%%-----------------------------------------------------------------
-null_type(doc) -> [];
-null_type(suite) -> [];
null_type(Config) when is_list(Config) ->
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_null', 'null'),
- ?line {'null', <<>>, _} = cdr_decode:dec_type('tk_null', {1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_null', 'null'),
+ {'null', <<>>, _} = cdr_decode:dec_type('tk_null', {1, 0}, B, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: void
%%-----------------------------------------------------------------
-void_type(doc) -> [];
-void_type(suite) -> [];
void_type(Config) when is_list(Config) ->
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_void', 'ok'),
- ?line {'ok', <<>>, _} = cdr_decode:dec_type('tk_void', {1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_void', 'ok'),
+ {'ok', <<>>, _} = cdr_decode:dec_type('tk_void', {1, 0}, B, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: principal
%%-----------------------------------------------------------------
-principal_type(doc) -> [];
-principal_type(suite) -> [];
principal_type(Config) when is_list(Config) ->
- ?line B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', "principal"),
- ?line {"principal", <<>>, _} = cdr_decode:dec_type('tk_Principal', {1, 0}, B0, 0, big),
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', ""),
- ?line {"", <<>>, _} = cdr_decode:dec_type('tk_Principal', {1, 0}, B1, 0, big),
- ?line B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', "principal"),
- ?line {"principal", <<>>, _} =
+ B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', "principal"),
+ {"principal", <<>>, _} = cdr_decode:dec_type('tk_Principal', {1, 0}, B0, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', ""),
+ {"", <<>>, _} = cdr_decode:dec_type('tk_Principal', {1, 0}, B1, 0, big),
+ B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, 'tk_Principal', "principal"),
+ {"principal", <<>>, _} =
cdr_decode:dec_type('tk_Principal', {1, 0}, B2, 0, big),
ok.
@@ -203,19 +193,17 @@ objref(2) ->
TP = #'IOP_TaggedProfile'{tag=?TAG_INTERNET_IOP, profile_data=PB},
#'IOP_IOR'{type_id="IDL:Module/Interface:1.0", profiles=[TP]}.
-objref_type(doc) -> [];
-objref_type(suite) -> [];
objref_type(Config) when is_list(Config) ->
T = {'tk_objref', "IDL:Module/Interface:1.0", "Interface"},
Objref0 = objref(0),
- ?line B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref0),
- ?line {Objref0, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B0, 0, big),
+ B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref0),
+ {Objref0, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B0, 0, big),
Objref1 = objref(1),
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref1),
- ?line {Objref1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref1),
+ {Objref1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
Objref2 = objref(2),
- ?line B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref2),
- ?line {Objref2, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, Objref2),
+ {Objref2, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B2, 0, big),
ok.
@@ -223,49 +211,45 @@ objref_type(Config) when is_list(Config) ->
%%-----------------------------------------------------------------
%% Encode/decode test of type: struct
%%-----------------------------------------------------------------
-struct_type(doc) -> [];
-struct_type(suite) -> [];
struct_type(Config) when is_list(Config) ->
T0 = {'tk_struct',"IDL:Module/Struct0:1.0", "Module_Struct0",
[{"long", 'tk_long'}, {"short", 'tk_short'}, {"character", 'tk_char'}]},
S0 = #'Module_Struct0'{l=-4711, s=17, c=$a},
- ?line B0 = cdr_encode:enc_type({1, 0}, T0, S0),
- ?line {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
+ B0 = cdr_encode:enc_type({1, 0}, T0, S0),
+ {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
T1 = {'tk_struct', "IDL:Module/Struct1:1.0", "Module_Struct1",
[{"string", {'tk_string', 0}}, {"ushort", 'tk_ushort'}, {"ulong", 'tk_ulong'}]},
S1 = #'Module_Struct1'{s="Hi !!!!", us=17, ul=4711},
- ?line B1 = cdr_encode:enc_type({1, 0}, T1, S1),
- ?line {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type({1, 0}, T1, S1),
+ {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
T2 = {'tk_struct', "IDL:Module/Struct2:1.0", "Module_Struct2",
[{"long_sequence", {'tk_sequence', 'tk_long', 0}},
{"enum", {'tk_enum', "IDL:Module/Enum:1.0", "Module_Enum", ["horse", "pig", "cow"]}},
{"octet", 'tk_octet'}]},
S2 = #'Module_Struct2'{long_sequence=[4711, 350000, 0, -3030, -600000], e=cow, o=$X},
- ?line B2 = cdr_encode:enc_type({1, 0}, T2, S2),
- ?line {S2, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type({1, 0}, T2, S2),
+ {S2, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B2, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: union
%%-----------------------------------------------------------------
-union_type(doc) -> [];
-union_type(suite) -> [];
union_type(Config) when is_list(Config) ->
T0 = {'tk_union', "IDL:Module/Union:1.0", "Union", 'tk_short', 2,
[{0, "First", 'tk_short'},
{1, "Second", {'tk_string', 0}},
{2, "Third", 'tk_char'}]},
S0 = #'Module_Union'{label=1, value="Foo Bar !"},
- ?line B0 = cdr_encode:enc_type({1, 0}, T0, S0),
- ?line {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
+ B0 = cdr_encode:enc_type({1, 0}, T0, S0),
+ {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
S1 = #'Module_Union'{label=0, value=-17},
- ?line B1 = cdr_encode:enc_type({1, 0}, T0, S1),
- ?line {S1, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type({1, 0}, T0, S1),
+ {S1, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B1, 0, big),
S2 = #'Module_Union'{label=2, value=$X},
- ?line B2 = cdr_encode:enc_type({1, 0}, T0, S2),
- ?line {S2, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type({1, 0}, T0, S2),
+ {S2, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B2, 0, big),
T1 = {'tk_union', "IDL:Module/Union1:1.0", "Union1",
{'tk_enum', "IDL:Module/Enum:1.0",
"Module_Enum", ["horse", "pig", "cow"]}, "pig",
@@ -274,14 +258,14 @@ union_type(Config) when is_list(Config) ->
{"cow", "Third", {'tk_enum', "IDL:Module/Enum1:1.0",
"Module_Enum1", ["orange", "banana", "apple"]}}]},
S3 = #'Module_Union1'{label=pig, value=["Foo", "Bar", "!"]},
- ?line B3 = cdr_encode:enc_type({1, 0}, T1, S3),
- ?line {S3, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B3, 0, big),
+ B3 = cdr_encode:enc_type({1, 0}, T1, S3),
+ {S3, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B3, 0, big),
S4 = #'Module_Union1'{label=cow, value=apple},
- ?line B4 = cdr_encode:enc_type({1, 0}, T1, S4),
- ?line {S4, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B4, 0, big),
+ B4 = cdr_encode:enc_type({1, 0}, T1, S4),
+ {S4, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B4, 0, big),
S5 = #'Module_Union1'{label=horse, value=17},
- ?line B5 = cdr_encode:enc_type({1, 0}, T1, S5),
- ?line {S5, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B5, 0, big),
+ B5 = cdr_encode:enc_type({1, 0}, T1, S5),
+ {S5, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B5, 0, big),
T2 = {'tk_union', "IDL:Module/Union2:1.0", "Union2",
{'tk_enum', "IDL:Module/Enum:1.0",
"Module_Enum", ["horse", "pig", "cow"]}, "pig",
@@ -303,54 +287,50 @@ union_type(Config) when is_list(Config) ->
["orange", "banana",
"apple"]}}]}}]},
S6 = #'Module_Union2'{label=pig, value=#'Module_Union'{label=0, value=-17}},
- ?line B6 = cdr_encode:enc_type({1, 0}, T2, S6),
- ?line {S6, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B6, 0, big),
+ B6 = cdr_encode:enc_type({1, 0}, T2, S6),
+ {S6, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B6, 0, big),
S7 = #'Module_Union2'{label=cow, value=#'Module_Union1'{label=pig,
value=["Foo", "Bar", "!"]}},
- ?line B7 = cdr_encode:enc_type({1, 0}, T2, S7),
- ?line {S7, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B7, 0, big),
+ B7 = cdr_encode:enc_type({1, 0}, T2, S7),
+ {S7, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B7, 0, big),
S8 = #'Module_Union2'{label=horse, value={-17, 1234567890, -987654321}},
- ?line B8 = cdr_encode:enc_type({1, 0}, T2, S8),
- ?line {S8, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B8, 0, big),
+ B8 = cdr_encode:enc_type({1, 0}, T2, S8),
+ {S8, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B8, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: string
%%-----------------------------------------------------------------
-string_type(doc) -> [];
-string_type(suite) -> [];
string_type(Config) when is_list(Config) ->
S0 = "Foo Bar ???",
- ?line B0 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S0),
- ?line {S0, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B0, 0, big),
+ B0 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S0),
+ {S0, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B0, 0, big),
S1 = "Yes, Foo Bar !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! more than 5000 characters",
- ?line B1 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S1),
- ?line {S1, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S1),
+ {S1, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B1, 0, big),
S2 = "",
- ?line B2 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S2),
- ?line {S2, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S2),
+ {S2, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B2, 0, big),
S3 = "\0",
- ?line B3 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S3),
- ?line {S3, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B3, 0, big),
+ B3 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S3),
+ {S3, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B3, 0, big),
S4 = "~n",
- ?line B4 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S4),
- ?line {S4, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B4, 0, big),
+ B4 = cdr_encode:enc_type({1, 0}, {'tk_string', 0}, S4),
+ {S4, <<>>, _} = cdr_decode:dec_type({'tk_string', 0}, {1, 0}, B4, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: array
%%-----------------------------------------------------------------
-array_type(doc) -> [];
-array_type(suite) -> [];
array_type(Config) when is_list(Config) ->
T0 = {'tk_array', 'tk_long', 5},
S0 = {-100, 0, 30000, -900100900, 123456789},
- ?line B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T0, S0),
- ?line {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
+ B0 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T0, S0),
+ {S0, <<>>, _} = cdr_decode:dec_type(T0, {1, 0}, B0, 0, big),
T1 = {'tk_array', {'tk_enum', "IDL:Module/Enum:1.0", "Module_Enum", ["horse", "pig", "cow"]}, 2},
S1 = {pig, cow},
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, S1),
- ?line {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, S1),
+ {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
T2 = {'tk_array', {'tk_union', "IDL:Module/Union:1.0", "Union",
{'tk_enum', "IDL:Module/Enum:1.0", "Module_Enum", ["horse", "pig", "cow"]}, "pig",
[{"horse", "First", 'tk_ushort'},
@@ -358,18 +338,16 @@ array_type(Config) when is_list(Config) ->
{"cow", "Third", {'tk_enum', "IDL:Module/Enum1:1.0",
"Module_Enum1", ["orange", "banana", "apple"]}}]}, 2},
S2 = {#'Module_Union'{label=cow, value=banana}, #'Module_Union'{label=pig, value=["This", "is", "a", "test", ""]}},
- ?line B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2, S2),
- ?line {S2, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2, S2),
+ {S2, <<>>, _} = cdr_decode:dec_type(T2, {1, 0}, B2, 0, big),
T3 = {'tk_array', {'tk_objref', "IDL:Module/Interface:1.0", "Interface"}, 3},
S3 = {objref(0), objref(1), objref(2)},
- ?line B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3, S3),
- ?line {S3, <<>>, _} = cdr_decode:dec_type(T3, {1, 0}, B3, 0, big),
+ B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3, S3),
+ {S3, <<>>, _} = cdr_decode:dec_type(T3, {1, 0}, B3, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: TypeCode
%%-----------------------------------------------------------------
-any_type(doc) -> [];
-any_type(suite) -> [];
any_type(Config) when is_list(Config) ->
T = 'tk_any',
TC = {'tk_struct', "IDL:Module/Struct2:1.0", "Module_Struct2",
@@ -380,8 +358,8 @@ any_type(Config) when is_list(Config) ->
S = #'Module_Struct2'{long_sequence=[4711, 350000, 0, -3030, -600000],
e=cow, o=$X},
Any = #any{typecode=TC,value=S},
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,Any),
- ?line {Any, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,Any),
+ {Any, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
TC1 = {'tk_array', {'tk_union', "IDL:Module/Union:1.0", "Union",
{'tk_enum', "IDL:Module/Enum:1.0", "Module_Enum",
["horse", "pig", "cow"]}, 1,
@@ -392,16 +370,14 @@ any_type(Config) when is_list(Config) ->
"apple"]}}]},2},
S1 = {#'Module_Union'{label=cow, value=banana}, #'Module_Union'{label=pig, value=["This", "is", "a", "test", ""]}},
Any1 = #any{typecode=TC1,value=S1},
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,Any1),
- ?line {Any1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,Any1),
+ {Any1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: TypeCode
%%-----------------------------------------------------------------
-typecode_type(doc) -> [];
-typecode_type(suite) -> [];
typecode_type(Config) when is_list(Config) ->
T = 'tk_TypeCode',
TC = {'tk_array', {'tk_union', "IDL:Module/Union:1.0", "Union",
@@ -412,8 +388,8 @@ typecode_type(Config) when is_list(Config) ->
{"cow", "Third", {'tk_enum', "IDL:Module/Enum1:1.0",
"Module_Enum1", ["orange", "banana",
"apple"]}}]}, 10},
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,TC),
- ?line {TC, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,TC),
+ {TC, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
TC1 = {'tk_union', "IDL:Module/Union2:1.0", "Union2",
{'tk_enum', "IDL:Module/Enum:1.0",
"Module_Enum", ["horse", "pig", "cow"]}, 2,
@@ -434,15 +410,13 @@ typecode_type(Config) when is_list(Config) ->
"Module_Enum1",
["orange", "banana",
"apple"]}}]}}]},
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, TC1),
- ?line {TC1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, TC1),
+ {TC1, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B1, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: TypeCode
%%-----------------------------------------------------------------
-alias_type(doc) -> [];
-alias_type(suite) -> [];
alias_type(Config) when is_list(Config) ->
T = {'tk_alias', "IDL:Module/Alias:1.0", "Alias",
{'tk_struct', "IDL:Module/Struct2:1.0", "Module_Struct2",
@@ -452,8 +426,8 @@ alias_type(Config) when is_list(Config) ->
{"octet", 'tk_octet'}]}},
S = #'Module_Struct2'{long_sequence=[4711, 350000, 0, -3030, -600000],
e=cow, o=$X},
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,S),
- ?line {S, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,S),
+ {S, <<>>, _} = cdr_decode:dec_type(T, {1, 0}, B, 0, big),
T1 = {'tk_alias', "IDL:Module/Alias1:1.0", "Alias1",
{'tk_sequence', {'tk_union', "IDL:Module/Union:1.0", "Union",
{'tk_enum', "IDL:Module/Enum:1.0", "Module_Enum",
@@ -464,15 +438,13 @@ alias_type(Config) when is_list(Config) ->
"Module_Enum1", ["orange", "banana",
"apple"]}}]},0}},
S1 = [#'Module_Union'{label=cow, value=banana}, #'Module_Union'{label=pig, value=["This", "is", "a", "test", ""]}],
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, S1),
- ?line {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, S1),
+ {S1, <<>>, _} = cdr_decode:dec_type(T1, {1, 0}, B1, 0, big),
ok.
%%-----------------------------------------------------------------
%% Encode/decode test of type: exception
%%-----------------------------------------------------------------
-exception_type(doc) -> [];
-exception_type(suite) -> [];
exception_type(Config) when is_list(Config) ->
system_exceptions(),
user_exceptions(),
@@ -481,43 +453,43 @@ exception_type(Config) when is_list(Config) ->
system_exceptions() ->
E = #'UNKNOWN'{completion_status=?COMPLETED_YES},
{system_exception, T, E} = orber_exceptions:get_def(E),
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,E),
- ?line {E, _} = cdr_decode:dec_system_exception({1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T,E),
+ {E, _} = cdr_decode:dec_system_exception({1, 0}, B, 0, big),
E1 = #'INV_OBJREF'{completion_status=?COMPLETED_NO},
{system_exception, T1, E1} = orber_exceptions:get_def(E1),
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1,E1),
- ?line {E1, _} = cdr_decode:dec_system_exception({1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1,E1),
+ {E1, _} = cdr_decode:dec_system_exception({1, 0}, B1, 0, big),
E2 = #'BAD_OPERATION'{completion_status=?COMPLETED_NO},
{system_exception, T2, E2} = orber_exceptions:get_def(E2),
- ?line B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2,E2),
- ?line {E2, _} = cdr_decode:dec_system_exception({1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2,E2),
+ {E2, _} = cdr_decode:dec_system_exception({1, 0}, B2, 0, big),
E3 = #'INTF_REPOS'{completion_status=?COMPLETED_MAYBE},
{system_exception, T3, E3} = orber_exceptions:get_def(E3),
- ?line B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3,E3),
- ?line {E3, _} = cdr_decode:dec_system_exception({1, 0}, B3, 0, big),
+ B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3,E3),
+ {E3, _} = cdr_decode:dec_system_exception({1, 0}, B3, 0, big),
ok.
user_exceptions() ->
E = #'Module_Except1'{rest_of_name=["I","am","testing","exceptions"], why="Error"},
{user_exception, T, E} = orber_exceptions:get_def(E),
- ?line B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, E),
- ?line {E, _} = cdr_decode:dec_user_exception({1, 0}, B, 0, big),
+ B = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T, E),
+ {E, _} = cdr_decode:dec_user_exception({1, 0}, B, 0, big),
E1 = #'Module_Except2'{e=banana,
s=#'Module_Struct2'{long_sequence=[12,-4040,
1234567898],
e=horse,
o=$a}},
{user_exception, T1, E1} = orber_exceptions:get_def(E1),
- ?line B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, E1),
- ?line {E1, _} = cdr_decode:dec_user_exception({1, 0}, B1, 0, big),
+ B1 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T1, E1),
+ {E1, _} = cdr_decode:dec_user_exception({1, 0}, B1, 0, big),
E2 = #'Module_Except3'{u=#'Module_Union1'{label=pig,value=["high","and","low"]},s=1313, o=objref(0)},
{user_exception, T2, E2} = orber_exceptions:get_def(E2),
- ?line B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2, E2),
- ?line {E2, _} = cdr_decode:dec_user_exception({1, 0}, B2, 0, big),
+ B2 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T2, E2),
+ {E2, _} = cdr_decode:dec_user_exception({1, 0}, B2, 0, big),
E3 = #'Module_Except4'{},
{user_exception, T3, E3} = orber_exceptions:get_def(E3),
- ?line B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3, E3),
- ?line {E3, _} = cdr_decode:dec_user_exception({1, 0}, B3, 0, big),
+ B3 = cdr_encode:enc_type(#giop_env{version = {1, 0}}, T3, E3),
+ {E3, _} = cdr_decode:dec_user_exception({1, 0}, B3, 0, big),
ok.
%%-----------------------------------------------------------------
@@ -525,7 +497,6 @@ user_exceptions() ->
%% Description: Precondition the stack must be started so the
%% objectkey is valid.
%%-----------------------------------------------------------------
-%request(suite) -> [];
%request(_) ->
% exit(not_implemented).
@@ -533,19 +504,17 @@ user_exceptions() ->
%% Test Case: reply encoding test
%% Description:
%%-----------------------------------------------------------------
-reply(doc) -> ["Description", "more description"];
-reply(suite) -> [];
reply(Config) when is_list(Config) ->
R = #reply_header{service_context=[], request_id=1,
reply_status='no_exception'},
- ?line B = cdr_encode:enc_reply(
+ B = cdr_encode:enc_reply(
#giop_env{version = {1, 0}, request_id = 1,
reply_status = 'no_exception',
tc = {'tk_long', [], [{'tk_sequence',
{'tk_string', 0}, 0}]},
result = 1200, parameters = [["foo","Bar"]],
ctx = []}),
- ?line {R, 1200, [["foo","Bar"]]} =
+ {R, 1200, [["foo","Bar"]]} =
cdr_decode:dec_message({'tk_long', [], [{'tk_sequence', {'tk_string', 0},0}]},
B),
ok.
@@ -554,21 +523,17 @@ reply(Config) when is_list(Config) ->
%% Test Case: cancel_request encoding test
%% Description:
%%-----------------------------------------------------------------
-cancel_request(doc) -> ["Description", "more description"];
-cancel_request(suite) -> [];
cancel_request(Config) when is_list(Config) ->
R = #cancel_request_header{request_id=1},
- ?line B = cdr_encode:enc_cancel_request(#giop_env{version = {1, 0},
+ B = cdr_encode:enc_cancel_request(#giop_env{version = {1, 0},
request_id = 1}),
- ?line R = cdr_decode:dec_message([], B),
+ R = cdr_decode:dec_message([], B),
ok.
%%-----------------------------------------------------------------
%% Test Case: locate_request encoding test
%% Description:
%%-----------------------------------------------------------------
-locate_request(doc) -> ["Description", "more description"];
-locate_request(suite) -> [];
locate_request(Config) when is_list(Config) ->
io:format("Function not imlpemented yet"),
exit(not_implemented).
@@ -577,8 +542,6 @@ locate_request(Config) when is_list(Config) ->
%% Test Case: locate_reply encoding test
%% Description:
%%-----------------------------------------------------------------
-locate_reply(doc) -> ["Description", "more description"];
-locate_reply(suite) -> [];
locate_reply(Config) when is_list(Config) ->
io:format("Function not imlpemented yet"),
exit(not_implemented).
@@ -587,22 +550,18 @@ locate_reply(Config) when is_list(Config) ->
%% Test Case: close_connection encoding test
%% Description:
%%-----------------------------------------------------------------
-close_connection(doc) -> ["Description", "more description"];
-close_connection(suite) -> [];
close_connection(Config) when is_list(Config) ->
- ?line B = cdr_encode:enc_close_connection(#giop_env{version = {1, 0}}),
- ?line 'close_connection' = cdr_decode:dec_message([], B),
+ B = cdr_encode:enc_close_connection(#giop_env{version = {1, 0}}),
+ 'close_connection' = cdr_decode:dec_message([], B),
ok.
%%-----------------------------------------------------------------
%% Test Case: message_error encoding test
%% Description:
%%-----------------------------------------------------------------
-message_error(doc) -> ["Description", "more description"];
-message_error(suite) -> [];
message_error(Config) when is_list(Config) ->
- ?line B = cdr_encode:enc_message_error(#giop_env{version = {1, 0}}),
- ?line 'message_error' = cdr_decode:dec_message([], B),
+ B = cdr_encode:enc_message_error(#giop_env{version = {1, 0}}),
+ 'message_error' = cdr_decode:dec_message([], B),
ok.