Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Fred/JCounterTest.cpp

Go to the documentation of this file.
00001 #ifndef __JCounterTest_CPP__
00002 #define __JCounterTest_CPP__
00003 
00004 #include "JCounter.hpp"
00005 #include "JCounter.cpp"
00006 
00007 void test()
00008 {
00009    JCounter n[ 6 ] =
00010    {
00011       JCounter( 1 )
00012      ,JCounter( 10, 0 )
00013      ,JCounter( 100 )
00014      ,JCounter( 1000, 400 )
00015      ,JCounter( 10000 )
00016      ,JCounter( (unsigned)(-1) )
00017    };
00018 
00019 
00020      register int i = 0;
00021 
00022      for( i = 0; i < 6; i++ ) {
00023           cout << ( ++n[i] * n[i] - n[i] ) << endl;
00024    }
00025 
00026      for( i = 0; i < 6; i++ ) {
00027           cout << ( n[i]-- / n[i] + n[i] ) << endl;
00028    }
00029 
00030      for( i = 0; i < 6; i++ ) {
00031         ULONG l = n[i];
00032         cout << l << endl;
00033         assert( l == n[i]   );
00034         assert( l >= --n[i] );
00035         assert( l == ++n[i] );
00036         assert( l <= ~n[i]  );
00037         assert( l >= !n[i]  );
00038      }
00039 
00040 }
00041 
00042 int main() {
00043   test();
00044   return 0;
00045 }
00046 
00047 #endif

Generated on Sun Oct 14 18:46:32 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001