Changeset 3313 for trunk/psLib/test/dataManip/tst_psMatrix02.c
- Timestamp:
- Feb 23, 2005, 2:19:51 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psMatrix02.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psMatrix02.c
r3264 r3313 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-02- 17 19:26:25$14 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-02-24 00:19:51 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 33 33 // Test A - Input pointer same as output pointer 34 printNegativeTestHeader(stdout,"psMatrix", "Input pointer same as output pointer", 35 "Invalid operation: Pointer to inImage is same as outImage.", 0); 36 psMatrixTranspose(inImage, inImage); 34 printPositiveTestHeader(stdout,"psMatrix", "Input pointer same as output pointer"); 35 psMemIncrRefCounter(inImage); 36 if (psMatrixTranspose(inImage, inImage) != NULL) { 37 psError(PS_ERR_UNKNOWN, true, 38 "inImage = outImage didn't results in NULL return"); 39 return 1; 40 } 41 if (psMemGetRefCounter(inImage) != 1) { 42 psError(PS_ERR_UNKNOWN, true, 43 "the output image was not freed on an error."); 44 return 2; 45 } 37 46 printFooter(stdout, "psMatrix", "Input pointer same as output pointer", true); 38 47 39 48 // Test B - Null input psImage 40 printNegativeTestHeader(stdout,"psMatrix", "Null input psImage", 41 "Invalid operation: inImage or its data is NULL.", 0); 42 psMatrixTranspose(outImage, nullImage); 49 printPositiveTestHeader(stdout,"psMatrix", "Null input psImage"); 50 psMemIncrRefCounter(outImage); 51 if (psMatrixTranspose(outImage, nullImage) != NULL) { 52 psError(PS_ERR_UNKNOWN, true, 53 "inImage = outImage didn't results in NULL return"); 54 return 3; 55 } 56 if (psMemGetRefCounter(outImage) != 1) { 57 psError(PS_ERR_UNKNOWN, true, 58 "the output image was not freed on an error."); 59 return 4; 60 } 43 61 printFooter(stdout, "psMatrix", "Null input psImage", true); 44 62 45 63 // Test C - Incorrect type for input pointer 46 printNegativeTestHeader(stdout,"psMatrix", "Incorrect type for input pointer", 47 "|Invalid operation: inImage not PS_TYPE_F64.", 0); 48 psMatrixTranspose(outImage, badImage1); 64 printPositiveTestHeader(stdout,"psMatrix", "Incorrect type for input pointer"); 65 psMemIncrRefCounter(outImage); 66 if (psMatrixTranspose(outImage, badImage1) != NULL) { 67 psError(PS_ERR_UNKNOWN, true, 68 "inImage = outImage didn't results in NULL return"); 69 return 5; 70 } 71 if (psMemGetRefCounter(outImage) != 1) { 72 psError(PS_ERR_UNKNOWN, true, 73 "the output image was not freed on an error."); 74 return 6; 75 } 49 76 printFooter(stdout, "psMatrix", "Incorrect type for input pointer", true); 50 77 51 78 // Test D - Incorrect type for output pointer 52 printNegativeTestHeader(stdout,"psMatrix", "Incorrect type for output pointer", 53 "Invalid operation: outImage not PS_TYPE_F64.", 0); 54 psMatrixTranspose(badImage1, inImage); 79 printPositiveTestHeader(stdout,"psMatrix", "Incorrect type for output pointer"); 80 badImage1 = psMatrixTranspose(badImage1, inImage); 81 if (badImage1 == NULL) { 82 psError(PS_ERR_UNKNOWN, true, 83 "inImage = outImage didn't results in NULL return"); 84 return 7; 85 } 86 // check that the type was changed. 87 if (badImage1->type.type != PS_TYPE_F64) { 88 psError(PS_ERR_UNKNOWN, true, 89 "the output image was not freed on an error."); 90 return 8; 91 } 55 92 printFooter(stdout, "psMatrix", "Incorrect type for output pointer", true); 56 93 57 94 // Test E - Matrix not square for output pointer 58 printNegativeTestHeader(stdout,"psMatrix", "Matrix not square for output pointer", 59 "Invalid operation: outImage not square array.", 0); 95 printPositiveTestHeader(stdout,"psMatrix", "Matrix not square for output pointer"); 60 96 psMatrixTranspose(badImage2, inImage); 61 97 printFooter(stdout, "psMatrix", "Matrix not square for output pointer", true);
Note:
See TracChangeset
for help on using the changeset viewer.
