summaryrefslogtreecommitdiff
path: root/ACE/tests/OS_Test.cpp
diff options
context:
space:
mode:
authorolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-06 18:36:27 +0000
committerolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-06 18:36:27 +0000
commit18994203a03ed847d54b94d44c90c98705b7a105 (patch)
treeed6f593113a799f4ed983e79438be38389ed7837 /ACE/tests/OS_Test.cpp
parent216dff9831ef7b3cfade899f211ca29ffd8c99da (diff)
downloadATCD-18994203a03ed847d54b94d44c90c98705b7a105.tar.gz
ChangeLogTag: Tue Oct 6 18:33:50 UTC 2009 Olli Savia <ops@iki.fi>
Diffstat (limited to 'ACE/tests/OS_Test.cpp')
-rw-r--r--ACE/tests/OS_Test.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index 632685a96bc..3660763048c 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -44,6 +44,9 @@ template <typename T> bool is_equal (const T& a, const T& b)
int
access_test (void)
{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing access method\n")));
+
int test_status = 0;
int status = ACE_OS::access (ACE_TEXT ("missing_file.txt"), F_OK);
@@ -63,6 +66,34 @@ access_test (void)
return test_status;
}
+// Test ACE_OS::fileno()
+int
+fileno_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing fileno method\n")));
+
+ int test_status = 0;
+
+ if (ACE_OS::fileno (stdin) != ACE_STDIN)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("stdin test failed.\n")));
+ test_status = -1;
+ }
+ if (ACE_OS::fileno (stdout) != ACE_STDOUT)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("stdout test failed.\n")));
+ test_status = -1;
+ }
+ if (ACE_OS::fileno (stderr) != ACE_STDERR)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("stderr test failed.\n")));
+ test_status = -1;
+ }
+
+ return test_status;
+}
+
// Test ACE_OS::rename to be sure the files come and go as expected.
int
rename_test (void)
@@ -1188,6 +1219,9 @@ run_main (int, ACE_TCHAR *[])
if ((result = access_test ()) != 0)
status = result;
+ if ((result = fileno_test ()) != 0)
+ status = result;
+
if ((result = rename_test ()) != 0)
status = result;