diff options
Diffstat (limited to 'ASNMP/tests/Counter64_Test.cpp')
-rw-r--r-- | ASNMP/tests/Counter64_Test.cpp | 41 |
1 files changed, 16 insertions, 25 deletions
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 |