summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-10-19 23:21:25 +0000
committerjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-10-19 23:21:25 +0000
commit69ee622a24555031b349a3612810c1846f098e6b (patch)
treea48b18ebfccae4af1f45e5707d946c9d6b496752
parente3ff5e3f7fc148f5050b3e523b9983b6b08f0fb8 (diff)
downloadATCD-69ee622a24555031b349a3612810c1846f098e6b.tar.gz
Dave's wchar test fixes
-rw-r--r--tests/ARGV_Test.cpp2
-rw-r--r--tests/Basic_Types_Test.cpp2
-rw-r--r--tests/Bound_Ptr_Test.cpp2
-rw-r--r--tests/CDR_File_Test.cpp1
-rw-r--r--tests/CDR_Test.cpp4
-rw-r--r--tests/Dirent_Test.cpp2
-rw-r--r--tests/Enum_Interfaces_Test.cpp2
-rw-r--r--tests/Env_Value_Test.cpp2
-rw-r--r--tests/HTBP/Reactor_Tests/client.cpp4
-rw-r--r--tests/HTBP/Reactor_Tests/test_config.h2
-rw-r--r--tests/HTBP/Send_Large_Msg/client.cpp4
-rw-r--r--tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp6
-rw-r--r--tests/HTBP/ping/client.cpp4
-rw-r--r--tests/INET_Addr_Test_IPV6.cpp2
-rw-r--r--tests/IOStream_Test.cpp6
-rw-r--r--tests/Log_Msg_Test.cpp2
-rw-r--r--tests/MT_SOCK_Test.cpp2
-rw-r--r--tests/Message_Block_Test.cpp4
-rw-r--r--tests/Multihomed_INET_Addr_Test_IPV6.cpp2
-rw-r--r--tests/NonBlocking_Conn_Test.cpp2
-rw-r--r--tests/OS_Test.cpp16
-rw-r--r--tests/Proactor_Timer_Test.cpp6
-rw-r--r--tests/Process_Semaphore_Test.cpp8
-rw-r--r--tests/Process_Strategy_Test.cpp4
-rw-r--r--tests/Reactor_Dispatch_Order_Test.cpp2
-rw-r--r--tests/Reactor_Timer_Test.cpp8
-rw-r--r--tests/Refcounted_Auto_Ptr_Test.cpp2
-rw-r--r--tests/SOCK_Connector_Test.cpp8
-rw-r--r--tests/SOCK_Send_Recv_Test.cpp4
-rw-r--r--tests/SOCK_Send_Recv_Test_IPV6.cpp4
-rw-r--r--tests/SOCK_Test.cpp4
-rw-r--r--tests/SOCK_Test_IPv6.cpp4
-rw-r--r--tests/SString_Test.cpp4
-rw-r--r--tests/Svc_Handler_Test.cpp2
-rw-r--r--tests/Test_Output.cpp4
-rw-r--r--tests/tests.mpc7
36 files changed, 70 insertions, 74 deletions
diff --git a/tests/ARGV_Test.cpp b/tests/ARGV_Test.cpp
index bb06c6b8d31..a2eb057d5d4 100644
--- a/tests/ARGV_Test.cpp
+++ b/tests/ARGV_Test.cpp
@@ -70,7 +70,7 @@ test_argv_type_converter (void)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT (" (%d) %s\n"),
i,
- ACE_TEXT_CHAR_TO_TCHAR (argv[i])));
+ ACE_TEXT_TO_TCHAR_IN (argv[i])));
}
for (size_t i = 0; save_argv[i]; ++i)
diff --git a/tests/Basic_Types_Test.cpp b/tests/Basic_Types_Test.cpp
index 7df2604225e..4c2198b3485 100644
--- a/tests/Basic_Types_Test.cpp
+++ b/tests/Basic_Types_Test.cpp
@@ -74,10 +74,8 @@ run_main (int, ACE_TCHAR *[])
errors += check (ACE_TEXT ("ACE_SIZEOF_CHAR: %u%s"),
sizeof (char), ACE_SIZEOF_CHAR);
-#if defined (ACE_HAS_WCHAR)
errors += check (ACE_TEXT ("ACE_SIZEOF_WCHAR: %u%s"),
sizeof (wchar_t), ACE_SIZEOF_WCHAR);
-#endif /* ACE_HAS_WCHAR */
errors += check (ACE_TEXT ("ACE_SIZEOF_SHORT: %u%s"),
sizeof (short), ACE_SIZEOF_SHORT);
errors += check (ACE_TEXT ("ACE_SIZEOF_INT: %u%s"),
diff --git a/tests/Bound_Ptr_Test.cpp b/tests/Bound_Ptr_Test.cpp
index 476b1b39156..95d6bb77cd9 100644
--- a/tests/Bound_Ptr_Test.cpp
+++ b/tests/Bound_Ptr_Test.cpp
@@ -179,7 +179,7 @@ Printer::print (void)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(this->message_)));
+ ACE_TEXT_TO_TCHAR_IN(this->message_)));
}
#if defined (ACE_HAS_THREADS)
diff --git a/tests/CDR_File_Test.cpp b/tests/CDR_File_Test.cpp
index 6a4dfcc9c55..fec456c2e3f 100644
--- a/tests/CDR_File_Test.cpp
+++ b/tests/CDR_File_Test.cpp
@@ -21,6 +21,7 @@
#include "test_config.h"
#include "ace/OS_Memory.h"
#include "ace/OS_NS_stdlib.h"
+#include "ace/OS_NS_string.h"
#include "ace/CDR_Stream.h"
#include "ace/FILE_Connector.h"
#include "ace/Auto_Ptr.h"
diff --git a/tests/CDR_Test.cpp b/tests/CDR_Test.cpp
index fbbc7414e78..b67599f9e53 100644
--- a/tests/CDR_Test.cpp
+++ b/tests/CDR_Test.cpp
@@ -228,7 +228,7 @@ short_stream (void)
ACE_TEXT ("string transfer error")),
1);
- if (ACE_OS::wscmp (wstr1, wstr))
+ if (ACE_OS::strcmp (wstr1, wstr))
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("wide string transfer error")),
@@ -430,7 +430,7 @@ CDR_Test_Types::test_get (ACE_InputCDR &cdr) const
1);
// zero length
ACE_Auto_Basic_Array_Ptr<ACE_CDR::WChar> auto_xwstr (wstr1);
- if (ACE_OS::wslen(auto_xwstr.get () ))
+ if (ACE_OS::strlen(auto_xwstr.get () ))
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("wstring[%d] differs\n"),
i),
diff --git a/tests/Dirent_Test.cpp b/tests/Dirent_Test.cpp
index 10262f3c77f..8b42ebd0ca0 100644
--- a/tests/Dirent_Test.cpp
+++ b/tests/Dirent_Test.cpp
@@ -202,7 +202,7 @@ dirent_count (const ACE_TCHAR *dir_path,
#if !defined (ACE_LACKS_STRUCT_DIR)
ACE_OS::strncpy (tname,
- ACE_TEXT_CHAR_TO_TCHAR (directory->d_name),
+ ACE_TEXT_TO_TCHAR_IN (directory->d_name),
maxnamlen);
#else
ACE_OS::strncpy (tname, directory->d_name, maxnamlen);
diff --git a/tests/Enum_Interfaces_Test.cpp b/tests/Enum_Interfaces_Test.cpp
index b9bd438c6c0..0ef53a9942c 100644
--- a/tests/Enum_Interfaces_Test.cpp
+++ b/tests/Enum_Interfaces_Test.cpp
@@ -63,7 +63,7 @@ run_main (int, ACE_TCHAR *[])
for (size_t i = 0; i < how_many; i++)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\t%s\n"),
- ACE_TEXT_CHAR_TO_TCHAR (the_addr_array[i].get_host_addr ())));
+ ACE_TEXT_TO_TCHAR_IN (the_addr_array[i].get_host_addr ())));
delete [] the_addr_array;
}
diff --git a/tests/Env_Value_Test.cpp b/tests/Env_Value_Test.cpp
index ca9674127a0..96bc2a522a2 100644
--- a/tests/Env_Value_Test.cpp
+++ b/tests/Env_Value_Test.cpp
@@ -110,7 +110,7 @@ run_main (int argc, ACE_TCHAR * [], ACE_TCHAR *envp[])
const ACE_TCHAR *defstr = ACE_TEXT ("Sarah Cleeland is Two!");
ACE_Env_Value<const ACE_TCHAR *> sval (ACE_TEXT ("This_Shouldnt_Be_Set_Hopefully"),
defstr);
- ACE_ASSERT (ACE_OS::strcmp (sval, defstr) == 0);
+ ACE_ASSERT (ACE_OS::strcmp (static_cast<const ACE_TCHAR *>(sval), defstr) == 0);
ACE_END_TEST;
}
return 0;
diff --git a/tests/HTBP/Reactor_Tests/client.cpp b/tests/HTBP/Reactor_Tests/client.cpp
index 2813d9116f3..a3cafc76e49 100644
--- a/tests/HTBP/Reactor_Tests/client.cpp
+++ b/tests/HTBP/Reactor_Tests/client.cpp
@@ -29,7 +29,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
#endif /* 0 */
ACE::HTBP::ID_Requestor req (&env);
- ACE::HTBP::Addr local = ACE_TEXT_ALWAYS_CHAR(req.get_HTID());
+ ACE::HTBP::Addr local = ACE_TEXT_TO_CHAR_IN(req.get_HTID());
unsigned remote_port = 8088;
const ACE_TCHAR * remote_host = argv[1];
@@ -48,7 +48,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
ACE_INET_Addr proxy(proxy_port,proxy_host.c_str());
- ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host));
+ ACE::HTBP::Addr remote (remote_port,ACE_TEXT_TO_CHAR_IN(remote_host));
ACE::HTBP::Session session(remote,local,ACE::HTBP::Session::next_session_id(),&proxy);
ACE::HTBP::Stream stream (&session);
diff --git a/tests/HTBP/Reactor_Tests/test_config.h b/tests/HTBP/Reactor_Tests/test_config.h
index 8a707c4c5c3..3697dd9d294 100644
--- a/tests/HTBP/Reactor_Tests/test_config.h
+++ b/tests/HTBP/Reactor_Tests/test_config.h
@@ -251,7 +251,7 @@ ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
# endif /* ! VXWORKS */
# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
- this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ this->output_file_->open (ACE_TEXT_TO_CHAR_IN (temp),
ios::out | (append ? ios::app : ios::trunc));
if (this->output_file_->bad ())
return -1;
diff --git a/tests/HTBP/Send_Large_Msg/client.cpp b/tests/HTBP/Send_Large_Msg/client.cpp
index 62cd9140da8..4f1fafd8618 100644
--- a/tests/HTBP/Send_Large_Msg/client.cpp
+++ b/tests/HTBP/Send_Large_Msg/client.cpp
@@ -32,7 +32,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE::HTBP::ID_Requestor req (&env);
- ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID()));
+ ACE::HTBP::Addr local(ACE_TEXT_TO_CHAR_IN(req.get_HTID()));
unsigned remote_port = 8088;
const ACE_TCHAR * remote_host = argv[1];
@@ -51,7 +51,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
ACE_INET_Addr proxy(proxy_port,proxy_host.c_str());
- ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host));
+ ACE::HTBP::Addr remote (remote_port,ACE_TEXT_TO_CHAR_IN(remote_host));
ACE::HTBP::Session session(remote,
local,
diff --git a/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp b/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp
index d462a11c3d3..d670dfab39e 100644
--- a/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp
+++ b/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp
@@ -69,7 +69,7 @@ client (void *arg)
#endif /* 0 */
ACE::HTBP::ID_Requestor req (&ht_env);
- ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID()));
+ ACE::HTBP::Addr local(ACE_TEXT_TO_CHAR_IN(req.get_HTID()));
char hostname [128];
@@ -94,7 +94,7 @@ client (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) connected to %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(remote.get_host_name ())));
+ ACE_TEXT_TO_TCHAR_IN(remote.get_host_name ())));
//******************* TEST 1 ******************************
//
@@ -230,7 +230,7 @@ server (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()),
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()),
cli_addr.get_port_number ()));
//******************* TEST 1 ******************************
diff --git a/tests/HTBP/ping/client.cpp b/tests/HTBP/ping/client.cpp
index e7753faab6d..e50fbd9a207 100644
--- a/tests/HTBP/ping/client.cpp
+++ b/tests/HTBP/ping/client.cpp
@@ -30,7 +30,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
ACE::HTBP::ID_Requestor req (&env);
- ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID()));
+ ACE::HTBP::Addr local(ACE_TEXT_TO_CHAR_IN(req.get_HTID()));
unsigned remote_port = 8088;
const ACE_TCHAR * remote_host = argv[1];
@@ -49,7 +49,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
ACE_INET_Addr proxy(proxy_port,proxy_host.c_str());
- ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host));
+ ACE::HTBP::Addr remote (remote_port,ACE_TEXT_TO_CHAR_IN(remote_host));
ACE::HTBP::Session session(remote,
local,
diff --git a/tests/INET_Addr_Test_IPV6.cpp b/tests/INET_Addr_Test_IPV6.cpp
index 134119ae7b9..b8694c208b8 100644
--- a/tests/INET_Addr_Test_IPV6.cpp
+++ b/tests/INET_Addr_Test_IPV6.cpp
@@ -139,7 +139,7 @@ int run_main (int argc, ACE_TCHAR *argv[])
#if defined (__linux__)
// test a link local address to make sure the set_interface method works
ACE_INET_Addr link_local_addr (80, LINK_LOCAL_ADDR);
- if (0 != ACE_OS::strcmp (ACE_TEXT_CHAR_TO_TCHAR(link_local_addr.get_host_addr ()),
+ if (0 != ACE_OS::strcmp (ACE_TEXT_TO_TCHAR_IN(link_local_addr.get_host_addr ()),
LINK_LOCAL_ADDR))
{
ACE_ERROR ((LM_ERROR,
diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp
index 7f02a590fcf..0c2b5f0101a 100644
--- a/tests/IOStream_Test.cpp
+++ b/tests/IOStream_Test.cpp
@@ -189,7 +189,7 @@ client (void *arg = 0)
// Send a string to the server which it can interpret as a qchar[]
const char *str = "\"This is a test string.\"";
ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%P|%t) Client Sending: (%s)\n"),
- ACE_TEXT_CHAR_TO_TCHAR (str)));
+ ACE_TEXT_TO_TCHAR_IN (str)));
server << str << endl;
// Allow the server to get the string and echo it to the user. (The
@@ -324,7 +324,7 @@ server (void *arg = 0)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT (" (%P|%t) Server Received: (\"%s\")\n"),
- ACE_TEXT_CHAR_TO_TCHAR ((char *) qbuf)));
+ ACE_TEXT_TO_TCHAR_IN ((char *) qbuf)));
// Give the client time to announce the next test to the user.
ACE_OS::sleep (2);
@@ -365,7 +365,7 @@ server (void *arg = 0)
break;
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s "),
- ACE_TEXT_CHAR_TO_TCHAR (buf)));
+ ACE_TEXT_TO_TCHAR_IN (buf)));
}
ACE_DEBUG ((LM_DEBUG,
diff --git a/tests/Log_Msg_Test.cpp b/tests/Log_Msg_Test.cpp
index 8df03ca42d3..1a8a6276c87 100644
--- a/tests/Log_Msg_Test.cpp
+++ b/tests/Log_Msg_Test.cpp
@@ -373,7 +373,7 @@ test_ostream (void)
#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
// Create a persistent store.
const ACE_TCHAR *filename = ACE_TEXT ("output");
- ofstream myostream (ACE_TEXT_ALWAYS_CHAR (filename), ios::out | ios::trunc);
+ ofstream myostream (ACE_TEXT_TO_CHAR_IN (filename), ios::out | ios::trunc);
// Check for errors.
if (myostream.bad ())
diff --git a/tests/MT_SOCK_Test.cpp b/tests/MT_SOCK_Test.cpp
index 483c075b455..0cb9bab0827 100644
--- a/tests/MT_SOCK_Test.cpp
+++ b/tests/MT_SOCK_Test.cpp
@@ -218,7 +218,7 @@ server (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) server: Client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()),
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()),
cli_addr.get_port_number ()));
// Enable non-blocking I/O.
diff --git a/tests/Message_Block_Test.cpp b/tests/Message_Block_Test.cpp
index 1bd37ef2880..57ac4740792 100644
--- a/tests/Message_Block_Test.cpp
+++ b/tests/Message_Block_Test.cpp
@@ -119,7 +119,7 @@ Worker_Task::svc (void)
// message here.
else if (length > 0)
{
- int current_count = ACE_OS::atoi (ACE_TEXT_CHAR_TO_TCHAR (mb->rd_ptr ()));
+ int current_count = ACE_OS::atoi (ACE_TEXT_TO_TCHAR_IN (mb->rd_ptr ()));
int i;
ACE_ASSERT (count == current_count);
@@ -157,7 +157,7 @@ Worker_Task::svc (void)
for (i = current_count; i > 0; i--)
{
ACE_ASSERT (this->msg_queue ()->dequeue_head (dup) != -1);
- ACE_ASSERT (count == ACE_OS::atoi (ACE_TEXT_CHAR_TO_TCHAR (dup->rd_ptr ())));
+ ACE_ASSERT (count == ACE_OS::atoi (ACE_TEXT_TO_TCHAR_IN (dup->rd_ptr ())));
ACE_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), dup->rd_ptr ()) == 0);
ACE_ASSERT (dup->msg_priority () == ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY + 1);
dup->release ();
diff --git a/tests/Multihomed_INET_Addr_Test_IPV6.cpp b/tests/Multihomed_INET_Addr_Test_IPV6.cpp
index 1607dd81fb2..7427a757e0d 100644
--- a/tests/Multihomed_INET_Addr_Test_IPV6.cpp
+++ b/tests/Multihomed_INET_Addr_Test_IPV6.cpp
@@ -96,7 +96,7 @@ int run_main (int argc, ACE_TCHAR *argv[])
}
// Check the primary address
- if (0 != ACE_OS::strcmp (ACE_TEXT_CHAR_TO_TCHAR(addr.get_host_addr()), primary_ipv6))
+ if (0 != ACE_OS::strcmp (ACE_TEXT_TO_TCHAR_IN(addr.get_host_addr()), primary_ipv6))
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%s failed get_host_addr() check\n")
diff --git a/tests/NonBlocking_Conn_Test.cpp b/tests/NonBlocking_Conn_Test.cpp
index 42ed8adc1e1..1a0037006fe 100644
--- a/tests/NonBlocking_Conn_Test.cpp
+++ b/tests/NonBlocking_Conn_Test.cpp
@@ -168,7 +168,7 @@ test (ACE_Reactor_Impl *impl)
else
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("%p\n"),
- ACE_TEXT_CHAR_TO_TCHAR (hosts[i])));
+ ACE_TEXT_TO_TCHAR_IN (hosts[i])));
}
ACE_Reactor reactor (impl,
diff --git a/tests/OS_Test.cpp b/tests/OS_Test.cpp
index e5f089e1ed1..bd661d52f0a 100644
--- a/tests/OS_Test.cpp
+++ b/tests/OS_Test.cpp
@@ -284,7 +284,6 @@ string_emulation_test (void)
"-4566733") == 0);
}
-#if defined (ACE_HAS_WCHAR)
{
// ========================================================================
// Test itoa (wchar_t version)
@@ -519,7 +518,6 @@ string_emulation_test (void)
}
-#endif /* ACE_HAS_WCHAR */
return 0;
}
@@ -661,7 +659,6 @@ string_strsncpy_test (void)
}
-#if defined (ACE_HAS_WCHAR)
{
// Test strsncpy (wchar_t version)
ACE_DEBUG ((LM_DEBUG,
@@ -728,7 +725,6 @@ string_strsncpy_test (void)
// size should be 9 (+ '\0' char)
ACE_ASSERT(ACE_OS::strlen(strsncpy2) == 9);
}
-#endif /* ACE_HAS_WCHAR */
return 0;
}
@@ -738,7 +734,6 @@ string_strsncpy_test (void)
int
string_convert_test (void)
{
-#if defined (ACE_HAS_WCHAR)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Testing narrow/wide string conversion\n")));
@@ -749,28 +744,28 @@ string_convert_test (void)
const wchar_t *test2_w = ACE_TEXT_WIDE ("\xe9\xe8\xe0\xf9\xea");
wchar_t str_w[10];
char str_n[10];
- ACE_OS::strcpy (str_w, ACE_Ascii_To_Wide (test1_n).wchar_rep ());
+ ACE_OS::strcpy (str_w, ACE_TEXT_TO_WCHAR_IN (test1_n));
if (0 != ACE_OS::strcmp (test1_w, str_w))
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Simple narrow->wide failed: ")
ACE_TEXT ("Expected \"%W\"; Got \"%W\"\n"), test1_w, str_w));
result = 1;
}
- ACE_OS::strcpy (str_n, ACE_Wide_To_Ascii (test1_w).char_rep ());
+ ACE_OS::strcpy (str_n, ACE_TEXT_TO_CHAR_IN (test1_w));
if (0 != ACE_OS::strcmp (test1_n, str_n))
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Simple wide->narrow failed: ")
ACE_TEXT ("Expected \"%C\"; Got \"%C\"\n"), test1_n, str_n));
result = 1;
}
- ACE_OS::strcpy (str_w, ACE_Ascii_To_Wide (test2_n).wchar_rep ());
+ ACE_OS::strcpy (str_w, ACE_TEXT_TO_WCHAR_IN (test2_n));
if (0 != ACE_OS::strcmp (test2_w, str_w))
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Complex narrow->wide failed: ")
ACE_TEXT ("Expected \"%W\"; Got \"%W\"\n"), test2_w, str_w));
result = 1;
}
- ACE_OS::strcpy (str_n, ACE_Wide_To_Ascii (test2_w).char_rep ());
+ ACE_OS::strcpy (str_n, ACE_TEXT_TO_CHAR_IN (test2_w));
if (0 != ACE_OS::strcmp (test2_n, str_n))
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Complex wide->narrow failed: ")
@@ -778,9 +773,6 @@ string_convert_test (void)
result = 1;
}
return result;
-#else
- return 0;
-#endif /* ACE_HAS_WCHAR */
}
// Test the methods for getting cpu info
diff --git a/tests/Proactor_Timer_Test.cpp b/tests/Proactor_Timer_Test.cpp
index da61f142143..9b2e282fcab 100644
--- a/tests/Proactor_Timer_Test.cpp
+++ b/tests/Proactor_Timer_Test.cpp
@@ -112,7 +112,7 @@ test_registering_all_handlers (void)
{
ACE_Trace t (ACE_TEXT ("test_registering_all_handler"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
size_t which[ACE_MAX_TIMERS];
@@ -138,7 +138,7 @@ test_registering_one_handler (void)
{
ACE_Trace t (ACE_TEXT ("test_registering_one_handler"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
size_t which[ACE_MAX_TIMERS];
@@ -166,7 +166,7 @@ test_canceling_odd_timers (void)
{
ACE_Trace t (ACE_TEXT ("test_canceling_odd_timers"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
size_t which[ACE_MAX_TIMERS];
diff --git a/tests/Process_Semaphore_Test.cpp b/tests/Process_Semaphore_Test.cpp
index af08108ad75..c3d25c3c0a9 100644
--- a/tests/Process_Semaphore_Test.cpp
+++ b/tests/Process_Semaphore_Test.cpp
@@ -80,11 +80,11 @@ acquire_release (void)
#if defined (ACE_WIN32) || \
defined (ACE_USES_FIFO_SEM) || \
(defined (ACE_HAS_POSIX_SEM) && !defined (ACE_LACKS_NAMED_POSIX_SEM))
- ACE_Semaphore sema_ping (0, USYNC_PROCESS, ACE_TEXT_CHAR_TO_TCHAR (sema_ping_name));
- ACE_Semaphore sema_pong (0, USYNC_PROCESS, ACE_TEXT_CHAR_TO_TCHAR (sema_pong_name));
+ ACE_Semaphore sema_ping (0, USYNC_PROCESS, ACE_TEXT_TO_TCHAR_IN (sema_ping_name));
+ ACE_Semaphore sema_pong (0, USYNC_PROCESS, ACE_TEXT_TO_TCHAR_IN (sema_pong_name));
#else
- ACE_Process_Semaphore sema_ping (0, ACE_TEXT_CHAR_TO_TCHAR (sema_ping_name));
- ACE_Process_Semaphore sema_pong (0, ACE_TEXT_CHAR_TO_TCHAR (sema_pong_name));
+ ACE_Process_Semaphore sema_ping (0, ACE_TEXT_TO_TCHAR_IN (sema_ping_name));
+ ACE_Process_Semaphore sema_pong (0, ACE_TEXT_TO_TCHAR_IN (sema_pong_name));
#endif
// Make sure the constructor succeeded
diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp
index f74e36939d3..7bbc3463b60 100644
--- a/tests/Process_Strategy_Test.cpp
+++ b/tests/Process_Strategy_Test.cpp
@@ -446,7 +446,7 @@ Counting_Service::handle_input (ACE_HANDLE)
bytes,
this->peer ().get_handle (),
bytes,
- ACE_TEXT_CHAR_TO_TCHAR (buf)));
+ ACE_TEXT_TO_TCHAR_IN (buf)));
// Read and return the current value in the file.
if (ACE_OS::strncmp (buf,
"read",
@@ -611,7 +611,7 @@ client (void *arg)
// the call to ACE_OS::strrchr ().
buf [bytes_read] = '\0';
- size_t count = ACE_OS::atoi (ACE_OS::strrchr (ACE_TEXT_CHAR_TO_TCHAR (buf),
+ size_t count = ACE_OS::atoi (ACE_OS::strrchr (ACE_TEXT_TO_TCHAR_IN (buf),
ACE_TEXT (' ')));
ACE_DEBUG ((LM_DEBUG,
diff --git a/tests/Reactor_Dispatch_Order_Test.cpp b/tests/Reactor_Dispatch_Order_Test.cpp
index 9e90801f0d6..e40ed4ba685 100644
--- a/tests/Reactor_Dispatch_Order_Test.cpp
+++ b/tests/Reactor_Dispatch_Order_Test.cpp
@@ -129,7 +129,7 @@ Handler::handle_input (ACE_HANDLE fd)
ACE_DEBUG ((LM_DEBUG,
"Handler::handle_input: %s\n",
- ACE_TEXT_CHAR_TO_TCHAR (buffer)));
+ ACE_TEXT_TO_TCHAR_IN (buffer)));
ACE_ASSERT (ACE_OS::strcmp (buffer,
message) == 0);
diff --git a/tests/Reactor_Timer_Test.cpp b/tests/Reactor_Timer_Test.cpp
index 36855aa296c..e62871e37bf 100644
--- a/tests/Reactor_Timer_Test.cpp
+++ b/tests/Reactor_Timer_Test.cpp
@@ -127,7 +127,7 @@ test_registering_all_handlers (void)
{
ACE_Trace t (ACE_TEXT ("test_registering_all_handler"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
@@ -150,7 +150,7 @@ test_registering_one_handler (void)
{
ACE_Trace t (ACE_TEXT ("test_registering_one_handler"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
@@ -175,7 +175,7 @@ test_canceling_odd_timers (void)
{
ACE_Trace t (ACE_TEXT ("test_canceling_odd_timers"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt[ACE_MAX_TIMERS];
long t_id[ACE_MAX_TIMERS];
@@ -210,7 +210,7 @@ test_resetting_timer_intervals (void)
{
ACE_Trace t (ACE_TEXT ("test_resetting_timer_intervals"),
__LINE__,
- ACE_TEXT_CHAR_TO_TCHAR (__FILE__));
+ ACE_TEXT_TO_TCHAR_IN (__FILE__));
Time_Handler rt;
long t_id;
diff --git a/tests/Refcounted_Auto_Ptr_Test.cpp b/tests/Refcounted_Auto_Ptr_Test.cpp
index 379d6a6901b..a63a0e6e848 100644
--- a/tests/Refcounted_Auto_Ptr_Test.cpp
+++ b/tests/Refcounted_Auto_Ptr_Test.cpp
@@ -53,7 +53,7 @@ Printer::print (void)
{
ACE_DEBUG ((LM_DEBUG,
ACE_LIB_TEXT ("(%t) %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(this->message_)));
+ ACE_TEXT_TO_TCHAR_IN(this->message_)));
}
#if defined (ACE_HAS_THREADS)
diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp
index 0eee2d171d3..229bac706fd 100644
--- a/tests/SOCK_Connector_Test.cpp
+++ b/tests/SOCK_Connector_Test.cpp
@@ -93,7 +93,7 @@ find_another_host (ACE_TCHAR other_host[])
ACE_OS::strcpy (other_host, ACE_LOCALHOST);
else
// Use me if can't find another
- ACE_OS::strcpy (other_host, ACE_TEXT_CHAR_TO_TCHAR (h->h_name));
+ ACE_OS::strcpy (other_host, ACE_TEXT_TO_TCHAR_IN (h->h_name));
// @@ We really need to add wrappers for these hostent methods.
@@ -114,7 +114,7 @@ find_another_host (ACE_TCHAR other_host[])
while ((h = gethostent ()) != 0)
{
if (ACE_OS::strcmp (h->h_name,
- ACE_TEXT_ALWAYS_CHAR (ACE_DEFAULT_SERVER_HOST)) == 0)
+ ACE_TEXT_TO_CHAR_IN (ACE_DEFAULT_SERVER_HOST)) == 0)
continue;
// AIX just _has_ to be different
if (ACE_OS::strcmp (h->h_name, "loopback") == 0)
@@ -122,11 +122,11 @@ find_another_host (ACE_TCHAR other_host[])
// If not me.
if (ACE_OS::strcmp
- (h->h_name, ACE_TEXT_ALWAYS_CHAR (other_host)) != 0
+ (h->h_name, ACE_TEXT_TO_CHAR_IN (other_host)) != 0
&& ACE_OS::strcmp (h->h_name, un.nodename) != 0)
{
ACE_OS::strcpy (candidate[candidate_count].host_name,
- ACE_TEXT_CHAR_TO_TCHAR (h->h_name));
+ ACE_TEXT_TO_TCHAR_IN (h->h_name));
if (++candidate_count >= MAX_CANDIDATES)
break;
}
diff --git a/tests/SOCK_Send_Recv_Test.cpp b/tests/SOCK_Send_Recv_Test.cpp
index f971c98e65b..3366be73b58 100644
--- a/tests/SOCK_Send_Recv_Test.cpp
+++ b/tests/SOCK_Send_Recv_Test.cpp
@@ -81,7 +81,7 @@ client (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) connected to %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(server_addr.get_host_name ())));
+ ACE_TEXT_TO_TCHAR_IN(server_addr.get_host_name ())));
//******************* TEST 1 ******************************
//
@@ -208,7 +208,7 @@ server (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()),
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()),
cli_addr.get_port_number ()));
//******************* TEST 1 ******************************
diff --git a/tests/SOCK_Send_Recv_Test_IPV6.cpp b/tests/SOCK_Send_Recv_Test_IPV6.cpp
index b630ffb00ec..5626671fb27 100644
--- a/tests/SOCK_Send_Recv_Test_IPV6.cpp
+++ b/tests/SOCK_Send_Recv_Test_IPV6.cpp
@@ -76,7 +76,7 @@ client (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) connected to %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(server_addr.get_host_name ())));
+ ACE_TEXT_TO_TCHAR_IN(server_addr.get_host_name ())));
//******************* TEST 1 ******************************
//
@@ -203,7 +203,7 @@ server (void *arg)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()),
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()),
cli_addr.get_port_number ()));
//******************* TEST 1 ******************************
diff --git a/tests/SOCK_Test.cpp b/tests/SOCK_Test.cpp
index 6472711a857..2cd92351063 100644
--- a/tests/SOCK_Test.cpp
+++ b/tests/SOCK_Test.cpp
@@ -63,7 +63,7 @@ client (void *arg)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("connection failed")), 0);
else
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) connected to %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(server_addr.get_host_name ())));
+ ACE_TEXT_TO_TCHAR_IN(server_addr.get_host_name ())));
}
if (cli_stream.disable (ACE_NONBLOCK) == -1)
@@ -141,7 +141,7 @@ server (void *arg)
while ((result = peer_acceptor->accept (new_stream, &cli_addr)) != -1)
{
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()), cli_addr.get_port_number ()));
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()), cli_addr.get_port_number ()));
// Enable non-blocking I/O.
if (new_stream.enable (ACE_NONBLOCK) == -1)
diff --git a/tests/SOCK_Test_IPv6.cpp b/tests/SOCK_Test_IPv6.cpp
index 08950687fcf..31082bb9e97 100644
--- a/tests/SOCK_Test_IPv6.cpp
+++ b/tests/SOCK_Test_IPv6.cpp
@@ -64,7 +64,7 @@ client (void *arg)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("connection failed")), 0);
else
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) connected to %s\n"),
- ACE_TEXT_CHAR_TO_TCHAR(server_addr.get_host_name ())));
+ ACE_TEXT_TO_TCHAR_IN(server_addr.get_host_name ())));
}
if (cli_stream.disable (ACE_NONBLOCK) == -1)
@@ -142,7 +142,7 @@ server (void *arg)
while ((result = peer_acceptor->accept (new_stream, &cli_addr)) != -1)
{
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) client %s connected from %d\n"),
- ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()), cli_addr.get_port_number ()));
+ ACE_TEXT_TO_TCHAR_IN(cli_addr.get_host_name ()), cli_addr.get_port_number ()));
// Enable non-blocking I/O.
if (new_stream.enable (ACE_NONBLOCK) == -1)
diff --git a/tests/SString_Test.cpp b/tests/SString_Test.cpp
index a6726e7a9fb..265d690fbf7 100644
--- a/tests/SString_Test.cpp
+++ b/tests/SString_Test.cpp
@@ -26,7 +26,6 @@
ACE_RCSID(tests, SString_Test, "$Id$")
static int testConcatenation() {
-#ifdef ACE_HAS_WCHAR
ACE_WString s1;
s1 += L'H';
if (s1 != ACE_WString(L"H")) {
@@ -62,7 +61,6 @@ static int testConcatenation() {
ACE_ERROR((LM_ERROR, "Concat wchar_t 2\n"));
return 1;
}
-#endif /* ACE_HAS_WCHAR */
return 0;
}
@@ -211,7 +209,7 @@ run_main (int, ACE_TCHAR *[])
ACE_NS_WString s5 = s1 + " " + s2;
ACE_NS_WString s6 = ("hella"); // Same length as s1, off by one char.
- ACE_WCHAR_T single_character = 'z';
+ wchar_t single_character = 'z';
ACE_NS_WString single_character_string (single_character);
ACE_NS_WString empty_string;
diff --git a/tests/Svc_Handler_Test.cpp b/tests/Svc_Handler_Test.cpp
index 8b2eb68d0b7..fe98527be0f 100644
--- a/tests/Svc_Handler_Test.cpp
+++ b/tests/Svc_Handler_Test.cpp
@@ -137,7 +137,7 @@ run_main (int argc, ACE_TCHAR *argv[])
for (ssize_t n_bytes; (n_bytes = file_io.recv (buf, ACE_MAXLOGMSGLEN)) > 0; )
{
buf[n_bytes] = '\0';
- ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("%s"), ACE_TEXT_CHAR_TO_TCHAR(buf)));
+ ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("%s"), ACE_TEXT_TO_TCHAR_IN(buf)));
}
ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\n")));
diff --git a/tests/Test_Output.cpp b/tests/Test_Output.cpp
index bc24acf9eca..73feac26709 100644
--- a/tests/Test_Output.cpp
+++ b/tests/Test_Output.cpp
@@ -101,7 +101,7 @@ ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
test_dir = 0;
else
{
- ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
+ ACE_OS::strcpy (tempenv, ACE_TEXT_TO_TCHAR_IN (test_dir_n));
test_dir = tempenv;
}
# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
@@ -145,7 +145,7 @@ ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
# endif /* ! VXWORKS */
# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
- this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ this->output_file_->open (ACE_TEXT_TO_CHAR_IN (temp),
ios::out | (append ? ios::app : ios::trunc));
if (this->output_file_->bad ())
return -1;
diff --git a/tests/tests.mpc b/tests/tests.mpc
index 6c119da73b4..8b4c35d7576 100644
--- a/tests/tests.mpc
+++ b/tests/tests.mpc
@@ -1234,3 +1234,10 @@ project(Based Pointer Test) : acetest {
Based_Pointer_Test.cpp
}
}
+
+project(WChar_Conversion) : acetest {
+ exename = WChar_Conversion
+ Source_Files {
+ WChar_Conversion.cpp
+ }
+}