IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24083


Ignore:
Timestamp:
May 6, 2009, 2:17:40 PM (17 years ago)
Author:
eugene
Message:

reinstate tests with segfaults to remind us to fix them; modify psMatrixLUSolve api names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/math/tap_psMatrix03.c

    r13123 r24083  
    106106        psVector *inVector = (psVector*) psVectorAlloc(3, PS_TYPE_F64);
    107107
    108         luImage = psMatrixLUD(luImage, &perm, inImage);
    109         ok(luImage != NULL, "psMatrixLUD() produced a non-NULL LU matrix");
     108        luImage = psMatrixLUDecomposition(luImage, &perm, inImage);
     109        ok(luImage != NULL, "psMatrixLUDecomposition() produced a non-NULL LU matrix");
    110110        skip_start(luImage == NULL, 6, "Skipping tests because LU matrix was NULL");
    111         ok(!checkMatrix(luImage), "psMatrixLUD() produced the correct LU matrix");
     111        ok(!checkMatrix(luImage), "psMatrixLUDecomposition() produced the correct LU matrix");
    112112        ok(luImage->type.dimen == PS_DIMEN_IMAGE, "The LU matrix has the correct ->dimen member");
    113113        ok(luImage == tempImage, "The LU matrix was not created from scratch");
     
    119119        inVector->n = 3;
    120120
    121         outVector = psMatrixLUSolve(outVector, luImage, inVector, perm);
    122         ok(!checkVector(outVector), "psMatrixLUSolve() correctly solved the equations");
     121        outVector = psMatrixLUSolution(outVector, luImage, inVector, perm);
     122        ok(!checkVector(outVector), "psMatrixLUSolution() correctly solved the equations");
    123123        ok(outVector->type.dimen == PS_DIMEN_VECTOR, "The output vector hasthe correct ->dimen member");
    124124        ok(outVector == tempVector, "The output vector was not created from scratch");
     
    159159        inVector32->n = 3;
    160160
    161         luImage32 = psMatrixLUD(luImage32, &perm32, inImage32);
    162         ok(luImage32 != NULL, "psMatrixLUD() produced a non-NULL LU matrix");
     161        luImage32 = psMatrixLUDecomposition(luImage32, &perm32, inImage32);
     162        ok(luImage32 != NULL, "psMatrixLUDecomposition() produced a non-NULL LU matrix");
    163163        skip_start(luImage32 == NULL, 6, "Skipping tests because LU matrix was NULL");
    164         ok(!checkMatrix(luImage32), "psMatrixLUD() produced the correct LU matrix");
     164        ok(!checkMatrix(luImage32), "psMatrixLUDecomposition() produced the correct LU matrix");
    165165        ok(luImage32->type.dimen == PS_DIMEN_IMAGE, "The LU matrix has the correct ->dimen member");
    166166        ok(luImage32 == tempImage32, "The LU matrix was not created from scratch");
     
    168168        // Determine solution to matrix equation
    169169
    170         outVector32 = psMatrixLUSolve(outVector32, luImage32, inVector32, perm32);
    171         ok(!checkVector(outVector32), "psMatrixLUSolve() correctly solved the equations");
     170        outVector32 = psMatrixLUSolution(outVector32, luImage32, inVector32, perm32);
     171        ok(!checkVector(outVector32), "psMatrixLUSolution() correctly solved the equations");
    172172        ok(outVector32->type.dimen == PS_DIMEN_VECTOR, "The output vector hasthe correct ->dimen member");
    173173        ok(outVector32 == tempVector32, "The output vector was not created from scratch");
     
    182182    }
    183183
    184 
    185184    // Attempt to use null image input argument
    186185    // XXX: This test should generate an error or warning
    187186    // XXX: This seg-faults
    188     if (0) {
    189         psMemId id = psMemGetId();
    190         psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
    191         psMatrixLUD(imageTest, NULL, NULL);
    192         psFree(imageTest);
    193         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    194     }
    195 
     187    {
     188        psMemId id = psMemGetId();
     189        psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
     190        psMatrixLUDecomposition(imageTest, NULL, NULL);
     191        psFree(imageTest);
     192        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     193    }
    196194
    197195    // Attempt to use null input vector argument
    198196    // XXX: This test should generate an error or warning
    199197    // XXX: This seg-faulta
    200     if (0) {
    201         psMemId id = psMemGetId();
    202         psVector *vectorBad = NULL;
    203         psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    204         psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    205         psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
    206         psMatrixLUSolve(vectorBadOut, imageTest, vectorBad, permBad);
    207         psFree(vectorBadOut);
    208         psFree(permBad);
    209         psFree(imageTest);
    210         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    211     }
    212 
     198    {
     199        psMemId id = psMemGetId();
     200        psVector *vectorBad = NULL;
     201        psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     202        psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     203        psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
     204        psMatrixLUSolution(vectorBadOut, imageTest, vectorBad, permBad);
     205        psFree(vectorBadOut);
     206        psFree(permBad);
     207        psFree(imageTest);
     208        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     209    }
    213210
    214211    // Attempt to use null LU image argument
    215212    // XXX: This test should generate an error or warning, but we don't know how to test that.
    216213    // XXX: This seg-faulta
    217     if (0) {
    218         psMemId id = psMemGetId();
    219         psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    220         psVector *vectorBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    221         psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    222         psMatrixLUSolve(vectorBadOut, NULL, vectorBad, permBad);
    223         psFree(vectorBadOut);
    224         psFree(vectorBad);
    225         psFree(permBad);
    226         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     214    {
     215        psMemId id = psMemGetId();
     216        psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     217        psVector *vectorBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     218        psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     219        psMatrixLUSolution(vectorBadOut, NULL, vectorBad, permBad);
     220        psFree(vectorBadOut);
     221        psFree(vectorBad);
     222        psFree(permBad);
     223        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    227224    }
    228225}
Note: See TracChangeset for help on using the changeset viewer.