Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tests / Bug_3755_Ext_Regression / common.cpp
blobeca6a8dd8c044f96fda301699dc026d7d14c0f39
1 #include "common.h"
2 #include "tao/ORB.h"
3 #include "ace/Get_Opt.h"
4 #include "ace/ARGV.h"
6 ACE_TCHAR const *orb1_args = 0;
7 ACE_TCHAR const *orb2_args = 0;
9 int
10 parse_args (int argc, ACE_TCHAR *argv[])
12 ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("a:b:"));
13 int c;
15 while ((c = get_opts ()) != -1)
16 switch (c)
18 case 'a':
19 orb1_args = get_opts.opt_arg ();
20 break;
21 case 'b':
22 orb2_args = get_opts.opt_arg ();
23 break;
24 case '?':
25 default:
26 ACE_ERROR_RETURN ((LM_ERROR,
27 ACE_TEXT ("usage: %s ")
28 ACE_TEXT ("-a <orb1_args> ")
29 ACE_TEXT ("-b <orb2_args>")
30 ACE_TEXT ("\n"),
31 argv [0]),
32 -1);
34 // Indicates successful parsing of the command line
35 return 0;
38 int
39 do_main (int argc, ACE_TCHAR *argv[], orbs_check_callback check)
41 try
43 if (parse_args (argc, argv) != 0)
45 ACE_ERROR_RETURN ((LM_ERROR,
46 "ERROR: Cannot process args\n"),
47 1);
50 ACE_ARGV orb1_argv (orb1_args);
51 int orb1_argc = orb1_argv.argc ();
53 ACE_ARGV orb2_argv (orb2_args);
54 int orb2_argc = orb2_argv.argc ();
56 ACE_DEBUG ((LM_DEBUG,
57 "Initialize ORB instances...\n"));
59 CORBA::ORB_var orb1 =
60 CORBA::ORB_init (orb1_argc, orb1_argv.argv (), FIRST_ORB_NAME);
62 CORBA::ORB_var orb2 =
63 CORBA::ORB_init (orb2_argc, orb2_argv.argv (), SECOND_ORB_NAME);
65 ACE_DEBUG ((LM_DEBUG,
66 "After ORB_init...\n"));
68 if (check && !check ())
70 ACE_ERROR_RETURN ((LM_ERROR,
71 "ERROR: ORB check failed\n"),
72 1);
75 catch (const CORBA::Exception& ex)
77 ex._tao_print_exception ("Caught Exception in do_main:\n");
78 return 1;
81 return 0;