Changeset 1406 for trunk/psLib/test/dataManip/tst_psMatrix01.c
- Timestamp:
- Aug 6, 2004, 12:34:06 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psMatrix01.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psMatrix01.c
r1346 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 7-30 02:55:47$13 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:06 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #define PRINT_MATRIX(IMAGE) \ 24 24 for(int i=IMAGE->numRows-1; i>-1; i--) { \ 25 for(int j=0; j<IMAGE->numCols; j++) { \26 printf("%f ", IMAGE->data.F64[i][j]); \27 } \28 printf("\n"); \29 }30 25 for(int j=0; j<IMAGE->numCols; j++) { \ 26 printf("%f ", IMAGE->data.F64[i][j]); \ 27 } \ 28 printf("\n"); \ 29 } 30 31 31 int main( int argc, 32 32 char* argv[] ) 33 33 { 34 34 psImage * tempImage = NULL; 35 36 35 36 37 37 // Test A - Create input and output images 38 38 printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" ); … … 50 50 PRINT_MATRIX( inImage ); 51 51 printFooter( stdout, "psMatrix", "Create input and output images", true ); 52 53 52 53 54 54 // Test B - Transpose input image into output image 55 55 printPositiveTestHeader( stdout, "psMatrix", "Transpose input image into output image" ); … … 58 58 PRINT_MATRIX( outImage ); 59 59 if ( outImage->type.dimen != PS_DIMEN_IMAGE ) { 60 printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" ); 61 } else if ( outImage != tempImage ) { 60 printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" ); 61 } else 62 if ( outImage != tempImage ) { 62 63 printf( "Error: Return pointer not equal to output argument pointer\n" ); 63 64 } 64 65 printFooter( stdout, "psMatrix", "Transpose input image into output image", true ); 65 66 66 67 67 68 // Test C - Transpose input image into auto allocated NULL output image 68 69 printPositiveTestHeader( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image" ); … … 71 72 PRINT_MATRIX( outImageNull ); 72 73 printFooter( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image", true ); 73 74 74 75 75 76 // Test D - Free images and check for leaks 76 77 printPositiveTestHeader( stdout, "psMatrix", "Free images and check for leaks" ); … … 80 81 int nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 81 82 if ( nLeaks != 0 ) { 82 printf( "ERROR: Found %d memory leaks\n", nLeaks );83 }83 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 84 } 84 85 int nBad = psMemCheckCorruption( 0 ); 85 86 if ( nBad ) { 86 printf( "ERROR: Found %d bad memory blocks\n", nBad );87 }87 printf( "ERROR: Found %d bad memory blocks\n", nBad ); 88 } 88 89 printFooter( stdout, "psMatrix" , "Free images and check for leaks", true ); 89 90 90 91 return 0; 91 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
