Changeset 4263
- Timestamp:
- Jun 14, 2005, 3:48:25 PM (21 years ago)
- Location:
- trunk/psLib/test/dataIO
- Files:
-
- 2 edited
-
tst_psDB.c (modified) (3 diffs)
-
verified/tst_psDB.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataIO/tst_psDB.c
r4257 r4263 9 9 * @author Aaron Culliney, MHPCC 10 10 * 11 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06-15 01: 02:08$11 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-15 01:48:25 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 70 70 71 71 testDescription tests[] = { 72 {TPDBInit, -1, "dbInit", 0, false},73 {TPDBChange, -2, "dbChange", 0, false},72 {TPDBInit, 841, "dbInit", 0, false}, 73 {TPDBChange, 842, "dbChange", 0, false}, 74 74 {TPDBCreateTable, -3, "dbCreateTable", 0, false}, 75 75 {TPDBDropTable, -4, "dbDropTable", 0, false}, … … 317 317 } 318 318 319 // Testpoint # XXX, psDBChange shall change databases.319 // Testpoint #842, psDBChange shall change databases. 320 320 psS32 TPDBChange( void ) 321 321 { 322 psS32 failed = 0; 323 psDB *dbh = NULL; 324 325 dbh = _init_psDB(); 326 if (dbh == NULL) { 327 return 1; 328 } 329 330 psLogMsg( __func__, PS_LOG_INFO, "psDBChange shall change to a new test database.\n" ); 331 332 failed = ! psDBChange(dbh, dbname); 333 334 psDBCleanup(dbh); 335 336 return failed; 322 psDB *dbh = NULL; 323 324 // Initialize database connection 325 dbh = _init_psDB(); 326 if (dbh == NULL) { 327 psError(PS_ERR_UNKNOWN,true,"Did not expect NULL for valid arguments"); 328 return 1; 329 } 330 331 // Attempt to change database with valid arguments 332 if(!psDBChange(dbh, dbname)) { 333 psError(PS_ERR_UNKNOWN,true,"Did not expect return false for valid arguments"); 334 return 2; 335 } 336 337 // Attemp to change database to invalid database name 338 if(psDBChange(dbh,"abc")) { 339 psError(PS_ERR_UNKNOWN,true,"Did not expect return true for unknown database name"); 340 return 3; 341 } 342 343 // Cleanup database connection 344 psDBCleanup(dbh); 345 346 // Attempt to change database with NULL database object 347 if(psDBChange(NULL,dbname)) { 348 psError(PS_ERR_UNKNOWN,true,"Did not expect return true for NULL database object"); 349 return 4; 350 } 351 352 return 0; 337 353 } 338 354 -
trunk/psLib/test/dataIO/verified/tst_psDB.stderr
r4257 r4263 18 18 \**********************************************************************************/ 19 19 20 <DATE><TIME>|<HOST>|I|TPDBChange 21 psDBChange shall change to a new test database. 20 <DATE><TIME>|<HOST>|E|psDBChange (FILE:LINENO) 21 Failed to change database. Error: Access denied for user ''@'localhost' to database 'abc' 22 <DATE><TIME>|<HOST>|E|psDBChange (FILE:LINENO) 23 Invalid psDB has been specified. 22 24 23 25 ---> TESTPOINT PASSED (psDB{dbChange} | tst_psDB.c)
Note:
See TracChangeset
for help on using the changeset viewer.
