Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Bug_3418_Regression / Test.cpp
blob5f85729628a16d8ca0e4735111802faa64a5603b
1 #include "tao/corba.h"
2 #include "ace/ARGV.h"
3 #include "ace/Dynamic_Service.h"
5 // SSLIOP
6 const ACE_TCHAR argStrB[] = ACE_TEXT("BBB -ORBGestalt LOCAL -ORBId ORB-B -ORBSvcConf b.conf");
8 // empty file
9 const ACE_TCHAR argStrM[] = ACE_TEXT("MMM -ORBGestalt LOCAL -ORBId ORB-M -ORBSvcConf m.conf");
11 int
12 ACE_TMAIN (int, ACE_TCHAR **)
14 int error = 0;
16 try
18 ACE_ARGV argM (argStrM);
19 int n = argM.argc ();
20 CORBA::ORB_var ORBM =
21 CORBA::ORB_init (n, argM.argv ());
23 if (CORBA::is_nil (ORBM.in ()))
24 ACE_ERROR_RETURN ((LM_DEBUG,
25 ACE_TEXT("Expected to get an ORB\n")),
26 -1);
28 // SSLIOP
29 ACE_ARGV argB (argStrB);
30 n = argB.argc ();
31 CORBA::ORB_var ORBB =
32 CORBA::ORB_init (n, argB.argv ());
34 if (CORBA::is_nil (ORBB.in ()))
35 ACE_ERROR_RETURN ((LM_DEBUG,
36 ACE_TEXT("Expected to get an ORB\n")),
37 -1);
39 // Since each svc conf file causes the ORB to load the services in
40 // its own service space no services are reachable through the
41 // global service repo
43 // SSLIOP
44 ACE_Service_Object *ssliop_so =
45 ACE_Dynamic_Service<ACE_Service_Object>::instance ("SSLIOP_Factory");
46 if (ssliop_so != 0)
48 ++error;
49 ACE_ERROR ((LM_DEBUG,
50 ACE_TEXT("Unexpected to find ")
51 ACE_TEXT("SSLIOP_Factory globally\n")));
54 ORBM->destroy();
56 ORBB->destroy();
58 catch(const CORBA::Exception& ex)
60 ex._tao_print_exception ("Unhandled exception caught");
61 return -1;
64 return error;