Changeset 10110 for trunk/ippdb/tests
- Timestamp:
- Nov 20, 2006, 1:58:03 PM (20 years ago)
- Location:
- trunk/ippdb/tests
- Files:
-
- 11 edited
-
alloc.c (modified) (2 diffs)
-
createtable.c (modified) (1 diff)
-
dbcleanup.c (modified) (1 diff)
-
dbsetup.c (modified) (1 diff)
-
droptable.c (modified) (1 diff)
-
insert.c (modified) (2 diffs)
-
insertfits.c (modified) (1 diff)
-
insertobject.c (modified) (2 diffs)
-
metadatafromobject.c (modified) (3 diffs)
-
objectfrommetadata.c (modified) (3 diffs)
-
selectrowsfits.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/tests/alloc.c
r10060 r10110 9 9 { 10 10 { 11 expTagCounterRow *object; 12 13 object = expTagCounterRowAlloc(64 ); 14 15 if (!object) { 16 exit(EXIT_FAILURE); 17 } 18 19 psFree(object); 20 exit(EXIT_FAILURE); 21 } 22 23 psFree(object); 24 } 25 26 { 11 27 summitExpRow *object; 12 28 … … 224 240 newExpRow *object; 225 241 226 object = newExpRowAlloc(64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32 ); 227 228 if (!object) { 229 exit(EXIT_FAILURE); 230 } 231 242 object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32 ); 243 244 if (!object) { 245 exit(EXIT_FAILURE); 246 } 247 248 if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) { 232 249 psFree(object); 233 250 exit(EXIT_FAILURE); -
trunk/ippdb/tests/createtable.c
r10060 r10110 13 13 } 14 14 15 if(!expTagCounterCreateTable(dbh)) { 16 exit(EXIT_FAILURE); 17 } 18 19 psDBCleanup(dbh); 20 } 21 22 { 23 psDB *dbh; 24 25 dbh = psDBInit("localhost", "test", NULL, "test"); 26 if (!dbh) { 27 exit(EXIT_FAILURE); 28 } 29 15 30 if(!summitExpCreateTable(dbh)) { 16 31 exit(EXIT_FAILURE); -
trunk/ippdb/tests/dbcleanup.c
r10060 r10110 11 11 } 12 12 13 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS expTagCounter"); 13 14 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitExp"); 14 15 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitImfile"); -
trunk/ippdb/tests/dbsetup.c
r10060 r10110 13 13 14 14 // remove the table if it already exists 15 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS expTagCounter"); 16 expTagCounterCreateTable(dbh); 17 15 18 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitExp"); 16 19 summitExpCreateTable(dbh); -
trunk/ippdb/tests/droptable.c
r10060 r10110 13 13 } 14 14 15 if (!expTagCounterDropTable(dbh)) { 16 exit(EXIT_FAILURE); 17 } 18 19 psDBCleanup(dbh); 20 } 21 22 { 23 psDB *dbh; 24 25 dbh = psDBInit("localhost", "test", NULL, "test"); 26 if (!dbh) { 27 exit(EXIT_FAILURE); 28 } 29 15 30 if (!summitExpDropTable(dbh)) { 16 31 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r10060 r10110 13 13 } 14 14 15 if (!expTagCounterInsert(dbh, 64)) { 16 exit(EXIT_FAILURE); 17 } 18 19 psDBCleanup(dbh); 20 } 21 22 { 23 psDB *dbh; 24 25 dbh = psDBInit("localhost", "test", NULL, "test"); 26 if (!dbh) { 27 exit(EXIT_FAILURE); 28 } 29 15 30 if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32)) { 16 31 exit(EXIT_FAILURE); … … 103 118 } 104 119 105 if (!newExpInsert(dbh, 64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32)) {120 if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32)) { 106 121 exit(EXIT_FAILURE); 107 122 } -
trunk/ippdb/tests/insertfits.c
r10060 r10110 24 24 } 25 25 26 if (!expTagCounterInsertFits(dbh, fits)) { 27 exit(EXIT_FAILURE); 28 } 29 30 if (!psFitsClose(fits)) { 31 exit(EXIT_FAILURE); 32 } 33 34 psDBCleanup(dbh); 35 } 36 37 { 38 psDB *dbh; 39 psFits *fits; 40 41 dbh = psDBInit("localhost", "test", NULL, "test"); 42 if (!dbh) { 43 exit(EXIT_FAILURE); 44 } 45 46 // open a temp 47 fits = psFitsOpen(TMP_FILENAME, "r"); 48 if (!fits) { 49 exit(EXIT_FAILURE); 50 } 51 26 52 if (!summitExpInsertFits(dbh, fits)) { 27 53 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insertobject.c
r10060 r10110 7 7 { 8 8 psDB *dbh; 9 expTagCounterRow *object; 10 11 dbh = psDBInit("localhost", "test", NULL, "test"); 12 if (!dbh) { 13 exit(EXIT_FAILURE); 14 } 15 16 object = expTagCounterRowAlloc(64); 17 if (!object) { 18 exit(EXIT_FAILURE); 19 } 20 21 if (!expTagCounterInsertObject(dbh, object)) { 22 exit(EXIT_FAILURE); 23 } 24 25 psFree(object); 26 psDBCleanup(dbh); 27 } 28 29 { 30 psDB *dbh; 9 31 summitExpRow *object; 10 32 … … 146 168 } 147 169 148 object = newExpRowAlloc( 64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);170 object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32); 149 171 if (!object) { 150 172 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r10060 r10110 10 10 { 11 11 psMetadata *md; 12 expTagCounterRow *object; 13 bool status; 14 15 object = expTagCounterRowAlloc(64); 16 if (!object) { 17 exit(EXIT_FAILURE); 18 } 19 20 md = expTagCounterMetadataFromObject(object); 21 if (!md) { 22 exit(EXIT_FAILURE); 23 } 24 25 psFree(object); 26 27 psFree(md); 28 exit(EXIT_FAILURE); 29 } 30 31 psFree(md); 32 } 33 34 { 35 psMetadata *md; 12 36 summitExpRow *object; 13 37 bool status; … … 274 298 bool status; 275 299 276 object = newExpRowAlloc( 64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);300 object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32); 277 301 if (!object) { 278 302 exit(EXIT_FAILURE); … … 286 310 psFree(object); 287 311 312 if (strncmp(psMetadataLookupPtr(&status, md, "exp_tag"), "a string", MAX_STRING_LENGTH)) { 288 313 psFree(md); 289 314 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r10060 r10110 10 10 { 11 11 psMetadata *md; 12 expTagCounterRow *object; 13 14 md = psMetadataAlloc(); 15 psFree(md); 16 exit(EXIT_FAILURE); 17 } 18 19 object = expTagCounterObjectFromMetadata(md); 20 if (!object) { 21 psFree(md); 22 exit(EXIT_FAILURE); 23 } 24 25 psFree(md); 26 27 psFree(object); 28 exit(EXIT_FAILURE); 29 } 30 31 psFree(object); 32 } 33 34 { 35 psMetadata *md; 12 36 summitExpRow *object; 13 37 … … 391 415 392 416 md = psMetadataAlloc(); 417 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_tag", 0, NULL, "a string")) { 393 418 psFree(md); 394 419 exit(EXIT_FAILURE); … … 426 451 psFree(md); 427 452 453 if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) { 428 454 psFree(object); 429 455 exit(EXIT_FAILURE); -
trunk/ippdb/tests/selectrowsfits.c
r10060 r10110 21 21 } 22 22 23 if (!expTagCounterSelectRowsFits(dbh, fits, NULL, 1)) { 24 exit(EXIT_FAILURE); 25 } 26 27 psFree(fits); 28 psDBCleanup(dbh); 29 } 30 31 { 32 psDB *dbh; 33 psFits *fits; 34 35 dbh = psDBInit("localhost", "test", NULL, "test"); 36 if (!dbh) { 37 exit(EXIT_FAILURE); 38 } 39 40 fits = psFitsOpen(TMP_FILENAME, "w"); 41 if (!fits) { 42 exit(EXIT_FAILURE); 43 } 44 23 45 if (!summitExpSelectRowsFits(dbh, fits, NULL, 1)) { 24 46 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
