Changeset 2021 for trunk/psLib/test/dataManip
- Timestamp:
- Oct 7, 2004, 4:48:01 PM (22 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 3 edited
-
tst_psMatrixVectorArithmetic03.c (modified) (6 diffs)
-
verified/tst_psMatrixVectorArithmetic03.stderr (modified) (3 diffs)
-
verified/tst_psMatrixVectorArithmetic03.stdout (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c
r1648 r2021 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $18 * @date $Date: 2004- 08-27 23:31:35$17 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-10-08 02:48:01 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 86 86 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Check for NULL arguments", 87 87 "Null XXX argument", 0); 88 psBinaryOp(NULL, image1, "+", image2); 89 psBinaryOp(image2, NULL, "+", image2); 90 psBinaryOp(image2, image1, "+", NULL); 91 psBinaryOp(image2, image1, NULL, image2); 92 psUnaryOp(NULL, image1, "sin"); 93 psUnaryOp(image2, NULL, "sin"); 94 psUnaryOp(image2, image1, NULL); 95 printFooter(stdout, "psBitSet", "Check for NULL arguments", true); 96 88 psImage* image6 = (psImage*)psBinaryOp(NULL, image1, "+", image2); 89 if (image6 == NULL) { 90 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp failed to make an image given no output to recycle."); 91 return 1; 92 } 93 94 image6 = (psImage*)psBinaryOp(image6, NULL, "+", image2); 95 if (image6 != NULL) { 96 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given a NULL first operand."); 97 return 2; 98 } 99 100 image6 = (psImage*)psBinaryOp(image6, image1, "+", NULL); 101 if (image6 != NULL) { 102 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given a NULL second operand."); 103 return 3; 104 } 105 image6 = (psImage*)psBinaryOp(image6, image1, NULL, image2); 106 if (image6 != NULL) { 107 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given a NULL operator."); 108 return 4; 109 } 110 111 image6 = (psImage*)psUnaryOp(NULL, image1, "sin"); 112 if (image6 == NULL) { 113 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp failed to make an image given no output to recycle."); 114 return 5; 115 } 116 117 image6 = (psImage*)psUnaryOp(image6, NULL, "sin"); 118 if (image6 != NULL) { 119 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp returned a result given a NULL operand."); 120 return 6; 121 } 122 123 image6 = (psImage*)psUnaryOp(image6, image1, NULL); 124 if (image6 != NULL) { 125 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp returned a result given a NULL operator."); 126 return 7; 127 } 128 129 printFooter(stdout, "psMatrixVectorArithmetic", "Check for NULL arguments", true); 97 130 98 131 // Inconsistent element types 99 132 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent element types", 100 133 "Element types for arguments inconsistent", 0); 101 psBinaryOp(image2, image3, "+", image2); 102 psUnaryOp(image2, image3, "sin"); 103 printFooter(stdout, "psBitSet", "Inconsistent element types", true); 134 image6 = (psImage*)psBinaryOp(image6, image3, "+", image2); 135 if (image6 != NULL) { 136 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given operands of different types."); 137 return 8; 138 } 139 140 image6 = psImageCopy(image6,image2,PS_TYPE_F64); 141 image6 = (psImage*)psUnaryOp(image6, image3, "sin"); 142 if (image6 == NULL || image6->type.type != PS_TYPE_F32) { 143 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp failed to convert the type of the output."); 144 return 9; 145 } 146 147 printFooter(stdout, "psMatrixVectorArithmetic", "Inconsistent element types", true); 104 148 105 149 … … 107 151 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent element count", 108 152 "Inconsistent element count", 0); 109 psBinaryOp(image2, image4, "+", image2); 110 psUnaryOp(image2, image4, "sin"); 111 psBinaryOp(image2, vector1, "+", image2); 153 image6 = (psImage*)psBinaryOp(image6, image4, "+", image2); 154 if (image6 != NULL) { 155 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given operands of different sizes."); 156 return 10; 157 } 158 159 image6 = psImageCopy(image6,image2,PS_TYPE_F64); 160 image6 = (psImage*)psUnaryOp(image6, image4, "sin"); 161 if (image6 == NULL || 162 image6->numCols != image6->numCols || 163 image6->numRows != image6->numRows) { 164 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp failed to resize the output."); 165 return 11; 166 } 167 168 image6 = (psImage*)psBinaryOp(image6, vector1, "+", image2); 169 if (image6 != NULL) { 170 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given operands of different sizes."); 171 return 12; 172 } 173 112 174 vector1->type.dimen = PS_DIMEN_TRANSV; 113 psBinaryOp(image2, vector1, "+", image2); 114 printFooter(stdout, "psBitSet", "Inconsistent element count", true); 175 image6 = (psImage*)psBinaryOp(image6, vector1, "+", image2); 176 if (image6 != NULL) { 177 psLogMsg(__func__,PS_LOG_ERROR,"psBinaryOp returned a result given operands of different sizes."); 178 return 13; 179 } 180 printFooter(stdout, "psMatrixVectorArithmetic", "Inconsistent element count", true); 115 181 116 182 … … 118 184 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent dimensionality", 119 185 "Dimensionality for arguments inconsistent", 0); 120 psUnaryOp(image2, vector2, "sin"); 121 printFooter(stdout, "psBitSet", "Inconsistent dimensionality", true); 122 123 124 // Division by zero 125 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Divide by zero", 126 "Divide by zero", 0); 127 psBinaryOp(image1, image1, "/", image2); 128 printFooter(stdout, "psBitSet", "Division by zero", true); 129 186 image6 = psImageCopy(image6,image2,PS_TYPE_F64); 187 image6 = (psImage*)psUnaryOp(image6, vector2, "sin"); 188 if (image6 != NULL) { 189 psLogMsg(__func__,PS_LOG_ERROR,"psUnaryOp returned result given wrong type out parameter."); 190 return 14; 191 } 192 193 printFooter(stdout, "psMatrixVectorArithmetic", "Inconsistent dimensionality", true); 130 194 131 195 // Attempt to use min with complex numbers 132 196 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Use min with complex numbers", 133 197 "Minimum operation not supported for complex numbers", 0); 134 psBinaryOp(image5, image5, "min", image5);135 printFooter(stdout, "ps BitSet", "Use min with complex numbers", true);198 image6 = (psImage*)psBinaryOp(image6, image5, "min", image5); 199 printFooter(stdout, "psMatrixVectorArithmetic", "Use min with complex numbers", true); 136 200 137 201 … … 139 203 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Use max with complex numbers", 140 204 "Maximum operation not supported for complex numbers", 0); 141 psBinaryOp(image5, image5, "max", image5);142 printFooter(stdout, "ps BitSet", "Use max with complex numbers", true);205 image6 = (psImage*)psBinaryOp(image6, image5, "max", image5); 206 printFooter(stdout, "psMatrixVectorArithmetic", "Use max with complex numbers", true); 143 207 144 208 … … 146 210 printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Invalid operation", 147 211 "Invalid operation", 0); 148 psBinaryOp(image1, image1, "yarg", image2);149 psUnaryOp(image2, image1, "yarg");150 printFooter(stdout, "ps BitSet", "Invalid operation", true);212 image6 = (psImage*)psBinaryOp(image6, image1, "yarg", image2); 213 image6 = (psImage*)psUnaryOp(image6, image1, "yarg"); 214 printFooter(stdout, "psMatrixVectorArithmetic", "Invalid operation", true); 151 215 152 216 return 0; -
trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stderr
r1761 r2021 1 <DATE><TIME>|<HOST>|E|psBinaryOp2 : Line <LINENO> - Null out argument3 1 <DATE><TIME>|<HOST>|E|psBinaryOp 4 2 : Line <LINENO> - Null in1 argument … … 8 6 : Line <LINENO> - Null op argument 9 7 <DATE><TIME>|<HOST>|E|psUnaryOp 10 : Line <LINENO> - Null out argument11 <DATE><TIME>|<HOST>|E|psUnaryOp12 8 : Line <LINENO> - Null in argument 13 9 <DATE><TIME>|<HOST>|E|psUnaryOp 14 10 : Line <LINENO> - Null op argument 15 11 <DATE><TIME>|<HOST>|E|psBinaryOp 16 : Line <LINENO> - Element types for arguments inconsistent: (1028, 1032, 1032)17 <DATE><TIME>|<HOST>|E|psUnaryOp18 12 : Line <LINENO> - Element types for arguments inconsistent: (1028, 1032) 19 13 <DATE><TIME>|<HOST>|E|psBinaryOp 20 : Inconsistent element count: numRows: 2 vs 3 numCols: 2 vs 321 <DATE><TIME>|<HOST>|E|psUnaryOp22 14 : Inconsistent element count: numRows: 2 vs 3 numCols: 2 vs 3 23 15 <DATE><TIME>|<HOST>|E|psBinaryOp … … 25 17 <DATE><TIME>|<HOST>|E|psBinaryOp 26 18 : Inconsistent element count: 2 vs 3 19 <DATE><TIME>|<HOST>|E|psLib.collections.psVectorRecycle 20 The input psVector must have a vector dimension type. 27 21 <DATE><TIME>|<HOST>|E|psUnaryOp 28 : Line <LINENO> - Dimensionality for arguments inconsistent: (1, 3) 29 <DATE><TIME>|<HOST>|E|psNanDiv 30 : Divide by zero 31 <DATE><TIME>|<HOST>|E|psNanDiv 32 : Divide by zero 33 <DATE><TIME>|<HOST>|E|psNanDiv 34 : Divide by zero 35 <DATE><TIME>|<HOST>|E|psNanDiv 36 : Divide by zero 37 <DATE><TIME>|<HOST>|E|psNanDiv 38 : Divide by zero 39 <DATE><TIME>|<HOST>|E|psNanDiv 40 : Divide by zero 41 <DATE><TIME>|<HOST>|E|psNanDiv 42 : Divide by zero 43 <DATE><TIME>|<HOST>|E|psNanDiv 44 : Divide by zero 45 <DATE><TIME>|<HOST>|E|psNanDiv 46 : Divide by zero 22 Couldn't create a proper output psVector. 47 23 <DATE><TIME>|<HOST>|E|psBinaryOp 48 24 : Minimum operation not supported for complex numbers -
trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stdout
r1150 r2021 8 8 9 9 10 ---> TESTPOINT PASSED (ps BitSet{Check for NULL arguments} | tst_psMatrixVectorArithmetic03.c)10 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Check for NULL arguments} | tst_psMatrixVectorArithmetic03.c) 11 11 12 12 /***************************** TESTPOINT ******************************************\ … … 19 19 20 20 21 ---> TESTPOINT PASSED (ps BitSet{Inconsistent element types} | tst_psMatrixVectorArithmetic03.c)21 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Inconsistent element types} | tst_psMatrixVectorArithmetic03.c) 22 22 23 23 /***************************** TESTPOINT ******************************************\ … … 30 30 31 31 32 ---> TESTPOINT PASSED (ps BitSet{Inconsistent element count} | tst_psMatrixVectorArithmetic03.c)32 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Inconsistent element count} | tst_psMatrixVectorArithmetic03.c) 33 33 34 34 /***************************** TESTPOINT ******************************************\ … … 41 41 42 42 43 ---> TESTPOINT PASSED (psBitSet{Inconsistent dimensionality} | tst_psMatrixVectorArithmetic03.c) 44 45 /***************************** TESTPOINT ******************************************\ 46 * TestFile: tst_psMatrixVectorArithmetic03.c * 47 * TestPoint: psMatrixVectorArithmetic{Divide by zero} * 48 * TestType: Negative * 49 * ExpectedErrorText: Divide by zero * 50 * ExpectedStatusValue: 0 * 51 \**********************************************************************************/ 52 53 54 ---> TESTPOINT PASSED (psBitSet{Division by zero} | tst_psMatrixVectorArithmetic03.c) 43 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Inconsistent dimensionality} | tst_psMatrixVectorArithmetic03.c) 55 44 56 45 /***************************** TESTPOINT ******************************************\ … … 63 52 64 53 65 ---> TESTPOINT PASSED (ps BitSet{Use min with complex numbers} | tst_psMatrixVectorArithmetic03.c)54 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Use min with complex numbers} | tst_psMatrixVectorArithmetic03.c) 66 55 67 56 /***************************** TESTPOINT ******************************************\ … … 74 63 75 64 76 ---> TESTPOINT PASSED (ps BitSet{Use max with complex numbers} | tst_psMatrixVectorArithmetic03.c)65 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Use max with complex numbers} | tst_psMatrixVectorArithmetic03.c) 77 66 78 67 /***************************** TESTPOINT ******************************************\ … … 85 74 86 75 87 ---> TESTPOINT PASSED (ps BitSet{Invalid operation} | tst_psMatrixVectorArithmetic03.c)76 ---> TESTPOINT PASSED (psMatrixVectorArithmetic{Invalid operation} | tst_psMatrixVectorArithmetic03.c) 88 77
Note:
See TracChangeset
for help on using the changeset viewer.
