summaryrefslogtreecommitdiff
path: root/ACE/tests/OS_Test.cpp
diff options
context:
space:
mode:
authorolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-26 08:34:55 +0000
committerolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-26 08:34:55 +0000
commit12a6697680b2cc572a81815874529b4f569ce14c (patch)
treee1e209d1f2bdf3761863539285948ea34920510d /ACE/tests/OS_Test.cpp
parentda0c420dd206076e0c6ca6994f41853aebf77d46 (diff)
downloadATCD-12a6697680b2cc572a81815874529b4f569ce14c.tar.gz
ChangeLogTag: Mon Oct 26 08:32:08 UTC 2009 Olli Savia <ops@iki.fi>
Diffstat (limited to 'ACE/tests/OS_Test.cpp')
-rw-r--r--ACE/tests/OS_Test.cpp50
1 files changed, 47 insertions, 3 deletions
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index 806bd468520..484136a892d 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -76,21 +76,65 @@ fileno_test (void)
int test_status = 0;
- if (ACE_OS::fileno (stdin) != ACE_STDIN)
+ ACE_HANDLE fn;
+
+ fn = ACE_OS::fileno (stdin);
+ if (fn == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("fileno returned -1 (stdin).\n")));
+ test_status = -1;
+ }
+ else if (fn != ACE_STDIN)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("stdin test failed.\n")));
test_status = -1;
}
- if (ACE_OS::fileno (stdout) != ACE_STDOUT)
+
+ fn = ACE_OS::fileno (stdout);
+ if (fn == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("fileno returned -1 (stdout).\n")));
+ test_status = -1;
+ }
+ else
+#if defined (ACE_WIN32)
+ // Check if stdout is not associated with an output stream.
+ // This not an error.
+ if (fn == -2)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("fileno returned -2 (stdout).\n")));
+ }
+ else
+#else
+ if (fn != ACE_STDOUT)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("stdout test failed.\n")));
test_status = -1;
}
- if (ACE_OS::fileno (stderr) != ACE_STDERR)
+#endif
+
+ fn = ACE_OS::fileno (stderr);
+ if (fn == -1)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("fileno returned -1 (stderr).\n")));
+ test_status = -1;
+ }
+ else
+#if defined (ACE_WIN32)
+ // Check if stderr is not associated with an output stream.
+ // This not an error.
+ if (fn == -2)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("fileno returned -2 (stderr).\n")));
+ }
+ else
+#else
+ if (fn != ACE_STDERR)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("stderr test failed.\n")));
test_status = -1;
}
+#endif
return test_status;
}