Changeset 15712
- Timestamp:
- Nov 29, 2007, 11:45:08 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/types/tap_psArray_all.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/types/tap_psArray_all.c
r12781 r15712 20 20 psLogSetFormat("HLNM"); 21 21 psLogSetLevel(PS_LOG_INFO); 22 plan_tests(3 2);22 plan_tests(31); 23 23 24 24 // testArrayAllocs() … … 47 47 } 48 48 49 //Tests for psMemCheckArray50 //Make sure psMemCheckArray works correctly - return false51 {52 int j = 2;53 ok( !psMemCheckArray(&j),54 "psMemCheckArray: return false for non-Array input.");55 }56 49 //Tests for psArrayRealloc 57 50 //Now try to reallocate the psArray - bigger … … 94 87 psFree(s32); 95 88 } 96 89 97 90 //Attempt to free a NULL psArray 98 91 psArrayElementsFree(NULL); … … 116 109 psS32 *s2 = (psS32*)psAlloc(sizeof(psS32)); 117 110 psS32 *s3 = (psS32*)psAlloc(sizeof(psS32)); 118 111 119 112 //Tests for psArrayAdd 120 113 //Attempt to add element to NULL psArray. … … 138 131 "psArrayAdd: return array with newly added data."); 139 132 } 140 133 141 134 //Tests for psArrayRemoveData 142 135 //Setup array with 3 elements to test remove function … … 152 145 "psArrayRemoveData: return true for successful removal."); 153 146 } 154 147 155 148 //Tests for psArrayRemoveIndex 156 149 //Return false for NULL array input … … 169 162 "psArrayRemoveIndex: return true for successful removal."); 170 163 } 171 164 172 165 psFree(s1); 173 166 psFree(s2); … … 177 170 } 178 171 179 172 180 173 // testArraySetGet() 181 174 { … … 189 182 psS32 *s3 = (psS32*)psAlloc(sizeof(psS32)); 190 183 *s3 = 3; 191 184 192 185 //Tests for psArraySet 193 186 //Return false for trying to set a NULL psArray … … 225 218 "psArraySet: return true for valid negative input position."); 226 219 } 227 220 228 221 //Tests for psArrayGet 229 222 //Return NULL for NULL array input … … 252 245 "psArrayGet: return correct value for valid position."); 253 246 } 254 247 255 248 psFree(a); 256 249 psFree(s1); … … 279 272 psS32 *s5 = (psS32*)psAlloc(sizeof(psS32)); 280 273 psS32 *s6 = (psS32*)psAlloc(sizeof(psS32)); 281 274 282 275 //Tests for psArraySort 283 276 //Return NULL for attempt to sort NULL psArray input. … … 297 290 "psArraySort: return properly sorted psArray."); 298 291 } 299 292 300 293 psFree(s1); 301 294 psFree(s2);
Note:
See TracChangeset
for help on using the changeset viewer.
