Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Bug_3565_Regression / Bug_3565_Regression_Test.cpp
blob53c4d5e2b6e61a5e6034706ad8dfbc53c4df4d70
1 #include "tao/ORB.h"
2 #include "tao/ORB_Core.h"
3 #include "tao/Client_Strategy_Factory.h"
4 #include "ace/Get_Opt.h"
5 #include "ace/Log_Msg.h"
6 #include "ace/OS_NS_stdio.h"
7 #include "ace/ACE.h"
9 int
10 ACE_TMAIN(int argc, ACE_TCHAR *argv[])
12 int result = 0;
13 int extra_argc = 4;
14 int second_extra_argc = 4;
15 int largc = argc;
16 int second_largc = argc;
18 try
20 ACE_TCHAR **extra = 0;
21 ACE_TCHAR **second_extra = 0;
22 ACE_NEW_RETURN (extra, ACE_TCHAR *[extra_argc], -1);
23 ACE_NEW_RETURN (second_extra, ACE_TCHAR *[second_extra_argc], -1);
24 extra[0] = ACE::strnew (ACE_TEXT ("-ORBGestalt"));
25 extra[1] = ACE::strnew (ACE_TEXT ("Local"));
26 extra[2] = ACE::strnew (ACE_TEXT ("-ORBSvcConfDirective"));
27 extra[3] = ACE::strnew (ACE_TEXT ("static Client_Strategy_Factory '-ORBReplyDispatcherTableSize 333'"));
29 second_extra[0] = ACE::strnew (ACE_TEXT ("-ORBGestalt"));
30 second_extra[1] = ACE::strnew (ACE_TEXT ("Local"));
31 second_extra[2] = ACE::strnew (ACE_TEXT ("-ORBSvcConfDirective"));
32 second_extra[3] = ACE::strnew (ACE_TEXT ("static Client_Strategy_Factory '-ORBReplyDispatcherTableSize 666'"));
34 //second_extra[2] = ACE::strnew (ACE_TEXT ("-ORBSvcConfDirective \"static Client_Strategy_Factory '-ORBReplyDispatcherTableSize 666'\""));
36 ACE_TCHAR **largv = new ACE_TCHAR *[largc+extra_argc];
37 for (int i = 0; i < largc; i++)
38 largv[i] = argv[i];
40 ACE_TCHAR **second_largv = new ACE_TCHAR *[second_largc+second_extra_argc];
41 for (int i = 0; i < second_largc; i++)
42 second_largv[i] = argv[i];
44 for (int i = 0; i < extra_argc; i++)
46 largv[argc+i] = extra[i];
48 for (int i = 0; i < second_extra_argc; i++)
50 second_largv[argc+i] = second_extra[i];
53 largc += extra_argc;
54 second_largc += second_extra_argc;
56 CORBA::ORB_var orb = CORBA::ORB_init (largc, largv, "FirstORB");
58 if (orb->orb_core()->client_factory()->reply_dispatcher_table_size () != 333)
60 ++result;
63 orb->destroy ();
64 orb = CORBA::ORB::_nil ();
66 CORBA::ORB_var second_orb = CORBA::ORB_init (second_largc, second_largv, "SecondORB");
68 if (second_orb->orb_core()->client_factory()->reply_dispatcher_table_size () != 666)
70 ++result;
73 second_orb->destroy ();
74 second_orb = CORBA::ORB::_nil ();
76 for (int i = 0; i < extra_argc; i++)
77 ACE::strdelete (extra[i]);
78 for (int i2 = 0; i2 < second_extra_argc; i2++)
79 ACE::strdelete (second_extra[i2]);
80 delete [] extra;
81 delete [] largv;
82 delete [] second_extra;
83 delete [] second_largv;
85 catch (const CORBA::Exception& ex)
87 ex._tao_print_exception ("Exception caught:");
90 if (result == 0)
91 ACE_DEBUG ((LM_DEBUG,
92 ACE_TEXT ("Test passed!")));
93 else
94 ACE_ERROR ((LM_ERROR,
95 ACE_TEXT ("Test failed. Result: %d\n"),
96 result));
97 return result;