summaryrefslogtreecommitdiff
path: root/ASNMP
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-12-21 22:25:43 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-12-21 22:25:43 +0000
commit19bff6d7acfc01404027068d21d958cc7ae8204a (patch)
treefba11aad2d1cfe43989030578d2c36d62708e587 /ASNMP
parent0c7a404e73fbb7a5abbee95a65d035c0f4317f76 (diff)
downloadATCD-19bff6d7acfc01404027068d21d958cc7ae8204a.tar.gz
ChangeLogTag: Tue Dec 21 16:22:21 1999 David L. Levine <levine@cs.wustl.edu>
Diffstat (limited to 'ASNMP')
-rw-r--r--ASNMP/ChangeLog14
-rw-r--r--ASNMP/tests/Address_Test.cpp124
-rw-r--r--ASNMP/tests/Counter64_Test.cpp41
-rw-r--r--ASNMP/tests/Counter_Test.cpp52
-rw-r--r--ASNMP/tests/Gauge_Test.cpp30
-rw-r--r--ASNMP/tests/Integer_Test.cpp34
-rw-r--r--ASNMP/tests/Octet_Test.cpp32
-rw-r--r--ASNMP/tests/Oid_Test.cpp46
-rw-r--r--ASNMP/tests/Target_Test.cpp42
-rw-r--r--ASNMP/tests/Varbind_Test.cpp50
-rw-r--r--ASNMP/tests/test_config.h1
11 files changed, 203 insertions, 263 deletions
diff --git a/ASNMP/ChangeLog b/ASNMP/ChangeLog
index 61c2fe5c2dc..3003192112b 100644
--- a/ASNMP/ChangeLog
+++ b/ASNMP/ChangeLog
@@ -1,3 +1,17 @@
+Tue Dec 21 16:22:21 1999 David L. Levine <levine@cs.wustl.edu>
+
+ * tests/*.cpp: removed the unnecessary explicit template
+ instantiation. Other instantiations were necessary
+ with it, and it seemed to serve no useful purpose:
+ there was no use of an ACE_Unbounded_Set<Log_Msg *>.
+ Thanks to Jose Rubio <jrubio@tr.comm.mot.com> for
+ reporting link failures with Sun CC 5.0, with explicit
+ template instantiation enabled.
+
+ * tests/test_config.h: added #include of "ace/ACE.h",
+ because the file uses it later. g++ 2.91.66 on Linux
+ needed it.
+
Wed Jul 14 08:26:42 1999 Brian Raven <brianr@liffe.com>
* asnmp/snmp.{h,cpp},wpdu.cpp:
diff --git a/ASNMP/tests/Address_Test.cpp b/ASNMP/tests/Address_Test.cpp
index 01347ae30e1..cadca2722dc 100644
--- a/ASNMP/tests/Address_Test.cpp
+++ b/ASNMP/tests/Address_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -12,14 +12,14 @@
// Test all the member functions of the Address family:
// GenAddress, MacAddress, IpxAddress, IpAddress, UdpAddress
// all which derive from abstract base class Address.
-//
+//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -28,7 +28,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -38,16 +38,12 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+
#include "asnmp/address.h"
#include "test_config.h"
ACE_RCSID(tests, Address_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
// test the GenAddress interface
/*
*/
@@ -56,9 +52,9 @@ static void TestGenAddr()
ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress: Tests: var(expected) [actual]\n"));
// the constructors and destructors
- GenAddress *ga1 = new GenAddress("1.2.3.4"); // use ipv4 address
+ GenAddress *ga1 = new GenAddress("1.2.3.4"); // use ipv4 address
ACE_ASSERT(ga1->valid() == 1);
- GenAddress ga2(*ga1); // copy constructor;
+ GenAddress ga2(*ga1); // copy constructor;
ACE_ASSERT(ga2.valid() == 1);
GenAddress ga3("localhost");
ACE_ASSERT(ga3.valid() == 1);
@@ -72,49 +68,49 @@ static void TestGenAddr()
ACE_ASSERT(ga7.valid() == 1);
IpAddress ip("1.2.3.4");
ACE_ASSERT(ip.valid() == 1);
- GenAddress ga8(ip); // Address conversion
+ GenAddress ga8(ip); // Address conversion
ACE_ASSERT(ga8.valid() == 1);
const char *ptr = (const char *)ga8;
ACE_ASSERT(ga1 != 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga1(\"1.2.3.4\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga1(\"1.2.3.4\") [%s]\n",
ga1->to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2(ga1) [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2(ga1) [%s]\n",
ga2.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga3(\"localhost\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga3(\"localhost\") [%s]\n",
ga3.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga4(\"\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga4(\"\") [%s]\n",
ga4.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga6(\"127.0.0.1:7\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga6(\"127.0.0.1:7\") [%s]\n",
ga6.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga7(\"01234567.89ABcDeF0123\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga7(\"01234567.89ABcDeF0123\") [%s]\n",
ga7.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n",
ga8.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n",
ptr));
- // Test Assignment x = y, y = x
- ga5 = ga3; // regular assignment
+ // Test Assignment x = y, y = x
+ ga5 = ga3; // regular assignment
ga3 = ga3; // self assignment
ACE_ASSERT(ga5 == ga3);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga5=ga3(\"localhost\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga5=ga3(\"localhost\") [%s]\n",
ga5.to_string()));
addr_type a = ga2.get_type();
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"0\") [%d]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"0\") [%d]\n",
a));
// udp address string
a = ga6.get_type();
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"2\") [%d]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"2\") [%d]\n",
a));
// udp address string
a = ga7.get_type();
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"1\") [%d]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"1\") [%d]\n",
a));
delete ga1, ga1 = 0;
@@ -168,52 +164,52 @@ static void TestIpAddress()
IpAddress ia8("192.168.0.1");
ACE_ASSERT(ia8.is_private());
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia1(\"\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia1(\"\") [%s]\n",
ia1.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia2(\"1.2.3.4\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia2(\"1.2.3.4\") [%s]\n",
ia2.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3(\"127.0.0.1\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3(\"127.0.0.1\") [%s]\n",
ia3.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia4(\"ia3\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia4(\"ia3\") [%s]\n",
ia4.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5(\"255.255.255.255\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5(\"255.255.255.255\") [%s]\n",
ia5.to_string()));
-
+
// other routines
int status = 1;
const char *ptr = ia5.resolve_hostname(status);
ACE_ASSERT(status == 0);
ACE_ASSERT(ptr != 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5.resolve_hostname():(\"\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5.resolve_hostname():(\"\") [%s]\n",
ptr));
// now lets try one we setup with a hostname
ptr = ia3.resolve_hostname(status);
ACE_ASSERT(status == 0);
ACE_ASSERT(ptr != 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3.resolve_hostname()(\"localhost\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3.resolve_hostname()(\"localhost\") [%s]\n",
ptr));
ptr = (const char *)ia5;
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:(const char *)(\"255.255.255.255\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:(const char *)(\"255.255.255.255\") [%s]\n",
ptr));
-
+
ia2 = ia3;
ACE_ASSERT(ia2 == ia3);
ia4.mask(ia3); // mask with equal value should return same
ACE_ASSERT(ia2 == ia3);
- ACE_ASSERT(ia1.get_type() == type_ip);
- ACE_ASSERT(ia1.valid() == 0);
+ ACE_ASSERT(ia1.get_type() == type_ip);
+ ACE_ASSERT(ia1.valid() == 0);
ACE_ASSERT(ia2.get_type() == type_ip);
- ACE_ASSERT(ia2.valid() == 1);
+ ACE_ASSERT(ia2.valid() == 1);
ACE_ASSERT(ia3.get_type() == type_ip);
- ACE_ASSERT(ia3.valid() == 1);
+ ACE_ASSERT(ia3.valid() == 1);
ACE_ASSERT(ia4.get_type() == type_ip);
- ACE_ASSERT(ia4.valid() == 1);
+ ACE_ASSERT(ia4.valid() == 1);
ACE_ASSERT(ia5.get_type() == type_ip);
- ACE_ASSERT(ia5.valid() == 1);
+ ACE_ASSERT(ia5.valid() == 1);
}
@@ -236,34 +232,34 @@ static void TestNetbiosAddress()
{
NetbiosAddress n1;
ACE_ASSERT(n1.valid() == 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n1(\"\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n1(\"\") [%s]\n",
n1.to_string()));
NetbiosAddress n2(n1);
ACE_ASSERT(n2.valid() == 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n2(n1) [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n2(n1) [%s]\n",
n2.to_string()));
- NetbiosAddress n3("pcname");
+ NetbiosAddress n3("pcname");
ACE_ASSERT(n3.valid() == 1);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n3(\"pcname\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n3(\"pcname\") [%s]\n",
n3.to_string()));
- NetbiosAddress n4("abcdefghigjklmn");
+ NetbiosAddress n4("abcdefghigjklmn");
n4.set_service_type(nb_workstation);
ACE_ASSERT(n4.valid() == 1);
ACE_ASSERT(n4.get_service_type() == nb_workstation);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmn\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmn\") [%s]\n",
n4.to_string()));
- NetbiosAddress n5("abcdefghigjklmno0xx");
+ NetbiosAddress n5("abcdefghigjklmno0xx");
ACE_ASSERT(n5.valid() == 0);
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmno0xx\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmno0xx\") [%s]\n",
n5.to_string()));
n1 = n4;
ACE_ASSERT(n1 == n4);
- ACE_ASSERT(strcmp((const char *)n1, (const char *)n4) == 0);
+ ACE_ASSERT(strcmp((const char *)n1, (const char *)n4) == 0);
n1.set_service_type(nb_server);
nb_service x = n1.get_service_type();
@@ -339,16 +335,16 @@ static void TestIpxAddress()
ACE_ASSERT(xa10->valid() == 1);
delete xa10;
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa1(\"\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa1(\"\") [%s]\n",
xa1.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa2(\"01234567.0123456789AB\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa2(\"01234567.0123456789AB\") [%s]\n",
xa2.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa3(\"01234567:0123456789A\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa3(\"01234567:0123456789A\") [%s]\n",
xa3.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa4(\"01234567-0123456789AB\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa4(\"01234567-0123456789AB\") [%s]\n",
xa4.to_string()));
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa5(\"01234567.012345-6789AB\") [%s]\n",
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa5(\"01234567.012345-6789AB\") [%s]\n",
xa5.to_string()));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa6(\"01234567:012345-6789AB\") [%s]\n",
xa6.to_string()));
@@ -359,13 +355,13 @@ static void TestIpxAddress()
xa1 = xa3;
ACE_ASSERT(xa1 == xa3);
MacAddress mac;
- ACE_ASSERT(xa4.get_hostid(mac) == 1);
+ ACE_ASSERT(xa4.get_hostid(mac) == 1);
ACE_ASSERT(mac.valid() == 1);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa4:get_hostid(\"01:23:45:67:89:ab\") [%s]\n", mac.to_string()));
-
+
const char *ptr = (const char *)xa7;
ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa7-ptr(\"01234567-012345-6789AB\") [%s]\n", ptr));
-
+
}
/*
@@ -520,7 +516,7 @@ static void TestUdpAddress()
delete ua6; // destructor
- // assignement tests.
+ // assignement tests.
ua1 = ua2;
ACE_ASSERT(ua1 == ua2);
ACE_ASSERT(ua1.valid() == 1);
@@ -533,7 +529,7 @@ static void TestUdpAddress()
ACE_ASSERT(ua1.get_port() == 333);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua1.set_port()(\"333\") [%s]\n",
(const char *)ua1));
-
+
}
int
@@ -542,7 +538,7 @@ main (int, char *[])
ACE_START_TEST ("Address_Test");
TestGenAddr();
- TestIpAddress();
+ TestIpAddress();
TestUdpAddress();
TestMacAddress();
TestNetbiosAddress();
@@ -551,7 +547,3 @@ main (int, char *[])
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Counter64_Test.cpp b/ASNMP/tests/Counter64_Test.cpp
index 835bf193517..cfb337409eb 100644
--- a/ASNMP/tests/Counter64_Test.cpp
+++ b/ASNMP/tests/Counter64_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -9,8 +9,8 @@
// Counter64_Test.cpp
//
// = DESCRIPTION
-// Test all the member functions of the Counter64 class. An Object
-// representing an ASN.1 Counter64 SMI 64 bit Integer SYNTAX.
+// Test all the member functions of the Counter64 class. An Object
+// representing an ASN.1 Counter64 SMI 64 bit Integer SYNTAX.
// (SNMPv2c)
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
@@ -18,7 +18,7 @@
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -27,7 +27,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -37,18 +37,14 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-#include "ace/OS.h"
+
+#include "ace/OS.h"
#include "asnmp/ctr64.h"
#include "test_config.h"
ACE_RCSID(tests, Counter64_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
// TODO: verify this with ACE folks
#if defined(_WIN32)
#define LLONG __int64
@@ -56,7 +52,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
#define LLONG long long
#define ULLONG unsigned long long
#endif
-
+
/*
Counter64( unsigned long long llw = 0);
Counter64( unsigned long hiparm, unsigned long loparm);
@@ -81,9 +77,9 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
static void TestCounter64()
{
static unsigned long ul = ULONG_MAX;
- LLONG ll = (LLONG) 0x7fffffffffffffff;
- LLONG mll = (LLONG) ((-ll) - 1);
- ULLONG ull = (ULLONG) 0xffffffffffffffff;
+ LLONG ll = (LLONG) 0x7fffffffffffffff;
+ LLONG mll = (LLONG) ((-ll) - 1);
+ ULLONG ull = (ULLONG) 0xffffffffffffffff;
long double ld = (LLONG) ll;
cerr << "max unsigned long long is " << ull << endl;
@@ -109,11 +105,11 @@ static void TestCounter64()
Counter64 c5(0);
ACE_ASSERT(c5.valid() == 1);
- Counter64 c6;
+ Counter64 c6;
c6.assign(ld);
ACE_ASSERT(c6.to_long_double() == ld);
- Counter64 c7(ull);
+ Counter64 c7(ull);
ACE_ASSERT(c7 == ull);
@@ -136,7 +132,7 @@ static void TestCounter64()
// assignment
c5 = c4;
ACE_ASSERT(c5 == c4);
- c4 = c4;
+ c4 = c4;
ACE_ASSERT(c5 == c4);
c5 = ll;
ACE_ASSERT(c5 == ll);
@@ -145,19 +141,14 @@ static void TestCounter64()
c5 = c5 + (ULLONG) 10;
ACE_ASSERT(c5 == (mll + 10));
}
-
+
int
main (int, char *[])
{
ACE_START_TEST ("Counter64_Test");
TestCounter64();
-
+
ACE_END_TEST;
return 0;
}
-
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg *>;
-#endif
diff --git a/ASNMP/tests/Counter_Test.cpp b/ASNMP/tests/Counter_Test.cpp
index d7be4862ea7..0538261cb8d 100644
--- a/ASNMP/tests/Counter_Test.cpp
+++ b/ASNMP/tests/Counter_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -9,15 +9,15 @@
// Counter_Test.cpp
//
// = DESCRIPTION
-// Test all the member functions of the Counter class. An Object
-// representing an ASN.1 Counter SMI COUNTER SYNTAX.
+// Test all the member functions of the Counter class. An Object
+// representing an ASN.1 Counter SMI COUNTER SYNTAX.
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -26,7 +26,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -36,19 +36,14 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-
+
+
#include "ace/OS.h"
#include "asnmp/counter.h"
#include "test_config.h"
ACE_RCSID(tests, Counter_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
-
/*
Counter32( void);
Counter32( const unsigned long i);
@@ -61,7 +56,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
operator unsigned long();
-- comments tyis type appears to be a wrapper class and not
- a true SNMP counter. Practical for nms side,yet may lead to
+ a true SNMP counter. Practical for nms side,yet may lead to
some confusion if implementing an agent with this class.
Per RFC 1155 sec 3.2.3.3
@@ -82,19 +77,19 @@ static void TestCounter()
// constructors
Counter32 c1;
- ACE_ASSERT(c1 == def);
+ ACE_ASSERT(c1 == def);
Counter32 c2(l);
- ACE_ASSERT(c2 == l);
+ ACE_ASSERT(c2 == l);
Counter32 c3(nl);
- ACE_ASSERT(c3 == nl);
+ ACE_ASSERT(c3 == nl);
Counter32 c4(ul);
- ACE_ASSERT(c4 == ul);
+ ACE_ASSERT(c4 == ul);
Counter32 c5(i);
- ACE_ASSERT(c5 == i);
+ ACE_ASSERT(c5 == i);
Counter32 c6(ni);
- ACE_ASSERT(c6 == ni);
+ ACE_ASSERT(c6 == ni);
Counter32 c7(ui);
- ACE_ASSERT(c7 == ui);
+ ACE_ASSERT(c7 == ui);
Counter32 *c8 = new Counter32(c5);
ACE_ASSERT(c8 != 0);
delete c8;
@@ -116,15 +111,15 @@ static void TestCounter()
// assignent
c1 = c2; // obj
- ACE_ASSERT(c1 == c2);
+ ACE_ASSERT(c1 == c2);
c1 = c1; // self
- ACE_ASSERT(c1 == c1);
+ ACE_ASSERT(c1 == c1);
c1 = def; // unsigned long
- ACE_ASSERT(c1 == def);
+ ACE_ASSERT(c1 == def);
c1 = us; // unsigned short
- ACE_ASSERT(c1 == us);
+ ACE_ASSERT(c1 == us);
c1 = si; // unsigned short
- ACE_ASSERT(c1 == si);
+ ACE_ASSERT(c1 == si);
}
@@ -134,13 +129,8 @@ main (int, char *[])
{
ACE_START_TEST ("Counter_Test");
- TestCounter();
+ TestCounter();
ACE_END_TEST;
return 0;
}
-
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Gauge_Test.cpp b/ASNMP/tests/Gauge_Test.cpp
index 7c2faa436e2..a607d58c1b7 100644
--- a/ASNMP/tests/Gauge_Test.cpp
+++ b/ASNMP/tests/Gauge_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -9,15 +9,15 @@
// Guage_Test.cpp
//
// = DESCRIPTION
-// Test all the member functions of the Guage class. An Object
-// representing an ASN.1 Counter SMI GUAGE SYNTAX.
+// Test all the member functions of the Guage class. An Object
+// representing an ASN.1 Counter SMI GUAGE SYNTAX.
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -26,7 +26,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -36,17 +36,13 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-#include "ace/OS.h"
+
+#include "ace/OS.h"
#include "asnmp/gauge.h"
#include "test_config.h"
ACE_RCSID(tests, Gauge_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
/*
Gauge32( void);
Gauge32( const unsigned long i);
@@ -91,7 +87,7 @@ static void TestGuage()
Gauge32 *g8 = new Gauge32(g5);
ACE_ASSERT(g8 != 0);
delete g8;
-
+
ACE_DEBUG ((LM_DEBUG, "(%P|%t) g1(\"\") [%u]\n",
(unsigned long)g1));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) g2(\"%u\") [%u]\n",
@@ -118,19 +114,15 @@ static void TestGuage()
ACE_ASSERT(g1 == us);
g1 = si; // unsigned short
ACE_ASSERT(g1 == si);
-}
+}
int
main (int, char *[])
{
ACE_START_TEST ("Guage_Test");
-
+
TestGuage();
-
+
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Integer_Test.cpp b/ASNMP/tests/Integer_Test.cpp
index 264bcef5529..c289425d8ea 100644
--- a/ASNMP/tests/Integer_Test.cpp
+++ b/ASNMP/tests/Integer_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -10,7 +10,7 @@
//
// = DESCRIPTION
// Test all the member functions of the Integer class. An Object
-// representing an ASN.1 Integer64 SMI 32 bit Integer SYNTAX.
+// representing an ASN.1 Integer64 SMI 32 bit Integer SYNTAX.
//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
@@ -18,7 +18,7 @@
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -27,7 +27,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -37,7 +37,7 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+
#include "ace/OS.h"
#include "asnmp/integer.h"
@@ -51,11 +51,7 @@ static int i = INT_MAX, ni = INT_MIN;
static unsigned int ui = UINT_MAX;
static unsigned short us = 10;
static short si = 65535;
-
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
+
/*
SnmpInt32( void);
SnmpInt32 (const long i);
@@ -73,7 +69,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
static void TestInteger32()
{
-
+
// constructors
SnmpInt32 i1;
ACE_ASSERT(i1 == def);
@@ -92,7 +88,7 @@ static void TestInteger32()
SnmpInt32 *i8 = new SnmpInt32(i5);
ACE_ASSERT(i8 != 0);
delete i8;
-
+
ACE_DEBUG ((LM_DEBUG, "(%P|%t) i1(\"\") [%u]\n",
(unsigned long)i1));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) i2(\"%u\") [%u]\n",
@@ -119,7 +115,7 @@ static void TestInteger32()
ACE_ASSERT(i1 == us);
i1 = si; // unsigned short
ACE_ASSERT(i1 == si);
-}
+}
/*
SnmpUInt32( void);
@@ -155,7 +151,7 @@ static void TestUnsignedInteger32()
SnmpUInt32 *u8 = new SnmpUInt32(u5);
ACE_ASSERT(u8 != 0);
delete u8;
-
+
ACE_DEBUG ((LM_DEBUG, "(%P|%t) u1(\"\") [%u]\n",
(unsigned long)u1));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) u2(\"%u\") [%u]\n",
@@ -189,14 +185,10 @@ main (int, char *[])
{
ACE_START_TEST ("Integer_Test");
- TestInteger32();
+ TestInteger32();
+
+ TestUnsignedInteger32();
- TestUnsignedInteger32();
-
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg *>;
-#endif
diff --git a/ASNMP/tests/Octet_Test.cpp b/ASNMP/tests/Octet_Test.cpp
index 1eb0c391763..7aa032b5223 100644
--- a/ASNMP/tests/Octet_Test.cpp
+++ b/ASNMP/tests/Octet_Test.cpp
@@ -10,8 +10,8 @@
//
// = DESCRIPTION
// Test all the member functions of the OCTET class. An Object
-// representing an ASN.1 Integer64 SMI OCTET STRING SYNTAX.
-//
+// representing an ASN.1 Integer64 SMI OCTET STRING SYNTAX.
+//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
@@ -19,7 +19,7 @@
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -28,7 +28,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -38,23 +38,19 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-
+
+
#include "ace/OS.h"
#include "asnmp/octet.h"
#include "test_config.h"
-
+
ACE_RCSID(tests, Octet_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
/*
OctetStr( const char *string, long size = -1);
OctetStr ( const OctetStr &octet);
~OctetStr();
-
+
SmiUINT32 get_syntax();
void set_data( const SmiBYTE* string, long int size = -1);
OctetStr& operator=( const char *string);
@@ -84,7 +80,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
char *to_string_hex();
SnmpSyntax *clone() const;
SnmpSyntax& operator=( SnmpSyntax &val);
- */
+ */
static void TestOctet()
{
@@ -148,17 +144,13 @@ static void TestOctet()
ACE_ASSERT(!(o3 != o3));
}
-
+
int
main (int, char *[])
{
ACE_START_TEST ("Octet_Test");
-
- TestOctet();
+
+ TestOctet();
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Oid_Test.cpp b/ASNMP/tests/Oid_Test.cpp
index 41c03a89585..c195b0a7105 100644
--- a/ASNMP/tests/Oid_Test.cpp
+++ b/ASNMP/tests/Oid_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -10,15 +10,15 @@
//
// = DESCRIPTION
// Test all the member functions of the Oid class. An Object
-// representing an ASN.1 Integer64 SMI OID SYNTAX.
-//
+// representing an ASN.1 Integer64 SMI OID SYNTAX.
+//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
// ============================================================================
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -27,7 +27,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -37,23 +37,19 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
+
#include "ace/OS.h"
#include "asnmp/oid.h"
#include "test_config.h"
-
-ACE_RCSID(tests, Oid_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
+ACE_RCSID(tests, Oid_Test, "$Id$")
/*
Oid( const char * dotted_oid_string = "", size_t size = -1);
Oid ( const Oid &oid);
Oid(const unsigned long *raw_oid, size_t oid_len);
~Oid();
-
+
SmiUINT32 get_syntax();
Oid& operator=( const Oid &oid);
int operator==( const Oid &lhs,const Oid &rhs);
@@ -78,7 +74,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
char *to_string();
SnmpSyntax *clone() const;
SnmpSyntax& operator=( SnmpSyntax &val);
- */
+ */
static void OidTest()
{
@@ -149,22 +145,22 @@ static void OidTest()
d1 += ll;
d1 += ll;
d1 += "0";
- ACE_ASSERT(d1.valid() == 1);
- ACE_ASSERT(d1.length() == 4);
+ ACE_ASSERT(d1.valid() == 1);
+ ACE_ASSERT(d1.length() == 4);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d1(0,max,max,0) [%s]\n",
d1.to_string()));
- ACE_ASSERT(d1[0] == (unsigned long)0);
- ACE_ASSERT(d1[1] == ll);
- ACE_ASSERT(d1[2] == ll);
- ACE_ASSERT(d1[3] == (unsigned long)0);
+ ACE_ASSERT(d1[0] == (unsigned long)0);
+ ACE_ASSERT(d1[1] == ll);
+ ACE_ASSERT(d1[2] == ll);
+ ACE_ASSERT(d1[3] == (unsigned long)0);
- d2 += d1;
+ d2 += d1;
ACE_ASSERT(d2.valid() == 1);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:(5.6.7.8.9.10) [%s]\n",
d2.to_string()));
- // test out max Oid string...
-
+ // test out max Oid string...
+
// relational operators oid,oid
ACE_ASSERT(d2 == d2);
ACE_ASSERT(!(d2 != d2));
@@ -174,7 +170,7 @@ static void OidTest()
ACE_ASSERT(d2 <= d2);
}
-
+
int
main (int, char *[])
{
@@ -183,7 +179,3 @@ main (int, char *[])
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Target_Test.cpp b/ASNMP/tests/Target_Test.cpp
index a1ff8e1fb51..dbbc848e401 100644
--- a/ASNMP/tests/Target_Test.cpp
+++ b/ASNMP/tests/Target_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -9,9 +9,9 @@
// Target_Test.cpp
//
// = DESCRIPTION
-// Test all the member functions of the Target class.
+// Test all the member functions of the Target class.
// Not sure if this object is really required or not in the new framework
-//
+//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
@@ -19,7 +19,7 @@
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -28,7 +28,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -38,25 +38,21 @@ LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE
SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL
DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-#include "ace/OS.h"
+
+#include "ace/OS.h"
#include "asnmp/octet.h"
#include "asnmp/target.h"
#include "test_config.h"
-
+
ACE_RCSID(tests, Target_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
/*
Percieved Problems with this CTarget aka UdpTarget Interface:
1) can't set snmp version during constructor (default value?)
- 2) doesn't use ANSI C++ String class (still uses char *)
- 3) Makes it easy to mix up read and write comm strs (could be diff types)
+ 2) doesn't use ANSI C++ String class (still uses char *)
+ 3) Makes it easy to mix up read and write comm strs (could be diff types)
3) so many get/set's, leads one to rethink the design/use of UdpTarget
4) Use of resolve_to_C smells like a HACK...
5) No valid() member function returns 1 even if no address given..
@@ -88,7 +84,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
UdpTarget& operator=( const UdpTarget& target);
friend int operator==( const UdpTarget &lhs, const UdpTarget &rhs);
- */
+ */
static void TestSnmpTarget()
{
@@ -108,8 +104,8 @@ static void TestSnmpTarget()
ACE_ASSERT(a == b);
c1.get_write_community(a);
ACE_ASSERT(a == c);
- c1.get_address (ga);
- ACE_ASSERT(c1.get_version() == version1);
+ c1.get_address (ga);
+ ACE_ASSERT(c1.get_version() == version1);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c1(\"\") [%s]\n",
c1.to_string()));
@@ -117,9 +113,9 @@ static void TestSnmpTarget()
IpAddress ip("127.0.0.1");
UdpTarget c2(ip);
ACE_ASSERT(c2.valid() == 1);
- c2.get_address (ga);
+ c2.get_address (ga);
ACE_ASSERT(ga.valid() == 1);
- ACE_ASSERT(c2.get_version() == version1);
+ ACE_ASSERT(c2.get_version() == version1);
ACE_ASSERT(ga.valid() == 1);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c2(\"\") [%s]\n",
c2.to_string()));
@@ -129,7 +125,7 @@ static void TestSnmpTarget()
ACE_ASSERT(c5->valid() == 1);
c5->get_address (ga);
ACE_ASSERT(ga.valid() == 1);
- ACE_ASSERT(c5->get_version() == version1);
+ ACE_ASSERT(c5->get_version() == version1);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c5(\"\") [%s]\n",
c5->to_string()));
delete c5;
@@ -145,11 +141,7 @@ main (int, char *[])
{
ACE_START_TEST ("Target_Test");
TestSnmpTarget();
-
+
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/Varbind_Test.cpp b/ASNMP/tests/Varbind_Test.cpp
index 46b38fd219d..cb2ecaa415f 100644
--- a/ASNMP/tests/Varbind_Test.cpp
+++ b/ASNMP/tests/Varbind_Test.cpp
@@ -1,5 +1,5 @@
// $Id$
-
+
// ============================================================================
//
// = LIBRARY
@@ -9,9 +9,9 @@
// Varbind_Test.cpp
//
// = DESCRIPTION
-// Test all the member functions of the Varbind class.
+// Test all the member functions of the Varbind class.
// A varbind is a list of { oids and associated values }
-//
+//
// = AUTHOR
// Michael R. MacFaden <mrm@cisco.com>
//
@@ -19,7 +19,7 @@
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright 1997 Cisco Systems, Inc.
-
+
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies of the software and
@@ -28,7 +28,7 @@ in advertising or publicity pertaining to distribution of the
program without specific prior permission, and notice be given
in supporting documentation that modification, copying and distribution is by
permission of Cisco Systems, Inc.
-
+
Cisco Systems, Inc. makes no representations about the suitability of this
software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS''
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
@@ -47,10 +47,6 @@ DAMAGES.
ACE_RCSID(tests, Varbind_Test, "$Id$")
-// hack: do this so when linking SUNC 4.x compiler will instantiate template
-#include "ace/Containers.h"
-ACE_Unbounded_Set<ACE_Log_Msg*> x;
-
/*
Vb( void);
Vb( const Oid &oid);
@@ -86,7 +82,7 @@ ACE_Unbounded_Set<ACE_Log_Msg*> x;
char *to_string();
char *to_string_value();
char *to_string_oid();
- */
+ */
static void VbTest()
{
@@ -97,7 +93,7 @@ static void VbTest()
// purpose of this routine??
set_exception_status( &v1, 10);
-
+
Vb v2(v1);
ACE_ASSERT(v2.valid() == 0);
Oid o1("1.2.3"), o2;
@@ -118,54 +114,54 @@ static void VbTest()
v3.set_value(t);
ACE_ASSERT(v3.valid() == 1);
v3.get_value(t1);
- ACE_ASSERT(t == t1);
+ ACE_ASSERT(t == t1);
Vb v4;
v4.set_oid(o1);
v4.set_value(o1);
ACE_ASSERT(v4.valid() == 1);
v4.get_value(o2);
- ACE_ASSERT(o1 == o2);
+ ACE_ASSERT(o1 == o2);
Vb v5;
- Counter32 c1(12), c2;
+ Counter32 c1(12), c2;
v5.set_oid(o1);
v5.set_value(c1);
ACE_ASSERT(v5.valid() == 1);
v5.get_value(c2);
- ACE_ASSERT(c1 == c2);
+ ACE_ASSERT(c1 == c2);
Vb v6;
- Counter64 c3(12345678901234), c4;
+ Counter64 c3(12345678901234), c4;
v6.set_oid(o1);
v6.set_value(c3);
ACE_ASSERT(v6.valid() == 1);
v6.get_value(c4);
- ACE_ASSERT(c3 == c4);
+ ACE_ASSERT(c3 == c4);
Vb v7;
- Gauge32 g1(0123456), g2;
+ Gauge32 g1(0123456), g2;
v7.set_oid(o1);
v7.set_value(g1);
ACE_ASSERT(v7.valid() == 1);
v7.get_value(g2);
- ACE_ASSERT(g1 == g2);
+ ACE_ASSERT(g1 == g2);
Vb v8;
- SnmpInt32 i1(0123456), i2;
+ SnmpInt32 i1(0123456), i2;
v8.set_oid(o1);
v8.set_value(i1);
ACE_ASSERT(v8.valid() == 1);
v8.get_value(i2);
- ACE_ASSERT(i1 == i2);
+ ACE_ASSERT(i1 == i2);
Vb v9;
- SnmpUInt32 u1(0123456), u2;
+ SnmpUInt32 u1(0123456), u2;
v9.set_oid(o1);
v9.set_value(u1);
ACE_ASSERT(v9.valid() == 1);
v9.get_value(u2);
- ACE_ASSERT(u1 == u2);
+ ACE_ASSERT(u1 == u2);
Vb v10;
OctetStr s1(" abcdefghighlmnopqrstuvwxyz!@#$%^&*()"), s2;
@@ -173,7 +169,7 @@ static void VbTest()
v10.set_value(s1);
ACE_ASSERT(v10.valid() == 1);
v10.get_value(s2);
- ACE_ASSERT(s1 == s2);
+ ACE_ASSERT(s1 == s2);
ACE_ASSERT(s1.length() == s2.length());
// test assignment over all datatypes
@@ -186,7 +182,7 @@ static void VbTest()
v11.get_oid(o2);
ACE_ASSERT(o1 == o2);
v11.get_value(s2);
- ACE_ASSERT(s1 == s2);
+ ACE_ASSERT(s1 == s2);
}
int
@@ -197,7 +193,3 @@ main (int, char *[])
ACE_END_TEST;
return 0;
}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Unbounded_Set<ACE_Log_Msg*>;
-#endif
diff --git a/ASNMP/tests/test_config.h b/ASNMP/tests/test_config.h
index b548ae88c22..dc9155b8605 100644
--- a/ASNMP/tests/test_config.h
+++ b/ASNMP/tests/test_config.h
@@ -14,6 +14,7 @@
#ifndef ACE_TEST_CONFIG_H
#define ACE_TEST_CONFIG_H
+#include "ace/ACE.h"
#include <iostream.h>
#include <fstream.h>