IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12353


Ignore:
Timestamp:
Mar 8, 2007, 3:37:55 PM (19 years ago)
Author:
jhoblitt
Message:

fix segfault
don't call ok() from inside a loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/db/tap_psDB.c

    r12351 r12353  
    66 *  @author Joshua Hoblitt, University of Hawaii
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-09 01:32:21 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-03-09 01:37:55 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    241241            psU64 rowsAffected = psDBUpdateRows(dbh, "horse", where, value);
    242242            psFree(where);
     243
     244            ok(rowsAffected, "psDBUpdateRows() - pink -> HOT pink");
     245
     246            psArray *resultSet = psDBSelectRows(dbh, "horse", value, 0);
    243247            psFree(value);
    244 
    245             ok(rowsAffected, "psDBUpdateRows() - pink -> HOT pink");
    246 
    247             psArray *resultSet = psDBSelectRows(dbh, "horse", value, 0);
    248248
    249249            for (long i = 0; i < resultSet->n; i++) {
     
    253253
    254254                psMetadataItem  *item;
     255                bool test_ok = true;
    255256                while ((item = psListGetAndIncrement(cursor))) {
    256257                    if (strcmp((char *)item->data.V, "HOT pink") == 0) {
    257                         ok(1, "psDBUpdateRows() - psDBSelectRows() found HOT pink");
    258258                        printf("\thorse color is: %s\n", (char *)item->data.V);
     259                    } else {
     260                        test_ok = false;
    259261                    }
    260262                }
     263                ok(test_ok, "psDBUpdateRows() - psDBSelectRows() found HOT pink");
    261264
    262265                psFree(cursor);
Note: See TracChangeset for help on using the changeset viewer.