source: trunk/ORBit2-2.14.0/test/poa/test-poa.c

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

Orbit2 modified for use with NOM

File size: 939 bytes
Line 
1#include <stdio.h>
2#include <string.h>
3#include <orbit/orbit.h>
4
5CORBA_ORB orb = CORBA_OBJECT_NIL;
6
7int
8main (int argc, char **argv)
9{
10 CORBA_Environment ev[1];
11 PortableServer_POA rootpoa, poa;
12
13 CORBA_exception_init (ev);
14
15 orb = CORBA_ORB_init (&argc, argv, "", ev);
16
17 rootpoa = (PortableServer_POA)
18 CORBA_ORB_resolve_initial_references (orb, "RootPOA", ev);
19 g_assert (ev->_major == CORBA_NO_EXCEPTION);
20
21 {
22 poa = ORBit_POA_new_from (orb, rootpoa, "Foo", NULL, ev);
23 g_assert (ev->_major == CORBA_NO_EXCEPTION);
24
25 PortableServer_POA_destroy (poa, FALSE, FALSE, ev);
26 CORBA_Object_release ((CORBA_Object) poa, ev);
27 }
28
29 CORBA_Object_release ((CORBA_Object) rootpoa, ev);
30
31 CORBA_ORB_destroy (orb, ev);
32 g_assert (ev->_major == CORBA_NO_EXCEPTION);
33
34 CORBA_Object_release ((CORBA_Object) orb, ev);
35 g_assert (ev->_major == CORBA_NO_EXCEPTION);
36
37 CORBA_exception_free (ev);
38
39 fprintf (stderr, "PASS: test-poa\n");
40
41 return 0;
42}
Note: See TracBrowser for help on using the repository browser.