Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3470_Regression / test.cpp
blobe8a0b7b4cf40899f2fe36a2849034ccd4168929a
1 /* Test wether list_initial_services returns an ObjectURL or an ObjectId as
2 * it should be when an ORBInitRef is set.
4 * launch test like this:
5 * <execname> -ORBInitRef MyObjectId=file://myobj.ior
6 */
8 #include "tao/ORB.h"
9 #include "tao/Object.h"
10 #include "tao/ObjectIdListC.h"
12 int ACE_TMAIN( int argc, ACE_TCHAR * argv[] )
14 int retcode = 1;
16 try
18 CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
20 CORBA::ORB_ObjectIdList_var listsrv = orb->list_initial_services();
21 for (CORBA::ULong index = 0 ; index < listsrv->length() ; index++ )
22 if ( ACE_OS::strcmp(listsrv[index],"MyObjectId") == 0)
23 retcode = 0;
25 orb->destroy();
27 catch (const CORBA::Exception& ex)
29 ex._tao_print_exception ("Exception caught:");
30 return 1;
33 return retcode;