summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Bug_1334_Regression/client.cpp
blob: 0ece672154c2065b5c14d4a8375274483503897d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// $Id$
//
#include "tao/corba.h"

// Attempts to resolve the NameService.
// Returns:
//    0  if the NameService was resolved
//    1  if the NameService could not be resolved
//    2  if something else went wrong
//
int main( int argc, char *argv[] )
{
  try
    {
      CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, 0 ) ;

      try
        {
           CORBA::Object_var naming =
              orb->resolve_initial_references( "NameService") ;
           if( CORBA::is_nil( naming.in() ) )
             {
                return 1 ;
             }
        }
      catch (const CORBA::Exception& ex)
        {
          ACE_UNUSED_ARG (ex);
          return 1 ;
        }
    }
  catch (const CORBA::Exception& ex)
    {
       ACE_UNUSED_ARG (ex);
       return 2 ;
    }

  return 0 ;
}