summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2010-01-26 19:54:00 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2010-01-26 19:54:00 +0000
commit2a42cac35b4b3b4e7063f67c14c0beb0649a3412 (patch)
tree045bc40fd8450783e603e603ab815e10b148f8c1
parente85f26b446205a2965130e85246565467ffc3a60 (diff)
downloadATCD-2a42cac35b4b3b4e7063f67c14c0beb0649a3412.tar.gz
Tue Jan 26 19:53:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Process_Test.cpp: Log some more details to get an insight why this test fails on some systems
-rw-r--r--ACE/ChangeLog6
-rw-r--r--ACE/tests/Process_Test.cpp41
2 files changed, 27 insertions, 20 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 4686d6ff0e1..1eb1a99befe 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 26 19:53:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/Process_Test.cpp:
+ Log some more details to get an insight why this test fails on
+ some systems
+
Tue Jan 26 18:04:30 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/generate_rel_manpages:
diff --git a/ACE/tests/Process_Test.cpp b/ACE/tests/Process_Test.cpp
index 11c2e22a40e..16fe303aef9 100644
--- a/ACE/tests/Process_Test.cpp
+++ b/ACE/tests/Process_Test.cpp
@@ -43,33 +43,33 @@ check_temp_file (const ACE_TString &tmpfilename)
ACE_OS::memset (&entr, 0, sizeof (entr));
// Loop through /proc/self/fs/
- if (entr.open (ACE_TEXT_CHAR_TO_TCHAR(proc_self_fd)) == -1)
+ if (entr.open (ACE_TEXT_CHAR_TO_TCHAR(proc_self_fd)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Could not open dir %C\n"),
proc_self_fd),
-1);
- while ((dir = entr.read ()))
+ while ((dir = entr.read ()))
{
ACE_CString fullp = proc_self_fd;
#if defined (ACE_HAS_TCHAR_DIRENT)
fullp += ACE_TEXT_ALWAYS_CHAR(dir->d_name);
#else
fullp += dir->d_name;
-#endif
+#endif
- if ((ACE_OS::lstat (fullp.c_str (), &stat)) == -1)
+ if ((ACE_OS::lstat (fullp.c_str (), &stat)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Stat failed for %C\n"),
fullp.c_str ()),
-1);
- if (S_ISLNK (stat.st_mode))
+ if (S_ISLNK (stat.st_mode))
{
ssize_t size = 0;
- if ((size= ACE_OS::readlink (fullp.c_str (),
- filename,
- MAXPATHLEN + 1)) == -1)
+ if ((size= ACE_OS::readlink (fullp.c_str (),
+ filename,
+ MAXPATHLEN + 1)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Readlink failed for %C\n"),
fullp.c_str ()),
@@ -91,13 +91,13 @@ run_parent (bool inherit_files)
// Create tempfile. This will be tested for inheritance.
ACE_TCHAR tempfile[MAXPATHLEN + 1];
- if (ACE::get_temp_dir (tempfile, MAXPATHLEN - sizeof (t)) == -1)
+ if (ACE::get_temp_dir (tempfile, MAXPATHLEN - sizeof (t)) == -1)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Could not get temp dir\n")));
ACE_OS::strcat (tempfile, t);
ACE_HANDLE file_handle = ACE_OS::mkstemp (tempfile);
- if (file_handle == ACE_INVALID_HANDLE)
+ if (file_handle == ACE_INVALID_HANDLE)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Could not get temp filename\n")));
// Build child options
@@ -109,7 +109,7 @@ run_parent (bool inherit_files)
(int)inherit_files,
tempfile);
options.handle_inheritance (inherit_files); /* ! */
-
+
// Spawn child
ACE_Process child;
@@ -125,7 +125,7 @@ run_parent (bool inherit_files)
result = child.wait (&child_status);
if (result == -1)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Could NOT wait on child process\n")));
- else if (child_status == 0)
+ else if (child_status == 0)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Child %d finished ok\n"),
child.getpid ()));
@@ -162,7 +162,7 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("ch:f:"));
- while ((c = getopt ()) != -1)
+ while ((c = getopt ()) != -1)
switch ((char) c)
{
case 'c':
@@ -182,10 +182,10 @@ run_main (int argc, ACE_TCHAR *argv[])
break;
}
- if (ischild)
+ if (ischild)
{
ACE_TCHAR lognm[MAXPATHLEN];
- int mypid (ACE_OS::getpid ());
+ int const mypid (ACE_OS::getpid ());
ACE_OS::sprintf(lognm, ACE_TEXT ("Process_Test-child-%d"), mypid);
ACE_START_TEST (lognm);
@@ -196,15 +196,16 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Could not retrieve open files\n")),
-1);
- else if (result == handle_inherit)
+ else if (result == handle_inherit)
result = 0;
- else
+ else
ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Handle inheritance test failed\n")));
+ ACE_TEXT ("Handle inheritance test failed with ")
+ ACE_TEXT ("%d, expected %d\n"), result, handle_inherit));
ACE_END_LOG;
return result;
}
- else
+ else
{
ACE_START_TEST (ACE_TEXT ("Process_Test"));
@@ -215,7 +216,7 @@ run_main (int argc, ACE_TCHAR *argv[])
run_parent (false);
ACE_END_TEST;
- }
+ }
#endif /* ! ACE_LACKS_FORK */
return 0;