summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2013-09-26 22:18:54 +0000
committerSteve Huston <shuston@riverace.com>2013-09-26 22:18:54 +0000
commit9d29781b87c948a46cfa9be0f12ce978cb06846b (patch)
treed9520582729effd061bc0ebe3c28c09c3136462d /ACE/tests
parent6a7b1f8101bfe9d914b56a371fa0527d2293e353 (diff)
downloadATCD-9d29781b87c948a46cfa9be0f12ce978cb06846b.tar.gz
ChangeLogTag:Thu Sep 26 20:22:53 UTC 2013 Steve Huston <shuston@riverace.com> and Thu Aug 29 22:06:55 UTC 2013 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/tests')
-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;