Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Bug_2936_Regression / bug2936.cpp
blobbec89c554952cdce204bf24452b20bb079ceab8d
1 #include "ace/Service_Config.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/OS_NS_unistd.h"
5 ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
6 "testDllOrb",
7 "bug2936",
8 "_make_DllORB",
9 "testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
12 ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
15 ACE_TCHAR const * const scpc_loadPersistentPoa = ACE_DYNAMIC_SERVICE_DIRECTIVE(
16 "testPersistentPoa",
17 "bug2936",
18 "_make_PersistentPoa",
19 "testPersistentPoa testDllOrb"
22 ACE_TCHAR const * const scpc_unloadPersistentPoa = ACE_REMOVE_SERVICE_DIRECTIVE("testPersistentPoa");
24 void loadunloadcycle()
26 int result = 0;
28 ACE_DEBUG((
29 LM_DEBUG,
30 ACE_TEXT ("(%P|%t) loadunloadcycle - loading\n")
31 ));
33 result = ACE_Service_Config::process_directive(scpc_loadOrb);
34 ACE_DEBUG((
35 LM_DEBUG,
36 ACE_TEXT ("(%P|%t) loadunloadcycle - loading ORB done\n")
37 ));
39 result = ACE_Service_Config::process_directive(scpc_loadPersistentPoa);
40 ACE_DEBUG((
41 LM_DEBUG,
42 ACE_TEXT ("(%P|%t) loadunloadcycle - loading PersistentPoa done. Result: <%d>\n"),
43 result
44 ));
46 ACE_DEBUG((
47 LM_DEBUG,
48 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading\n")
49 ));
51 ACE_OS::sleep(2);
53 ACE_DEBUG((
54 LM_DEBUG,
55 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading PersistentPoa ...\n")
56 ));
57 result = ACE_Service_Config::process_directive(scpc_unloadPersistentPoa);
58 ACE_DEBUG((
59 LM_DEBUG,
60 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading PersistentPoa done. Result: <%d>\n"),
61 result
62 ));
64 ACE_DEBUG((
65 LM_DEBUG,
66 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB ...\n")
67 ));
68 result = ACE_Service_Config::process_directive(scpc_unloadOrb);
69 ACE_DEBUG((
70 LM_DEBUG,
71 ACE_TEXT ("(%P|%t) loadunloadcycle - unloading ORB done. Result: <%d>\n"),
72 result
73 ));
76 int ACE_TMAIN(int, ACE_TCHAR ** argv)
78 int result = 0;
80 result = ACE_Service_Config::open (
81 argv[0],
82 ACE_DEFAULT_LOGGER_KEY,
83 1, // ignore_static_svcs = 1,
84 1, // ignore_default_svc_conf_file = 0,
85 0 // ignore_debug_flag = 0
87 if(result != 0)
89 ACE_DEBUG((
90 LM_DEBUG,
91 ACE_TEXT ("(%P|%t) main - ACE_Service_Config::open failed\n")
92 ));
93 return 1;
94 } /* end of if */
97 ACE_DEBUG((
98 LM_DEBUG,
99 ACE_TEXT ("(%P|%t) main - entered\n")
102 ACE_DEBUG((
103 LM_DEBUG,
104 ACE_TEXT ("(%P|%t) main - cycle 1 ...\n")
106 loadunloadcycle();
107 ACE_DEBUG((
108 LM_DEBUG,
109 ACE_TEXT ("(%P|%t) main - cycle 1 done\n")
112 ACE_DEBUG((
113 LM_DEBUG,
114 ACE_TEXT ("(%P|%t) main - cycle 2 ...\n")
116 loadunloadcycle();
117 ACE_DEBUG((
118 LM_DEBUG,
119 ACE_TEXT ("(%P|%t) main - cycle 2 done\n")
122 ACE_DEBUG((
123 LM_DEBUG,
124 ACE_TEXT ("(%P|%t) main - leaving\n")
127 return 0;