Changeset 4257
- Timestamp:
- Jun 14, 2005, 3:02:08 PM (21 years ago)
- Location:
- trunk/psLib/test/dataIO
- Files:
-
- 2 edited
-
tst_psDB.c (modified) (3 diffs)
-
verified/tst_psDB.stderr (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataIO/tst_psDB.c
r4105 r4257 9 9 * @author Aaron Culliney, MHPCC 10 10 * 11 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06- 03 23:46:07$11 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-15 01:02:08 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 98 98 psDB *dbh = NULL; 99 99 100 psLogMsg( __func__, PS_LOG_INFO, "initialize database connection...\n" ); 101 100 // Initialize database connection with test database 102 101 dbh = psDBInit(host, user, passwd, dbname); 103 102 if (dbh == NULL) { … … 290 289 } 291 290 292 // Testpoint # XXX, initialize/break-down MySQL connection.291 // Testpoint #841, initialize/break-down MySQL connection. 293 292 psS32 TPDBInit( void ) 294 293 { 295 psS32 failed = 0; 296 psDB *dbh = NULL; 297 298 psLogMsg( __func__, PS_LOG_INFO, "psDBInit/psDBCleanup shall initialize/cleanup database connection.\n" ); 299 300 dbh = _init_psDB(); 301 if (dbh == NULL) { 302 return 1; 303 } 304 305 psDBCleanup(dbh); 306 307 return failed; 294 psDB *dbh = NULL; 295 296 // Initialize database with valid arguments 297 dbh = _init_psDB(); 298 if (dbh == NULL) { 299 psError(PS_ERR_UNKNOWN,true,"Did not expect NULL to be returned for valid arguments"); 300 return 1; 301 } 302 303 // Cleanup database/connection with valid psDB object 304 psDBCleanup(dbh); 305 306 // Attempt to initialize database with invalid arguments 307 dbh = psDBInit("xxx",NULL,NULL,NULL); 308 if(dbh != NULL) { 309 psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL psDB with invalid arguments"); 310 return 2; 311 } 312 313 // Attempt cleanup database/connection with NULL psDB object 314 psDBCleanup(NULL); 315 316 return 0; 308 317 } 309 318 -
trunk/psLib/test/dataIO/verified/tst_psDB.stderr
r4128 r4257 5 5 \**********************************************************************************/ 6 6 7 <DATE><TIME>|<HOST>| I|TPDBInit8 psDBInit/psDBCleanup shall initialize/cleanup database connection.9 <DATE><TIME>|<HOST>| I|_init_psDB10 initialize database connection...7 <DATE><TIME>|<HOST>|E|psDBInit (FILE:LINENO) 8 Failed to connect to database. Error: Unknown MySQL server host 'xxx' (1) 9 <DATE><TIME>|<HOST>|E|psDBCleanup (FILE:LINENO) 10 Invalid psDB has been specified. 11 11 12 12 ---> TESTPOINT PASSED (psDB{dbInit} | tst_psDB.c) … … 18 18 \**********************************************************************************/ 19 19 20 <DATE><TIME>|<HOST>|I|_init_psDB21 initialize database connection...22 20 <DATE><TIME>|<HOST>|I|TPDBChange 23 21 psDBChange shall change to a new test database. … … 31 29 \**********************************************************************************/ 32 30 33 <DATE><TIME>|<HOST>|I|_init_psDB34 initialize database connection...35 31 <DATE><TIME>|<HOST>|I|TPDBCreateTable 36 32 psDBCreateTable shall create a new table in the new test database. … … 44 40 \**********************************************************************************/ 45 41 46 <DATE><TIME>|<HOST>|I|_init_psDB47 initialize database connection...48 42 <DATE><TIME>|<HOST>|I|TPDBDropTable 49 43 psDBDropTable shall create/drop a new table in the new test database. … … 63 57 \**********************************************************************************/ 64 58 65 <DATE><TIME>|<HOST>|I|_init_psDB66 initialize database connection...67 59 <DATE><TIME>|<HOST>|I|TPDBSelectColumn 68 60 psDBSelectColumn shall select data from a test table. … … 92 84 \**********************************************************************************/ 93 85 94 <DATE><TIME>|<HOST>|I|_init_psDB95 initialize database connection...96 86 <DATE><TIME>|<HOST>|I|TPDBSelectColumnNum 97 87 psDBSelectColumnNum shall select data from a test table. … … 121 111 \**********************************************************************************/ 122 112 123 <DATE><TIME>|<HOST>|I|_init_psDB124 initialize database connection...125 113 <DATE><TIME>|<HOST>|I|TPDBSelectRows 126 114 psDBSelectRows shall select data from a test table. … … 166 154 \**********************************************************************************/ 167 155 168 <DATE><TIME>|<HOST>|I|_init_psDB169 initialize database connection...170 156 <DATE><TIME>|<HOST>|I|TPDBInsertOneRow 171 157 psDBInsertOneRow shall insert a row into a test table. … … 179 165 \**********************************************************************************/ 180 166 181 <DATE><TIME>|<HOST>|I|_init_psDB182 initialize database connection...183 167 <DATE><TIME>|<HOST>|I|TPDBInsertRows 184 168 psDBInsertRows shall insert rows into a test table. … … 232 216 \**********************************************************************************/ 233 217 234 <DATE><TIME>|<HOST>|I|_init_psDB235 initialize database connection...236 218 <DATE><TIME>|<HOST>|I|TPDBDumpRows 237 219 psDBDumpRows shall dump all rows from a test table. … … 285 267 \**********************************************************************************/ 286 268 287 <DATE><TIME>|<HOST>|I|_init_psDB288 initialize database connection...289 269 <DATE><TIME>|<HOST>|I|TPDBDumpCols 290 270 psDBDumpCols shall dump all cols from a test table. 291 271 <DATE><TIME>|<HOST>|I|_print_row 292 [key_string]=[ ]272 [key_string]=[] 293 273 294 274 ---> TESTPOINT PASSED (psDB{dbDumpCols} | tst_psDB.c) … … 300 280 \**********************************************************************************/ 301 281 302 <DATE><TIME>|<HOST>|I|_init_psDB303 initialize database connection...304 282 <DATE><TIME>|<HOST>|I|TPDBUpdateRows 305 283 psDBUpdateRows shall update rows in a test table. … … 329 307 \**********************************************************************************/ 330 308 331 <DATE><TIME>|<HOST>|I|_init_psDB332 initialize database connection...333 309 <DATE><TIME>|<HOST>|I|TPDBDeleteRows 334 310 psDBDeleteRows shall delete rows from a test table.
Note:
See TracChangeset
for help on using the changeset viewer.
