source: trunk/ORBit2-2.14.0/test/everything/deadReference.c

Last change on this file was 92, checked in by cinc, 19 years ago

Orbit2 modified for use with NOM

File size: 1.9 KB
Line 
1/*
2 * CORBA C language mapping tests
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
7 * later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Author: Mark McLoughlin <mark@skynet.ie>
19 */
20
21#include "everything.h"
22
23static void
24DeadReferenceObj_test (PortableServer_Servant servant,
25 CORBA_Environment *ev)
26{
27 PortableServer_Current poa_current;
28 PortableServer_POA poa;
29 CORBA_Object obj = CORBA_OBJECT_NIL;
30
31 poa_current = (PortableServer_Current)
32 CORBA_ORB_resolve_initial_references (global_orb,
33 "POACurrent",
34 ev);
35
36 g_assert (ev->_major == CORBA_NO_EXCEPTION);
37
38 poa = PortableServer_Current_get_POA (poa_current, ev);
39
40 g_assert (ev->_major == CORBA_NO_EXCEPTION);
41
42 obj = PortableServer_POA_servant_to_reference (poa, servant, ev);
43
44 g_assert (ev->_major == CORBA_NO_EXCEPTION);
45 g_assert (obj != CORBA_OBJECT_NIL);
46
47 CORBA_Object_release ((CORBA_Object) obj, ev);
48 CORBA_Object_release ((CORBA_Object) poa, ev);
49 CORBA_Object_release ((CORBA_Object) poa_current, ev);
50}
51
52static POA_test_DeadReferenceObj__epv DeadReferenceObj_epv = {
53 NULL,
54 DeadReferenceObj_test,
55};
56
57static PortableServer_ServantBase__epv DeadReferenceObj_base_epv = {
58 NULL,
59 simple_finalize,
60 NULL
61};
62static POA_test_DeadReferenceObj__vepv DeadReferenceObj_vepv = {
63 &DeadReferenceObj_base_epv,
64 &DeadReferenceObj_epv
65};
Note: See TracBrowser for help on using the repository browser.