Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / ORB_Local_Config / Simple / Test.cpp
blob024b805f6b7b09aa55ca166a494d6da4fc26583b
1 #include "tao/CORBANAME_Parser.h"
2 #include "tao/CORBALOC_Parser.h"
3 #include "tao/Protocol_Factory.h"
4 #include "ace/Dynamic_Service.h"
5 #include "ace/Intrusive_Auto_Ptr.h"
7 #include "Service_Configuration_Per_ORB.h"
10 // @brief Dynamic services loading
12 int
13 ACE_TMAIN (int, ACE_TCHAR *[])
15 ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> one (new ACE_Service_Gestalt());
17 one->process_directive (ace_svc_desc_TAO_CORBANAME_Parser);
18 one->process_directive (ace_svc_desc_TAO_CORBALOC_Parser);
20 TAO_Protocol_Factory* p1 = ACE_Dynamic_Service<TAO_Protocol_Factory>::instance (one.get (), "IIOP_Factory");
22 if (p1 != 0)
23 ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Unexpected to find IIOP_Factory\n")), -1);
25 ACE_Service_Object* p2 = ACE_Dynamic_Service<ACE_Service_Object>::instance (one.get (), "CORBANAME_Parser");
27 if (p2 == 0)
28 ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to find CORBANAME_Parser\n")), -1);
30 ACE_Service_Object* p3 = ACE_Dynamic_Service<ACE_Service_Object>::instance (one.get (), "CORBALOC_Parser");
32 if (p3 == 0)
33 ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to find CORBALOC_Parser\n")), -1);
35 return 0;