Changeset 9788 for trunk/ippdb/tests
- Timestamp:
- Oct 30, 2006, 11:55:36 AM (20 years ago)
- Location:
- trunk/ippdb/tests
- Files:
-
- 11 edited
-
alloc.c (modified) (4 diffs)
-
createtable.c (modified) (1 diff)
-
dbcleanup.c (modified) (1 diff)
-
dbsetup.c (modified) (1 diff)
-
droptable.c (modified) (1 diff)
-
insert.c (modified) (1 diff)
-
insertfits.c (modified) (1 diff)
-
insertobject.c (modified) (3 diffs)
-
metadatafromobject.c (modified) (4 diffs)
-
objectfrommetadata.c (modified) (4 diffs)
-
selectrowsfits.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/tests/alloc.c
r9783 r9788 650 650 p3PendingExpRow *object; 651 651 652 object = p3PendingExpRowAlloc("a string", -32, -32 );652 object = p3PendingExpRowAlloc("a string", -32, -32, "a string" ); 653 653 654 654 if (!object) { … … 668 668 exit(EXIT_FAILURE); 669 669 } 670 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 671 psFree(object); 672 exit(EXIT_FAILURE); 673 } 670 674 671 675 psFree(object); … … 675 679 p3ProcessedExpRow *object; 676 680 677 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32 );681 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string" ); 678 682 679 683 if (!object) { … … 738 742 } 739 743 if (!object->p3_version == -32) { 744 psFree(object); 745 exit(EXIT_FAILURE); 746 } 747 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 748 psFree(object); 749 exit(EXIT_FAILURE); 750 } 751 752 psFree(object); 753 } 754 755 { 756 p3MaskRow *object; 757 758 object = p3MaskRowAlloc("a string" ); 759 760 if (!object) { 761 exit(EXIT_FAILURE); 762 } 763 764 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 740 765 psFree(object); 741 766 exit(EXIT_FAILURE); -
trunk/ippdb/tests/createtable.c
r9783 r9788 253 253 } 254 254 255 if(!p3MaskCreateTable(dbh)) { 256 exit(EXIT_FAILURE); 257 } 258 259 psDBCleanup(dbh); 260 } 261 262 { 263 psDB *dbh; 264 265 dbh = psDBInit("localhost", "test", NULL, "test"); 266 if (!dbh) { 267 exit(EXIT_FAILURE); 268 } 269 255 270 if(!detRunCreateTable(dbh)) { 256 271 exit(EXIT_FAILURE); -
trunk/ippdb/tests/dbcleanup.c
r9783 r9788 27 27 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3PendingExp"); 28 28 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3ProcessedExp"); 29 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3Mask"); 29 30 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRun"); 30 31 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detInputExp"); -
trunk/ippdb/tests/dbsetup.c
r9783 r9788 61 61 p3ProcessedExpCreateTable(dbh); 62 62 63 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3Mask"); 64 p3MaskCreateTable(dbh); 65 63 66 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRun"); 64 67 detRunCreateTable(dbh); -
trunk/ippdb/tests/droptable.c
r9783 r9788 253 253 } 254 254 255 if (!p3MaskDropTable(dbh)) { 256 exit(EXIT_FAILURE); 257 } 258 259 psDBCleanup(dbh); 260 } 261 262 { 263 psDB *dbh; 264 265 dbh = psDBInit("localhost", "test", NULL, "test"); 266 if (!dbh) { 267 exit(EXIT_FAILURE); 268 } 269 255 270 if (!detRunDropTable(dbh)) { 256 271 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r9783 r9788 223 223 } 224 224 225 if (!p3PendingExpInsert(dbh, "a string", -32, -32)) { 226 exit(EXIT_FAILURE); 227 } 228 229 psDBCleanup(dbh); 230 } 231 232 { 233 psDB *dbh; 234 235 dbh = psDBInit("localhost", "test", NULL, "test"); 236 if (!dbh) { 237 exit(EXIT_FAILURE); 238 } 239 240 if (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32)) { 225 if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string")) { 226 exit(EXIT_FAILURE); 227 } 228 229 psDBCleanup(dbh); 230 } 231 232 { 233 psDB *dbh; 234 235 dbh = psDBInit("localhost", "test", NULL, "test"); 236 if (!dbh) { 237 exit(EXIT_FAILURE); 238 } 239 240 if (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string")) { 241 exit(EXIT_FAILURE); 242 } 243 244 psDBCleanup(dbh); 245 } 246 247 { 248 psDB *dbh; 249 250 dbh = psDBInit("localhost", "test", NULL, "test"); 251 if (!dbh) { 252 exit(EXIT_FAILURE); 253 } 254 255 if (!p3MaskInsert(dbh, "a string")) { 241 256 exit(EXIT_FAILURE); 242 257 } -
trunk/ippdb/tests/insertfits.c
r9783 r9788 440 440 } 441 441 442 if (!p3MaskInsertFits(dbh, fits)) { 443 exit(EXIT_FAILURE); 444 } 445 446 if (!psFitsClose(fits)) { 447 exit(EXIT_FAILURE); 448 } 449 450 psDBCleanup(dbh); 451 } 452 453 { 454 psDB *dbh; 455 psFits *fits; 456 457 dbh = psDBInit("localhost", "test", NULL, "test"); 458 if (!dbh) { 459 exit(EXIT_FAILURE); 460 } 461 462 // open a temp 463 fits = psFitsOpen(TMP_FILENAME, "r"); 464 if (!fits) { 465 exit(EXIT_FAILURE); 466 } 467 442 468 if (!detRunInsertFits(dbh, fits)) { 443 469 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insertobject.c
r9783 r9788 322 322 } 323 323 324 object = p3PendingExpRowAlloc("a string", -32, -32 );324 object = p3PendingExpRowAlloc("a string", -32, -32, "a string"); 325 325 if (!object) { 326 326 exit(EXIT_FAILURE); … … 344 344 } 345 345 346 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32 );346 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string"); 347 347 if (!object) { 348 348 exit(EXIT_FAILURE); … … 350 350 351 351 if (!p3ProcessedExpInsertObject(dbh, object)) { 352 exit(EXIT_FAILURE); 353 } 354 355 psFree(object); 356 psDBCleanup(dbh); 357 } 358 359 { 360 psDB *dbh; 361 p3MaskRow *object; 362 363 dbh = psDBInit("localhost", "test", NULL, "test"); 364 if (!dbh) { 365 exit(EXIT_FAILURE); 366 } 367 368 object = p3MaskRowAlloc("a string"); 369 if (!object) { 370 exit(EXIT_FAILURE); 371 } 372 373 if (!p3MaskInsertObject(dbh, object)) { 352 374 exit(EXIT_FAILURE); 353 375 } -
trunk/ippdb/tests/metadatafromobject.c
r9783 r9788 764 764 bool status; 765 765 766 object = p3PendingExpRowAlloc("a string", -32, -32 );766 object = p3PendingExpRowAlloc("a string", -32, -32, "a string"); 767 767 if (!object) { 768 768 exit(EXIT_FAILURE); … … 788 788 exit(EXIT_FAILURE); 789 789 } 790 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 791 psFree(md); 792 exit(EXIT_FAILURE); 793 } 790 794 791 795 psFree(md); … … 797 801 bool status; 798 802 799 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32 );803 object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string"); 800 804 if (!object) { 801 805 exit(EXIT_FAILURE); … … 866 870 } 867 871 if (!psMetadataLookupS32(&status, md, "p3_version") == -32) { 872 psFree(md); 873 exit(EXIT_FAILURE); 874 } 875 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 876 psFree(md); 877 exit(EXIT_FAILURE); 878 } 879 880 psFree(md); 881 } 882 883 { 884 psMetadata *md; 885 p3MaskRow *object; 886 bool status; 887 888 object = p3MaskRowAlloc("a string"); 889 if (!object) { 890 exit(EXIT_FAILURE); 891 } 892 893 md = p3MaskMetadataFromObject(object); 894 if (!md) { 895 exit(EXIT_FAILURE); 896 } 897 898 psFree(object); 899 900 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 868 901 psFree(md); 869 902 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r9783 r9788 1191 1191 exit(EXIT_FAILURE); 1192 1192 } 1193 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 1194 psFree(md); 1195 exit(EXIT_FAILURE); 1196 } 1193 1197 1194 1198 object = p3PendingExpObjectFromMetadata(md); … … 1212 1216 exit(EXIT_FAILURE); 1213 1217 } 1218 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1219 psFree(object); 1220 exit(EXIT_FAILURE); 1221 } 1214 1222 1215 1223 psFree(object); … … 1281 1289 exit(EXIT_FAILURE); 1282 1290 } 1291 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 1292 psFree(md); 1293 exit(EXIT_FAILURE); 1294 } 1283 1295 1284 1296 object = p3ProcessedExpObjectFromMetadata(md); … … 1347 1359 } 1348 1360 if (!object->p3_version == -32) { 1361 psFree(object); 1362 exit(EXIT_FAILURE); 1363 } 1364 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1365 psFree(object); 1366 exit(EXIT_FAILURE); 1367 } 1368 1369 psFree(object); 1370 } 1371 1372 { 1373 psMetadata *md; 1374 p3MaskRow *object; 1375 1376 md = psMetadataAlloc(); 1377 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 1378 psFree(md); 1379 exit(EXIT_FAILURE); 1380 } 1381 1382 object = p3MaskObjectFromMetadata(md); 1383 if (!object) { 1384 psFree(md); 1385 exit(EXIT_FAILURE); 1386 } 1387 1388 psFree(md); 1389 1390 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1349 1391 psFree(object); 1350 1392 exit(EXIT_FAILURE); -
trunk/ippdb/tests/selectrowsfits.c
r9783 r9788 373 373 } 374 374 375 if (!p3MaskSelectRowsFits(dbh, fits, NULL, 1)) { 376 exit(EXIT_FAILURE); 377 } 378 379 psFree(fits); 380 psDBCleanup(dbh); 381 } 382 383 { 384 psDB *dbh; 385 psFits *fits; 386 387 dbh = psDBInit("localhost", "test", NULL, "test"); 388 if (!dbh) { 389 exit(EXIT_FAILURE); 390 } 391 392 fits = psFitsOpen(TMP_FILENAME, "w"); 393 if (!fits) { 394 exit(EXIT_FAILURE); 395 } 396 375 397 if (!detRunSelectRowsFits(dbh, fits, NULL, 1)) { 376 398 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
