summaryrefslogtreecommitdiff
path: root/ACE/tests/OS_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2013-08-29 21:14:43 +0000
committerSteve Huston <shuston@riverace.com>2013-08-29 21:14:43 +0000
commit67cf7ece05dfdd10fddac84a42b5c0dda56c266b (patch)
treeac2409e86392576535c49c8af77944a27b731263 /ACE/tests/OS_Test.cpp
parente5101291f21487ece471d99dede211080ce9c0e2 (diff)
downloadATCD-67cf7ece05dfdd10fddac84a42b5c0dda56c266b.tar.gz
ChangeLogTag:Thu Aug 29 22:06:55 UTC 2013 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/tests/OS_Test.cpp')
-rw-r--r--ACE/tests/OS_Test.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index f89fba70922..ee0e4e3a1e9 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -1374,6 +1374,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"));
@@ -1440,6 +1463,9 @@ run_main (int, ACE_TCHAR *[])
if ((result = ace_ctype_test ()) != 0)
status = result;
+ if ((result = swab_test ()) != 0)
+ status = result;
+
if ((result = compiler_test ()) != 0)
status = result;