~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/orber/test/iiop_module_do_test_impl.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
 
5
%% 
 
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/.
 
11
%% 
 
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
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%%
 
19
%%
 
20
 
 
21
-module(iiop_module_do_test_impl).
 
22
 
 
23
 
 
24
-export([run_all/3, run_userexception/2, run_systemexception/2]).
 
25
-export([createTestContext/0]).
 
26
 
 
27
-export([start/0, stop/0]).
 
28
-export([init/1, terminate/2]).
 
29
 
 
30
 
 
31
init(_) ->
 
32
    {ok, []}.
 
33
 
 
34
terminate(Reason, _State) ->
 
35
    io:format("~p terminating with reason ~p~n", [?MODULE, Reason]),
 
36
    ok.
 
37
 
 
38
createTestContext() ->
 
39
    NS = corba:resolve_initial_references("NameService"),
 
40
    NC = lname_component:set_id(lname_component:create(), "iiop_test"),
 
41
    N = lname:insert_component(lname:create(), 1, NC),
 
42
    'CosNaming_NamingContext':bind_new_context(NS, N).
 
43
 
 
44
start() ->
 
45
    SFok = corba:create('iiop_module_do_test', "IDL:iiop_module/do_test:1.0"),
 
46
    NS = corba:resolve_initial_references("NameService"),
 
47
    NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
 
48
    NC2 = lname_component:set_id(lname_component:create(), "erl_dotest"),
 
49
    N = lname:insert_component(lname:create(), 1, NC1),
 
50
    N1 = lname:insert_component(N, 2, NC2),
 
51
    'CosNaming_NamingContext':bind(NS, N1, SFok),
 
52
    SFok.
 
53
 
 
54
stop() ->
 
55
    NS = corba:resolve_initial_references("NameService"),
 
56
    NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
 
57
    NC2 = lname_component:set_id(lname_component:create(), "erl_dotest"),
 
58
    N = lname:insert_component(lname:create(), 1, NC1),
 
59
    N1 = lname:insert_component(N, 2, NC2),
 
60
    'CosNaming_NamingContext':unbind(NS, N1).
 
61
 
 
62
run_all(S, X, TL) ->
 
63
    ok = iiop_module_test:send_void(X),
 
64
    {tk_short, P1} = lists:nth(1, TL),
 
65
    {R1, IO1, O1} = iiop_module_test:send_short(X, P1, P1),
 
66
    RL1= [{tk_short, R1}],
 
67
    IOL1= [{tk_short, IO1}],
 
68
    OL1= [{tk_short, O1}],
 
69
    {tk_ushort, P2} = lists:nth(2, TL),
 
70
    {R2, IO2, O2} = iiop_module_test:send_ushort(X, P2, P2),
 
71
    RL2= [{tk_ushort, R2}|RL1],
 
72
    IOL2= [{tk_ushort, IO2}|IOL1],
 
73
    OL2= [{tk_ushort, O2}|OL1],
 
74
    {tk_long, P3} = lists:nth(3, TL),
 
75
    {R3, IO3, O3} = iiop_module_test:send_long(X, P3, P3),
 
76
    RL3= [{tk_long, R3}|RL2],
 
77
    IOL3= [{tk_long, IO3}|IOL2],
 
78
    OL3= [{tk_long, O3}|OL2],
 
79
    {tk_ulong, P4} = lists:nth(4, TL),
 
80
    {R4, IO4, O4} = iiop_module_test:send_ulong(X, P4, P4),
 
81
    RL4= [{tk_ulong, R4}|RL3],
 
82
    IOL4= [{tk_ulong, IO4}|IOL3],
 
83
    OL4= [{tk_ulong, O4}|OL3],
 
84
    {tk_float, P5} = lists:nth(5, TL),
 
85
    {R5, IO5, O5} = iiop_module_test:send_float(X, P5, P5),
 
86
    RL5= [{tk_float, R5}|RL4],
 
87
    IOL5= [{tk_float, IO5}|IOL4],
 
88
    OL5= [{tk_float, O5}|OL4],
 
89
    {tk_double, P6} = lists:nth(6, TL),
 
90
    {R6, IO6, O6} = iiop_module_test:send_double(X, P6, P6),
 
91
    RL6= [{tk_double, R6}|RL5],
 
92
    IOL6= [{tk_double, IO6}|IOL5],
 
93
    OL6= [{tk_double, O6}|OL5],
 
94
    {tk_boolean, P7} = lists:nth(7, TL),
 
95
    {R7, IO7, O7} = iiop_module_test:send_boolean(X, P7, P7),
 
96
    RL7= [{tk_boolean, R7}|RL6],
 
97
    IOL7= [{tk_boolean, IO7}|IOL6],
 
98
    OL7= [{tk_boolean, O7}|OL6],
 
99
    {tk_char, P8} = lists:nth(8, TL),
 
100
    {R8, IO8, O8} = iiop_module_test:send_char(X, P8, P8),
 
101
    RL= [{tk_char, R8} |RL7],
 
102
    IOL= [{tk_char, IO8} |IOL7],
 
103
    OL= [{tk_char, O8} |OL7],
 
104
    {{lists:reverse(RL),lists:reverse(IOL),lists:reverse(OL)}, S}.
 
105
 
 
106
run_systemexception(S, X) ->
 
107
    iiop_module_test:ret_systemexception(X),
 
108
    {ok, S}.
 
109
 
 
110
run_userexception(S, X) ->
 
111
    iiop_module_test:ret_userexception(X),
 
112
    {ok, S}.