summaryrefslogtreecommitdiff
path: root/tests/OS_Test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/OS_Test.cpp')
-rw-r--r--tests/OS_Test.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/OS_Test.cpp b/tests/OS_Test.cpp
index 1e664fac7ff..4c66a294e23 100644
--- a/tests/OS_Test.cpp
+++ b/tests/OS_Test.cpp
@@ -1360,6 +1360,29 @@ log2_test (void)
}
int
+swab_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing swab method\n")));
+
+ int error_count = 0;
+ char from[] = "BADCFEHGJILKNMPORQTSVUXWZY";
+ char to[] = "..........................";
+ char expect[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ ACE_OS::swab (from, to, sizeof (from));
+ if (ACE_OS::strcmp (to, expect) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("swab error: %C, expected %C\n"),
+ to, expect));
+ ++error_count;
+ }
+
+ return error_count;
+}
+
+int
run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("OS_Test"));
@@ -1426,6 +1449,9 @@ run_main (int, ACE_TCHAR *[])
if ((result = ace_ctype_test ()) != 0)
status = result;
+ if ((result = swab_test ()) != 0)
+ status = result;
+
ACE_END_TEST;
return status;
}