IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4295


Ignore:
Timestamp:
Jun 16, 2005, 4:56:26 PM (21 years ago)
Author:
evanalst
Message:

Update test case for psDBSelectRows with null where argument.

Location:
trunk/psLib/test/dataIO
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataIO/tst_psDB.c

    r4294 r4295  
    99 *  @author Aaron Culliney, MHPCC
    1010 *
    11  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-17 02:16:53 $
     11 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-06-17 02:56:26 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    849849    }
    850850
     851    psDBDropTable(dbh,table);
    851852    // Create database table for test
    852853    if(!psDBCreateTable(dbh, table, md)) {
     
    889890            psDBCleanup(dbh);
    890891            return 1;
     892        }
     893
     894        if(ary->n != 1) {
     895            psError(PS_ERR_UNKNOWN,true,"Number of rows %d not as expected %d",
     896                    ary->n, 1);
     897            psDBDropTable(dbh,table);
     898            psDBCleanup(dbh);
     899            return 2;
    891900        }
    892901
     
    946955    }
    947956
     957    // Select rows with no where specified
     958    ary1 = psDBSelectRows(dbh, table, NULL, 0);
     959    if(ary1 == NULL) {
     960        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return using NULL where");
     961        psDBDropTable(dbh,table);
     962        psDBCleanup(dbh);
     963        return 6;
     964    }
     965    if(ary1->n != 3) {
     966        psError(PS_ERR_UNKNOWN,true,"Rows return %d not as expected %d",
     967                ary->n,3);
     968        psDBDropTable(dbh,table);
     969        psDBCleanup(dbh);
     970        return 7;
     971    }
     972    psFree(ary1);
    948973
    949974    psDBDropTable(dbh, table);
    950 
    951975    psFree(md);
    952976    psDBCleanup(dbh);
  • trunk/psLib/test/dataIO/verified/tst_psDB.stderr

    r4294 r4295  
    155155\**********************************************************************************/
    156156
     157<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
     158    Failed to execute SQL query.  Error: Unknown table 'table5'
     159<DATE><TIME>|<HOST>|E|psDBDropTable (FILE:LINENO)
     160    Failed to drop table.
    157161<DATE><TIME>|<HOST>|I|TPDBSelectRows
    158162    Following should generate an error message for NULL database object
Note: See TracChangeset for help on using the changeset viewer.