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

C:/temp/src/j2k/Test/UtilTest.cpp

Go to the documentation of this file.
00001 ////////////////////////////////////
00002 //  Test for the utility macros   //
00003 ////////////////////////////////////
00004 
00005 #include <j2k/Fred/Basic.hpp>
00006 #include <j2k/Fred/Util/Util.hpp>
00007 
00008 #define SIZEOF(array) (sizeof(array)/sizeof(*array))
00009 
00010 int main()
00011 {
00012 printf( "test utils \n" );
00013 // Test REPEAT_xxx
00014 char str[] = REPEAT(1024, " ");
00015 assert (strlen (str) == 1024);
00016 assert (SIZEOF (str) == 1025);   // including trailing '\0'
00017 
00018 int ones[] = { REPEAT_WC (1024, 1) };
00019 assert (SIZEOF (ones) == 1024);
00020 
00021 printf( "[%c][%d] \n", str[1023], ones[1023] );
00022 printf( "Click on me!" );
00023 fflush( stdout );
00024 
00025 char c;
00026 cin >> c;
00027 
00028   return 0;
00029 }
00030 
00031 

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