summaryrefslogtreecommitdiff
path: root/ASNMP/tests/Counter_Test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ASNMP/tests/Counter_Test.cpp')
-rw-r--r--ASNMP/tests/Counter_Test.cpp52
1 files changed, 21 insertions, 31 deletions
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