summaryrefslogtreecommitdiff
path: root/ASNMP
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2004-09-29 20:21:27 +0000
committerSteve Huston <shuston@riverace.com>2004-09-29 20:21:27 +0000
commit9c1a58390b5a83471374008ae3f08a5ebb300b50 (patch)
tree96078a3f143bf419fe45c6e7c39e40a3a8aa6f01 /ASNMP
parent9fa4263d3e2e0fe718cad277ec8236b31568c18c (diff)
downloadATCD-9c1a58390b5a83471374008ae3f08a5ebb300b50.tar.gz
ChangeLogTag:Wed Sep 29 15:33:29 2004 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ASNMP')
-rw-r--r--ASNMP/ChangeLog21
-rw-r--r--ASNMP/agent/snmp_agent.cpp29
-rw-r--r--ASNMP/asnmp/sagent.cpp4
-rw-r--r--ASNMP/examples/get/get.cpp12
-rw-r--r--ASNMP/examples/get/get_async.cpp12
-rw-r--r--ASNMP/examples/next/next.cpp12
-rw-r--r--ASNMP/examples/set/set.cpp18
-rw-r--r--ASNMP/examples/trap/trap.cpp11
-rw-r--r--ASNMP/examples/walk/walk.cpp12
-rw-r--r--ASNMP/tests/Address_Test.cpp5
-rw-r--r--ASNMP/tests/Counter64_Test.cpp6
-rw-r--r--ASNMP/tests/Counter_Test.cpp6
-rw-r--r--ASNMP/tests/Gauge_Test.cpp5
-rw-r--r--ASNMP/tests/Integer_Test.cpp6
-rw-r--r--ASNMP/tests/Octet_Test.cpp8
-rw-r--r--ASNMP/tests/Oid_Test.cpp5
-rw-r--r--ASNMP/tests/Target_Test.cpp6
-rw-r--r--ASNMP/tests/Varbind_Test.cpp6
-rw-r--r--ASNMP/tests/test_config.h30
19 files changed, 134 insertions, 80 deletions
diff --git a/ASNMP/ChangeLog b/ASNMP/ChangeLog
index 980b2e7a824..efcadde7d37 100644
--- a/ASNMP/ChangeLog
+++ b/ASNMP/ChangeLog
@@ -1,3 +1,24 @@
+Wed Sep 29 15:33:29 2004 Steve Huston <shuston@riverace.com>
+
+ * asnmp/sagent.cpp:
+ * agent/snmp_agent.cpp:
+ * examples/get/get.cpp:
+ * examples/get/get_async.cpp:
+ * examples/next/next.cpp:
+ * examples/set/set.cpp:
+ * examples/trap/trap.cpp:
+ * examples/walk/walk.cpp:
+ * tests/test_config.h:
+ * tests/Address_Test.cpp:
+ * tests/Counter64_Test.cpp:
+ * tests/Counter_Test.cpp:
+ * tests/Gauge_Test.cpp:
+ * tests/Integer_Test.cpp:
+ * tests/Octet_Test.cpp:
+ * tests/Oid_Test.cpp:
+ * tests/Target_Test.cpp:
+ * tests/Varbind_Test.cpp: Adjustments to build with wide-char.
+
Fri Aug 6 08:14:12 2004 Douglas C. Schmidt <schmidt@cs.wustl.edu>
* asnmp/transaction.{h,cpp}: Added a get_handle() call to
diff --git a/ASNMP/agent/snmp_agent.cpp b/ASNMP/agent/snmp_agent.cpp
index 27d445929e7..520c58eaccf 100644
--- a/ASNMP/agent/snmp_agent.cpp
+++ b/ASNMP/agent/snmp_agent.cpp
@@ -4,6 +4,7 @@
#include "snmp_agent.h"
#include "agent_impl.h" // actual implementation
+#include "ace/Argv_Type_Converter.h"
#include "ace/Get_Opt.h"
#include "ace/Reactor.h"
@@ -11,8 +12,8 @@ ACE_RCSID(agent, snmp_agent, "$Id$")
// module globals
#define SNMP_AGENT_PORT (161)
-#define WR_COM ("private")
-#define RD_COM ("public")
+#define WR_COM ACE_TEXT ("private")
+#define RD_COM ACE_TEXT ("public")
snmp_agent::snmp_agent() : agent_(0)
{
@@ -36,10 +37,12 @@ int snmp_agent::set_args(int argc, char *argv[])
{
ACE_TRACE("snmp_agent::set_args");
unsigned short port = SNMP_AGENT_PORT;
- char *rd = const_cast <char*> RD_COM;
- char *wr = const_cast <char*> WR_COM;
+ const ACE_TCHAR *rd = RD_COM;
+ const ACE_TCHAR *wr = WR_COM;
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
- ACE_Get_Opt get_opt (argc, argv, "p:w:r:hv");
+ ACE_Get_Opt get_opt
+ (argc, to_tchar.get_TCHAR_argv (), ACE_TEXT ("p:w:r:hv"));
for (int c; (c = get_opt ()) != -1; ) {
switch (c)
{
@@ -55,8 +58,9 @@ int snmp_agent::set_args(int argc, char *argv[])
case 'h': // help & version info
case 'v':
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Example SNMP Version 1 Agent - ASNMP/ACE\n"));
+ ACE_DEBUG
+ ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Example SNMP Version 1 Agent - ASNMP/ACE\n")));
return -1;
break;
@@ -66,7 +70,9 @@ int snmp_agent::set_args(int argc, char *argv[])
}
- agent_ = new agent_impl(port, rd, wr); // opens OS IO port
+ agent_ = new agent_impl(port,
+ ACE_TEXT_ALWAYS_CHAR (rd),
+ ACE_TEXT_ALWAYS_CHAR (wr)); // opens OS IO port
return 0;
}
@@ -86,12 +92,13 @@ int snmp_agent::run()
// Run forever, processing SNMP requests.
ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) starting up snmp agent (server) daemon\n"));
+ ACE_TEXT ("(%P|%t) starting up snmp agent (server) daemon\n")));
agent_->process_requests();
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) shutting down snmp agent (server) daemon\n"));
+ ACE_DEBUG
+ ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) shutting down snmp agent (server) daemon\n")));
return 0;
}
diff --git a/ASNMP/asnmp/sagent.cpp b/ASNMP/asnmp/sagent.cpp
index fc56a2c728f..8ee2fdb5b8d 100644
--- a/ASNMP/asnmp/sagent.cpp
+++ b/ASNMP/asnmp/sagent.cpp
@@ -53,9 +53,9 @@ int sagent::handle_input(ACE_HANDLE fd)
return 0;
OctetStr community(rcv_com_str);
const ACE_INET_Addr &ta = tr.get_from_addr();
- char buf_tmp[MAXHOSTNAMELEN + 1];
+ ACE_TCHAR buf_tmp[MAXHOSTNAMELEN + 1];
ta.addr_to_string (buf_tmp, MAXHOSTNAMELEN);
- UdpAddress ra(buf_tmp);
+ UdpAddress ra (ACE_TEXT_ALWAYS_CHAR (buf_tmp));
tgt_.set_address(ra);
diff --git a/ASNMP/examples/get/get.cpp b/ASNMP/examples/get/get.cpp
index d335ab43f98..a8cef4b6e87 100644
--- a/ASNMP/examples/get/get.cpp
+++ b/ASNMP/examples/get/get.cpp
@@ -93,19 +93,23 @@ getapp::getapp(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:p:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("o:c:r:t:p:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'o':
- req = get_opt.opt_arg();
+ req = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
if (req.valid() == 0)
- cout << "ERROR: oid value: " <<get_opt.opt_arg() \
+ cout << "ERROR: oid value: "
+ << ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg())
<< "is not valid. using default.\n";
break;
case 'c':
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_read_community(community_);
break;
diff --git a/ASNMP/examples/get/get_async.cpp b/ASNMP/examples/get/get_async.cpp
index ff90105591b..bca16db7187 100644
--- a/ASNMP/examples/get/get_async.cpp
+++ b/ASNMP/examples/get/get_async.cpp
@@ -93,19 +93,23 @@ getapp::getapp(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:p:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("o:c:r:t:p:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'o':
- req = get_opt.opt_arg();
+ req = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
if (req.valid() == 0)
- cout << "ERROR: oid value: " <<get_opt.opt_arg() \
+ cout << "ERROR: oid value: "
+ << ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg())
<< "is not valid. using default.\n";
break;
case 'c':
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_read_community(community_);
break;
diff --git a/ASNMP/examples/next/next.cpp b/ASNMP/examples/next/next.cpp
index c8c58db88d4..968bd11174b 100644
--- a/ASNMP/examples/next/next.cpp
+++ b/ASNMP/examples/next/next.cpp
@@ -92,19 +92,23 @@ nextapp::nextapp(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("o:c:r:t:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'o':
- req = get_opt.opt_arg();
+ req = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
if (req.valid() == 0)
- cout << "ERROR: oid value: " <<get_opt.opt_arg() \
+ cout << "ERROR: oid value: "
+ << ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg())
<< "is not valid. using default.\n";
break;
case 'c':
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_read_community(community_);
break;
diff --git a/ASNMP/examples/set/set.cpp b/ASNMP/examples/set/set.cpp
index cb3cb4f451d..41b34aefbd7 100644
--- a/ASNMP/examples/set/set.cpp
+++ b/ASNMP/examples/set/set.cpp
@@ -95,19 +95,23 @@ set::set(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:I:U:C:G:T:O:S:P:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("o:c:r:t:I:U:C:G:T:O:S:P:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'o':
- req = get_opt.opt_arg();
+ req = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
if (req.valid() == 0)
- cout << "ERROR: oid value: " <<get_opt.opt_arg() \
+ cout << "ERROR: oid value: "
+ << ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg())
<< "is not valid. using default.\n";
break;
case 'c':
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_write_community(community_);
break;
@@ -161,14 +165,14 @@ set::set(int argc, char *argv[]): valid_(0)
case 'O': // Oid as a variable identifier
{
- oid_ = get_opt.opt_arg();
+ oid_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
vb.set_oid(oid_); // when value is set, pdu updated
}
break;
case 'S': // Octet String
{
- OctetStr o(get_opt.opt_arg());
+ OctetStr o(ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg()));
vb.set_value(o); // set the Oid portion of the Vb
pdu_ += vb;
}
@@ -176,7 +180,7 @@ set::set(int argc, char *argv[]): valid_(0)
case 'P': // Oid String as a value
{
- Oid o(get_opt.opt_arg());
+ Oid o(ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg()));
vb.set_value(o); // set the Oid portion of the Vb
pdu_ += vb;
}
diff --git a/ASNMP/examples/trap/trap.cpp b/ASNMP/examples/trap/trap.cpp
index cb1ad66a1e4..60330de5f2f 100644
--- a/ASNMP/examples/trap/trap.cpp
+++ b/ASNMP/examples/trap/trap.cpp
@@ -96,21 +96,24 @@ trapapp::trapapp(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "c:e:t:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("c:e:t:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'c': // community string
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_read_community(community_);
break;
case 'e': // trap oid to send
- ent = get_opt.opt_arg();
+ ent = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
break;
case 't': // trap oid
- trap = get_opt.opt_arg();
+ trap = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
break;;
default:
diff --git a/ASNMP/examples/walk/walk.cpp b/ASNMP/examples/walk/walk.cpp
index 0147b8fce0e..56ae160822c 100644
--- a/ASNMP/examples/walk/walk.cpp
+++ b/ASNMP/examples/walk/walk.cpp
@@ -92,19 +92,23 @@ walkapp::walkapp(int argc, char *argv[]): valid_(0)
return;
}
- ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:");
+ ACE_Argv_Type_Converter to_tchar (argc, argv);
+ ACE_Get_Opt get_opt (argc,
+ to_tchar.get_TCHAR_argv (),
+ ACE_TEXT ("o:c:r:t:"));
for (int c; (c = get_opt ()) != -1; )
switch (c)
{
case 'o':
- req = get_opt.opt_arg();
+ req = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
if (req.valid() == 0)
- cout << "ERROR: oid value: " <<get_opt.opt_arg() \
+ cout << "ERROR: oid value: "
+ << ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg())
<< "is not valid. using default.\n";
break;
case 'c':
- community_ = get_opt.opt_arg();
+ community_ = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg());
target_.set_read_community(community_);
break;
diff --git a/ASNMP/tests/Address_Test.cpp b/ASNMP/tests/Address_Test.cpp
index 134a3e8a950..fce2067ab31 100644
--- a/ASNMP/tests/Address_Test.cpp
+++ b/ASNMP/tests/Address_Test.cpp
@@ -39,6 +39,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
+#include "ace/OS_main.h"
#include "asnmp/address.h"
#include "test_config.h"
@@ -532,9 +533,9 @@ static void TestUdpAddress()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Address_Test");
+ ACE_START_TEST (ACE_TEXT ("Address_Test"));
TestGenAddr();
TestIpAddress();
diff --git a/ASNMP/tests/Counter64_Test.cpp b/ASNMP/tests/Counter64_Test.cpp
index d38a7524100..f0b9ee8ad56 100644
--- a/ASNMP/tests/Counter64_Test.cpp
+++ b/ASNMP/tests/Counter64_Test.cpp
@@ -38,7 +38,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
#include "asnmp/ctr64.h"
#include "test_config.h"
@@ -145,9 +145,9 @@ static void TestCounter64()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Counter64_Test");
+ ACE_START_TEST (ACE_TEXT ("Counter64_Test"));
TestCounter64();
diff --git a/ASNMP/tests/Counter_Test.cpp b/ASNMP/tests/Counter_Test.cpp
index fb5447ad396..4f34c7a29bf 100644
--- a/ASNMP/tests/Counter_Test.cpp
+++ b/ASNMP/tests/Counter_Test.cpp
@@ -37,7 +37,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
#include "asnmp/counter.h"
#include "test_config.h"
@@ -125,9 +125,9 @@ static void TestCounter()
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Counter_Test");
+ ACE_START_TEST (ACE_TEXT ("Counter_Test"));
TestCounter();
diff --git a/ASNMP/tests/Gauge_Test.cpp b/ASNMP/tests/Gauge_Test.cpp
index b87795fb174..58f44da6935 100644
--- a/ASNMP/tests/Gauge_Test.cpp
+++ b/ASNMP/tests/Gauge_Test.cpp
@@ -37,6 +37,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
+#include "ace/OS_main.h"
#include "asnmp/gauge.h"
#include "test_config.h"
@@ -121,9 +122,9 @@ TestGuage (void)
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Guage_Test");
+ ACE_START_TEST (ACE_TEXT ("Gauge_Test"));
TestGuage();
diff --git a/ASNMP/tests/Integer_Test.cpp b/ASNMP/tests/Integer_Test.cpp
index 6084865db36..8cea7e33f1b 100644
--- a/ASNMP/tests/Integer_Test.cpp
+++ b/ASNMP/tests/Integer_Test.cpp
@@ -38,7 +38,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
#include "asnmp/integer.h"
#include "test_config.h"
@@ -187,9 +187,9 @@ static void TestUnsignedInteger32()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Integer_Test");
+ ACE_START_TEST (ACE_TEXT ("Integer_Test"));
TestInteger32();
diff --git a/ASNMP/tests/Octet_Test.cpp b/ASNMP/tests/Octet_Test.cpp
index 759ac16ee7c..a32f1cd2f09 100644
--- a/ASNMP/tests/Octet_Test.cpp
+++ b/ASNMP/tests/Octet_Test.cpp
@@ -39,10 +39,10 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
+#include "ace/OS_NS_string.h"
#include "asnmp/octet.h"
#include "test_config.h"
-#include "ace/OS_NS_string.h"
ACE_RCSID(tests, Octet_Test, "$Id$")
@@ -146,9 +146,9 @@ static void TestOctet()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Octet_Test");
+ ACE_START_TEST (ACE_TEXT ("Octet_Test"));
TestOctet();
ACE_END_TEST;
diff --git a/ASNMP/tests/Oid_Test.cpp b/ASNMP/tests/Oid_Test.cpp
index c4b1660ef92..7add52bd790 100644
--- a/ASNMP/tests/Oid_Test.cpp
+++ b/ASNMP/tests/Oid_Test.cpp
@@ -38,6 +38,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
+#include "ace/OS_main.h"
#include "asnmp/oid.h"
#include "test_config.h"
@@ -171,9 +172,9 @@ static void OidTest()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Oid_Test");
+ ACE_START_TEST (ACE_TEXT ("Oid_Test"));
OidTest();
ACE_END_TEST;
return 0;
diff --git a/ASNMP/tests/Target_Test.cpp b/ASNMP/tests/Target_Test.cpp
index bd74641ee4a..28302e11cfd 100644
--- a/ASNMP/tests/Target_Test.cpp
+++ b/ASNMP/tests/Target_Test.cpp
@@ -39,7 +39,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
#include "asnmp/octet.h"
#include "asnmp/target.h"
#include "test_config.h"
@@ -135,9 +135,9 @@ static void TestSnmpTarget()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("Target_Test");
+ ACE_START_TEST (ACE_TEXT ("Target_Test"));
TestSnmpTarget();
ACE_END_TEST;
diff --git a/ASNMP/tests/Varbind_Test.cpp b/ASNMP/tests/Varbind_Test.cpp
index ea7ffc7239a..e9c9ecc923b 100644
--- a/ASNMP/tests/Varbind_Test.cpp
+++ b/ASNMP/tests/Varbind_Test.cpp
@@ -39,7 +39,7 @@ SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+#include "ace/OS_main.h"
#include "asnmp/oid.h"
#include "asnmp/vb.h"
#include "test_config.h"
@@ -187,9 +187,9 @@ static void VbTest()
}
int
-main (int, char *[])
+ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_START_TEST ("VbTest");
+ ACE_START_TEST (ACE_TEXT ("Varbind_Test"));
VbTest();
ACE_END_TEST;
return 0;
diff --git a/ASNMP/tests/test_config.h b/ASNMP/tests/test_config.h
index 510a93a4005..98d55469a0f 100644
--- a/ASNMP/tests/test_config.h
+++ b/ASNMP/tests/test_config.h
@@ -68,14 +68,14 @@ typedef size_t KEY;
#endif /* ACE_WIN32 */
#define ACE_START_TEST(NAME) \
- const char *program = NAME; \
+ const ACE_TCHAR *program = NAME; \
ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM); \
if (ace_file_stream.set_output (program) != 0) \
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set_output failed"), -1); \
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting %s test at %T\n", program));
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) starting %s test at %T\n"), program));
#define ACE_END_TEST \
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Ending %s test at %T\n", program)); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %T\n"), program)); \
ace_file_stream.close ();
#define ACE_NEW_THREAD \
@@ -86,23 +86,23 @@ do {\
} while (0)
#define ACE_APPEND_LOG(NAME) \
- const char *program = NAME; \
+ const ACE_TCHAR *program = NAME; \
ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM); \
if (ace_file_stream.set_output (program, 1) != 0) \
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set_output failed"), -1); \
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting %s test at %T\n", program));
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %T\n"), program));
#define ACE_END_LOG \
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Ending %s test at %T\n\n", program)); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %T\n\n"), program)); \
ace_file_stream.close ();
#define ACE_INIT_LOG(NAME) \
char temp[BUFSIZ]; \
ACE_OS::sprintf (temp, "%s%s%s", \
- ACE_LOG_DIRECTORY, \
- ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \
+ ACE_TEXT_ALWAYS_CHAR (ACE_LOG_DIRECTORY), \
+ ACE_TEXT_ALWAYS_CHAR (ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR)), \
".log"); \
- ACE_DEBUG ((LM_DEBUG, "Deleting old log file %s (if any)\n\n", temp)); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Deleting old log file %C (if any)\n\n"), temp)); \
ACE_OS::unlink (temp);
@@ -121,7 +121,7 @@ class ACE_Test_Output
public:
ACE_Test_Output (void);
~ACE_Test_Output (void);
- int set_output (const char *filename, int append = 0);
+ int set_output (const ACE_TCHAR *filename, int append = 0);
ofstream *output_file (void);
void close (void);
@@ -140,14 +140,14 @@ ACE_Test_Output::~ACE_Test_Output (void)
}
int
-ACE_Test_Output::set_output (const char *filename, int append)
+ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
{
char temp[BUFSIZ];
// Ignore the error value since the directory may already exist.
ACE_OS::mkdir (ACE_LOG_DIRECTORY);
ACE_OS::sprintf (temp, "%s%s%s",
- ACE_LOG_DIRECTORY,
- ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR),
+ ACE_TEXT_ALWAYS_CHAR (ACE_LOG_DIRECTORY),
+ ACE_TEXT_ALWAYS_CHAR (ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR)),
".log");
this->output_file_.open (temp, ios::out | (append ? ios::app : ios::trunc));