2 #include "tao/ORB_Core.h"
5 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
9 int second_extra_argc
= 2;
11 int second_largc
= argc
;
15 ACE_TCHAR
**extra
= 0;
16 ACE_NEW_RETURN (extra
, ACE_TCHAR
*[extra_argc
], -1);
17 extra
[0] = ACE::strnew (ACE_TEXT ("-ORBSvcConf"));
18 extra
[1] = ACE::strnew (ACE_TEXT ("TAO Conf File.conf"));
20 ACE_TCHAR
**largv
= new ACE_TCHAR
*[largc
+extra_argc
];
21 for (int i
= 0; i
< largc
; i
++)
25 for (int i
= 0; i
< extra_argc
; i
++)
26 largv
[argc
+i
] = extra
[i
];
30 CORBA::ORB_var orb
= CORBA::ORB_init (largc
, largv
, "FirstORB");
31 if(CORBA::is_nil(orb
.in ()))
33 ACE_ERROR((LM_ERROR
,ACE_TEXT ("Test failed. CORBA::ORB_init returned NIL ORB\n"),1));
35 for (int i
= 0; i
< extra_argc
; i
++)
36 ACE::strdelete (extra
[i
]);
45 orb
= CORBA::ORB::_nil ();
47 for (int i
= 0; i
< extra_argc
; i
++)
48 ACE::strdelete (extra
[i
]);
53 ACE_TCHAR
**second_extra
= 0;
54 ACE_NEW_RETURN (second_extra
, ACE_TCHAR
*[second_extra_argc
], -1);
55 second_extra
[0] = ACE::strnew (ACE_TEXT ("-ORBSvcConf"));
56 second_extra
[1] = ACE::strnew (ACE_TEXT ("TAO_Conf_File.conf"));
57 ACE_TCHAR
**second_largv
= new ACE_TCHAR
*[second_largc
+second_extra_argc
];
58 for (int i
= 0; i
< second_largc
; i
++)
59 second_largv
[i
] = argv
[i
];
60 for (int i
= 0; i
< second_extra_argc
; i
++)
61 second_largv
[second_largc
+ i
] = second_extra
[i
];
63 second_largc
+= second_extra_argc
;
65 CORBA::ORB_var second_orb
= CORBA::ORB_init (second_largc
, second_largv
, "SecondORB");
66 if(CORBA::is_nil(second_orb
.in ()))
68 ACE_ERROR((LM_ERROR
,ACE_TEXT ("Test failed. CORBA::ORB_init returned NIL ORB\n"),1));
70 for (int i
= 0; i
< extra_argc
; i
++)
71 ACE::strdelete (second_extra
[i
]);
73 delete [] second_extra
;
74 delete [] second_largv
;
79 second_orb
->destroy ();
80 second_orb
= CORBA::ORB::_nil ();
82 for (int i2
= 0; i2
< second_extra_argc
; i2
++)
83 ACE::strdelete (second_extra
[i2
]);
85 delete [] second_extra
;
86 delete [] second_largv
;
88 catch (const CORBA::Exception
& ex
)
90 ex
._tao_print_exception ("Exception caught:");
95 ACE_TEXT ("Test passed!\n")));
98 ACE_TEXT ("Test failed. Result: %d\n"),