IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7805


Ignore:
Timestamp:
Jul 3, 2006, 3:42:20 PM (20 years ago)
Author:
jhoblitt
Message:

skip tests on NULL pointers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/mathtypes/tap_psVector.c

    r7790 r7805  
    1313
    1414        ok(psVec != NULL, "psVector successfully allocated");
     15        skip_start(psVec == NULL, 4, "Skipping 4 tests because psVectorAlloc() failed");
    1516        ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc);
    1617        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);
    1819        ok(psVec->type.dimen == PS_DIMEN_VECTOR, "Vector dimen = %d", psVec->type.dimen);
     20        skip_end();
    1921
    2022        psFree(psVec);
     
    2527
    2628        ok(vecZero != NULL, "zero-length vector allocated");
     29        skip_start(vecZero == NULL, 2, "Skipping 2 tests because psVectorAlloc() failed");
    2730        ok(vecZero->nalloc == 0, "Vector size = %ld", vecZero->nalloc);
    2831        ok(vecZero->n == 0, "Vector population = %ld", vecZero->n);
     32        skip_end();
    2933
    3034        psFree(vecZero);
     
    6165        psVec = psVectorRealloc(psVec,10);
    6266        ok(psVec != NULL, "test vector reallocated to bigger size");
     67        skip_start(psVec == NULL, 4, "Skipping 4 tests because psVectorRealloc() failed");
    6368        ok(psVec->nalloc == 10, "Vector size = %ld", psVec->nalloc);
    6469        ok(psVec->n == 5, "Vector population = %ld", psVec->n);
    6570        ok(psVec->type.type == PS_TYPE_S32, "Vector type = %d", psVec->type.type);
    6671        ok(psVec->type.dimen == PS_DIMEN_VECTOR, "Vector dimen = %d", psVec->type.dimen);
     72        skip_end();
    6773
    6874        // generate test data values
     
    7379
    7480        // test data values
     81        skip_start(psVec == NULL, 10, "Skipping 10 tests because psVectorRealloc() failed");
    7582        for(psS32 i = 0; i < 10; i++) {
    7683            ok (psVec->data.S32[i] == i*10, "Elem %d = %d, expected %d", i, psVec->data.S32[i], i*10);
    7784        }
     85        skip_end();
    7886
    7987        psFree(psVec);
     
    8795
    8896        ok(psVec != NULL, "test vector reallocated to smaller size");
     97        skip_start(psVec == NULL, 5, "Skipping 6 tests because psVectorRealloc() failed");
    8998        ok(psVec->nalloc == 3, "Vector size = %ld", psVec->nalloc);
    9099        ok(psVec->n == 3, "Vector population = %ld", psVec->n);
     
    94103            ok (psVec->data.S32[i] == i*10, "Elem %d = %d, expected %d", i, psVec->data.S32[i], i*10);
    95104        }
    96 
     105        skip_end();
     106    }
     107
     108    {
    97109        // reallocate to 0 length
     110        psVector *psVec = psVectorAlloc(5, PS_TYPE_S32);
    98111        psVec = psVectorRealloc(psVec,0);
     112
    99113        ok(psVec != NULL, "test vector reallocated to zero length");
     114        skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorRealloc() failed");
    100115        ok(psVec->nalloc == 0, "Vector size = %ld", psVec->nalloc);
    101116        ok(psVec->n == 0, "Vector population = %ld", psVec->n);
     117        skip_end();
    102118
    103119        // Test E - Free S32 vector
     
    131147
    132148        ok(psVec != NULL, "test vector extended");
     149        skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed");
    133150        ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc);
    134151        ok(psVec->n == 2, "Vector population = %ld", psVec->n);
     152        skip_end();
    135153
    136154        psFree(psVec);
     
    143161
    144162        ok(psVec != NULL, "test vector extended");
     163        skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed");
    145164        ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc);
    146165        ok(psVec->n == 4,"Vector population = %ld", psVec->n);
     166        skip_end();
    147167
    148168        psFree(psVec);
     
    156176
    157177        ok(psVec != NULL, "test vector extended");
     178        skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed");
    158179        ok(psVec->nalloc == 5 ,"Vector size = %ld", psVec->nalloc);
    159180        ok(psVec->n == 2, "Vector population = %ld", psVec->n);
     181        skip_end();
    160182
    161183        psFree(psVec);
     
    170192
    171193        ok(psVec != NULL, "test vector extended");
     194        skip_start(psVec == NULL, 2, "Skipping 2 tests because psVectorExtend() failed");
    172195        ok(psVec->nalloc == 5, "Vector size = %ld", psVec->nalloc);
    173196        ok(psVec->n == 0, "Vector population = %ld", psVec->n);
     197        skip_end();
    174198
    175199        psFree(psVec);
     
    490514        psVector *copy = psVectorCopy(NULL, in, PS_TYPE_F64);
    491515        ok(copy != NULL, "returned a non NULL vector for correct input");
     516        skip_start(copy == NULL, 1, "Skipping 1 test because psVectorCopy() failed");
    492517        ok(copy->data.F64[2] == 2.0,
    493518           "copy->data.f64[2] = %lf, in->data.f32[2] = %f",
    494519           copy->data.F64[2], in->data.F32[2]);
     520        skip_end();
    495521
    496522        psFree(in);
Note: See TracChangeset for help on using the changeset viewer.