=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / Object_Loader / driver.cpp
blob811be70a6256e34624c793b141336b7fe6605029
2 #include "TestC.h"
3 #include "tao/PortableServer/PortableServer.h"
5 #include "ace/Log_Msg.h"
6 #include "ace/OS_NS_stdio.h"
8 int
9 ACE_TMAIN(int, ACE_TCHAR *[])
11 int niterations = 10;
12 int norbs = 10;
14 try
16 for (int i = 0; i != niterations; ++i)
18 for (int j = 0; j != norbs; ++j)
20 char buf[16];
21 ACE_OS::sprintf (buf, "ORB_%4.4d", j);
23 int argc = 0;
24 ACE_TCHAR **argv = 0;
25 CORBA::ORB_var orb =
26 CORBA::ORB_init (argc, argv, buf);
28 CORBA::Object_var object =
29 orb->string_to_object ("DLL:Test_Object");
31 Test_var test =
32 Test::_narrow (object.in ());
34 if (CORBA::is_nil (test.in ()))
36 ACE_ERROR_RETURN ((LM_ERROR,
37 "Nil object reference.\n"),
38 1);
41 CORBA::Long count =
42 test->instance_count ();
44 if (count != norbs*i + j + 1)
46 ACE_DEBUG ((LM_DEBUG,
47 "Incorrect number of objects "
48 "(%d != %d)\n",
49 count, norbs * i + j + 1));
51 test->destroy ();
55 for (int j = 0; j != norbs; ++j)
57 char buf[16];
58 ACE_OS::sprintf (buf, "ORB_%4.4d", j);
60 int argc = 0;
61 ACE_TCHAR **argv = 0;
62 CORBA::ORB_var orb =
63 CORBA::ORB_init (argc, argv, buf);
65 CORBA::Object_var obj =
66 orb->resolve_initial_references ("RootPOA");
68 PortableServer::POA_var poa =
69 PortableServer::POA::_narrow (obj.in ());
71 poa->destroy (true, true);
73 orb->destroy ();
76 catch (const CORBA::Exception& ex)
78 ex._tao_print_exception ("main()");
79 return 1;
81 return 0;