summaryrefslogtreecommitdiff
path: root/ACE/tests/Process_Manager_Test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/tests/Process_Manager_Test.cpp')
-rw-r--r--ACE/tests/Process_Manager_Test.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/ACE/tests/Process_Manager_Test.cpp b/ACE/tests/Process_Manager_Test.cpp
index 339daa3d8eb..51f587cf68b 100644
--- a/ACE/tests/Process_Manager_Test.cpp
+++ b/ACE/tests/Process_Manager_Test.cpp
@@ -86,7 +86,9 @@ spawn_child (const ACE_TCHAR *argv0,
int my_process_id)
{
-#if defined (ACE_WIN32)
+#if defined (ACE_HAS_WINCE)
+const ACE_TCHAR *cmdline_format = ACE_TEXT("%s %d");
+#elif defined (ACE_WIN32)
const ACE_TCHAR *cmdline_format = ACE_TEXT("\"%s\" %s %d");
#elif !defined (ACE_USES_WCHAR)
const ACE_TCHAR *cmdline_format = ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT("%s %s %d");
@@ -140,11 +142,18 @@ const ACE_TCHAR *cmdline_format = ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE
prio[0] = ACE_TEXT ('\0');
#endif
+ opts.process_name (argv0);
opts.command_line (cmdline_format,
+#if !defined (ACE_HAS_WINCE)
argv0,
+#endif /* !ACE_HAS_WINCE */
cmd,
sleep_time);
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Spawning <%s> <%s>\n"),
+ opts.process_name(),
+ opts.command_line_buf ()));
+
pid_t result = mgr.spawn (opts);
if (result != ACE_INVALID_PID)
@@ -177,7 +186,7 @@ public:
{
char tmp[10];
order += ACE_OS::itoa (sleep_time_, tmp, 10);
- running_tasks++;
+ ++running_tasks;
activate ();
return 0;
}
@@ -216,7 +225,7 @@ public:
int close (u_long)
// FUZZ: enable check_for_lack_ACE_OS
{
- running_tasks--;
+ --running_tasks;
return 0;
}
@@ -296,11 +305,11 @@ run_main (int argc, ACE_TCHAR *argv[])
{
// child process: sleep & exit
ACE_TCHAR lognm[MAXPATHLEN];
- int mypid (ACE_OS::getpid ());
+ int const mypid (ACE_OS::getpid ());
ACE_OS::sprintf(lognm, ACE_TEXT ("Process_Manager_Test-child-%d"), mypid);
ACE_START_TEST (lognm);
- int secs = ACE_OS::atoi (argv[get_opt.opt_ind ()]);
+ int const secs = ACE_OS::atoi (argv[get_opt.opt_ind ()]);
ACE_OS::sleep (secs ? secs : 1);
ACE_TCHAR prio[64];
@@ -533,6 +542,7 @@ run_main (int argc, ACE_TCHAR *argv[])
}
}
+#ifdef ACE_HAS_THREADS
Process_Task task1 (argc > 0 ? argv[0] : ACE_TEXT ("Process_Manager_Test"), mgr, 3);
Process_Task task2 (argc > 0 ? argv[0] : ACE_TEXT ("Process_Manager_Test"), mgr, 2);
Process_Task task3 (argc > 0 ? argv[0] : ACE_TEXT ("Process_Manager_Test"), mgr, 1);
@@ -557,6 +567,7 @@ run_main (int argc, ACE_TCHAR *argv[])
order.c_str ()));
test_status = 1;
}
+#endif /* ACE_HAS_THREADS */
#if !defined (ACE_OPENVMS)
// --------------------------------------------------
@@ -583,7 +594,7 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P) Reactor loop done!\n") ));
- size_t nr_procs = mgr.managed ();
+ size_t const nr_procs = mgr.managed ();
if (nr_procs != 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%P) %d processes left in manager\n"),