Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Bug_2809_Regression / server.cpp
blobdd58630657d5e7a06f832e45e4680406f5f902c5
1 #include "tao/corba.h"
3 int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
5 if (TAO_debug_level != 0)
7 ACE_ERROR_RETURN ((LM_ERROR, "Error, wrong debug level, should be 0\n"), 1);
10 ACE_DEBUG ((LM_INFO, "TAO_debug_level before first ORB_init: %d\n",
11 TAO_debug_level));
13 try
15 CORBA::ORB_var orb1_ = CORBA::ORB_init(argc, argv, "ServerORB1");
17 if (TAO_debug_level != 0)
19 ACE_ERROR_RETURN ((LM_ERROR, "Error, wrong debug level, should be 0\n"), 1);
22 ACE_DEBUG ((LM_INFO, "TAO_debug_level after first ORB_init: %d\n",
23 TAO_debug_level));
25 ACE_TCHAR *my_argv[3];
26 my_argv[0] = argv[0];
27 my_argv[1] = const_cast<ACE_TCHAR *> (ACE_TEXT ("-ORBDebugLevel"));
28 my_argv[2] = const_cast<ACE_TCHAR *> (ACE_TEXT ("10"));
29 int my_argc = 3;
31 CORBA::ORB_var orb2_ = CORBA::ORB_init (my_argc, my_argv, "ServerORB2");
33 ACE_DEBUG ((LM_INFO, "TAO_debug_level after second ORB_init: %d\n",
34 TAO_debug_level));
36 if (TAO_debug_level != 10)
38 ACE_ERROR_RETURN ((LM_ERROR, "Error, wrong debug level, should be 10\n"), 1);
41 catch (const CORBA::Exception &ex)
43 ex._tao_print_exception ("Server main()");
44 return 1;
46 return 0;