Changeset 7805
- Timestamp:
- Jul 3, 2006, 3:42:20 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/mathtypes/tap_psVector.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/mathtypes/tap_psVector.c
r7790 r7805 13 13 14 14 ok(psVec != NULL, "psVector successfully allocated"); 15 skip_start(psVec == NULL, 4, "Skipping 4 tests because psVectorAlloc() failed"); 15 16 ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc); 16 17 ok(psVec->n == 0, "Vector population = %ld", psVec->n); 17 ok (psVec->type.type == PS_TYPE_S32, "Vector type = %d", psVec->type.type);18 ok(psVec->type.type == PS_TYPE_S32, "Vector type = %d", psVec->type.type); 18 19 ok(psVec->type.dimen == PS_DIMEN_VECTOR, "Vector dimen = %d", psVec->type.dimen); 20 skip_end(); 19 21 20 22 psFree(psVec); … … 25 27 26 28 ok(vecZero != NULL, "zero-length vector allocated"); 29 skip_start(vecZero == NULL, 2, "Skipping 2 tests because psVectorAlloc() failed"); 27 30 ok(vecZero->nalloc == 0, "Vector size = %ld", vecZero->nalloc); 28 31 ok(vecZero->n == 0, "Vector population = %ld", vecZero->n); 32 skip_end(); 29 33 30 34 psFree(vecZero); … … 61 65 psVec = psVectorRealloc(psVec,10); 62 66 ok(psVec != NULL, "test vector reallocated to bigger size"); 67 skip_start(psVec == NULL, 4, "Skipping 4 tests because psVectorRealloc() failed"); 63 68 ok(psVec->nalloc == 10, "Vector size = %ld", psVec->nalloc); 64 69 ok(psVec->n == 5, "Vector population = %ld", psVec->n); 65 70 ok(psVec->type.type == PS_TYPE_S32, "Vector type = %d", psVec->type.type); 66 71 ok(psVec->type.dimen == PS_DIMEN_VECTOR, "Vector dimen = %d", psVec->type.dimen); 72 skip_end(); 67 73 68 74 // generate test data values … … 73 79 74 80 // test data values 81 skip_start(psVec == NULL, 10, "Skipping 10 tests because psVectorRealloc() failed"); 75 82 for(psS32 i = 0; i < 10; i++) { 76 83 ok (psVec->data.S32[i] == i*10, "Elem %d = %d, expected %d", i, psVec->data.S32[i], i*10); 77 84 } 85 skip_end(); 78 86 79 87 psFree(psVec); … … 87 95 88 96 ok(psVec != NULL, "test vector reallocated to smaller size"); 97 skip_start(psVec == NULL, 5, "Skipping 6 tests because psVectorRealloc() failed"); 89 98 ok(psVec->nalloc == 3, "Vector size = %ld", psVec->nalloc); 90 99 ok(psVec->n == 3, "Vector population = %ld", psVec->n); … … 94 103 ok (psVec->data.S32[i] == i*10, "Elem %d = %d, expected %d", i, psVec->data.S32[i], i*10); 95 104 } 96 105 skip_end(); 106 } 107 108 { 97 109 // reallocate to 0 length 110 psVector *psVec = psVectorAlloc(5, PS_TYPE_S32); 98 111 psVec = psVectorRealloc(psVec,0); 112 99 113 ok(psVec != NULL, "test vector reallocated to zero length"); 114 skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorRealloc() failed"); 100 115 ok(psVec->nalloc == 0, "Vector size = %ld", psVec->nalloc); 101 116 ok(psVec->n == 0, "Vector population = %ld", psVec->n); 117 skip_end(); 102 118 103 119 // Test E - Free S32 vector … … 131 147 132 148 ok(psVec != NULL, "test vector extended"); 149 skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed"); 133 150 ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc); 134 151 ok(psVec->n == 2, "Vector population = %ld", psVec->n); 152 skip_end(); 135 153 136 154 psFree(psVec); … … 143 161 144 162 ok(psVec != NULL, "test vector extended"); 163 skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed"); 145 164 ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc); 146 165 ok(psVec->n == 4,"Vector population = %ld", psVec->n); 166 skip_end(); 147 167 148 168 psFree(psVec); … … 156 176 157 177 ok(psVec != NULL, "test vector extended"); 178 skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed"); 158 179 ok(psVec->nalloc == 5 ,"Vector size = %ld", psVec->nalloc); 159 180 ok(psVec->n == 2, "Vector population = %ld", psVec->n); 181 skip_end(); 160 182 161 183 psFree(psVec); … … 170 192 171 193 ok(psVec != NULL, "test vector extended"); 194 skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed"); 172 195 ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc); 173 196 ok(psVec->n == 0, "Vector population = %ld", psVec->n); 197 skip_end(); 174 198 175 199 psFree(psVec); … … 490 514 psVector *copy = psVectorCopy(NULL, in, PS_TYPE_F64); 491 515 ok(copy != NULL, "returned a non NULL vector for correct input"); 516 skip_start(copy == NULL, 1, "Skipping 1 test because psVectorCopy() failed"); 492 517 ok(copy->data.F64[2] == 2.0, 493 518 "copy->data.f64[2] = %lf, in->data.f32[2] = %f", 494 519 copy->data.F64[2], in->data.F32[2]); 520 skip_end(); 495 521 496 522 psFree(in);
Note:
See TracChangeset
for help on using the changeset viewer.
