Changeset 9783 for trunk/ippdb/tests
- Timestamp:
- Oct 30, 2006, 11:25:59 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) (2 diffs)
-
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
r9705 r9783 477 477 p2PendingExpRow *object; 478 478 479 object = p2PendingExpRowAlloc("a string", "a string", -32, -32 );479 object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string" ); 480 480 481 481 if (!object) { … … 499 499 exit(EXIT_FAILURE); 500 500 } 501 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 502 psFree(object); 503 exit(EXIT_FAILURE); 504 } 501 505 502 506 psFree(object); … … 543 547 p2ProcessedExpRow *object; 544 548 545 object = p2ProcessedExpRowAlloc("a string", -32, -32 );549 object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string" ); 546 550 547 551 if (!object) { … … 558 562 } 559 563 if (!object->p2_version == -32) { 564 psFree(object); 565 exit(EXIT_FAILURE); 566 } 567 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 568 psFree(object); 569 exit(EXIT_FAILURE); 570 } 571 572 psFree(object); 573 } 574 575 { 576 p2MaskRow *object; 577 578 object = p2MaskRowAlloc("a string" ); 579 580 if (!object) { 581 exit(EXIT_FAILURE); 582 } 583 584 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 560 585 psFree(object); 561 586 exit(EXIT_FAILURE); -
trunk/ippdb/tests/createtable.c
r9684 r9783 193 193 } 194 194 195 if(!p2MaskCreateTable(dbh)) { 196 exit(EXIT_FAILURE); 197 } 198 199 psDBCleanup(dbh); 200 } 201 202 { 203 psDB *dbh; 204 205 dbh = psDBInit("localhost", "test", NULL, "test"); 206 if (!dbh) { 207 exit(EXIT_FAILURE); 208 } 209 195 210 if(!p2ProcessedImfileCreateTable(dbh)) { 196 211 exit(EXIT_FAILURE); -
trunk/ippdb/tests/dbcleanup.c
r9684 r9783 23 23 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2PendingImfile"); 24 24 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp"); 25 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask"); 25 26 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile"); 26 27 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3PendingExp"); -
trunk/ippdb/tests/dbsetup.c
r9684 r9783 48 48 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp"); 49 49 p2ProcessedExpCreateTable(dbh); 50 51 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask"); 52 p2MaskCreateTable(dbh); 50 53 51 54 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile"); -
trunk/ippdb/tests/droptable.c
r9684 r9783 193 193 } 194 194 195 if (!p2MaskDropTable(dbh)) { 196 exit(EXIT_FAILURE); 197 } 198 199 psDBCleanup(dbh); 200 } 201 202 { 203 psDB *dbh; 204 205 dbh = psDBInit("localhost", "test", NULL, "test"); 206 if (!dbh) { 207 exit(EXIT_FAILURE); 208 } 209 195 210 if (!p2ProcessedImfileDropTable(dbh)) { 196 211 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r9705 r9783 148 148 } 149 149 150 if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32 )) {150 if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) { 151 151 exit(EXIT_FAILURE); 152 152 } … … 178 178 } 179 179 180 if (!p2ProcessedExpInsert(dbh, "a string", -32, -32)) { 180 if (!p2ProcessedExpInsert(dbh, "a string", -32, -32, "a string")) { 181 exit(EXIT_FAILURE); 182 } 183 184 psDBCleanup(dbh); 185 } 186 187 { 188 psDB *dbh; 189 190 dbh = psDBInit("localhost", "test", NULL, "test"); 191 if (!dbh) { 192 exit(EXIT_FAILURE); 193 } 194 195 if (!p2MaskInsert(dbh, "a string")) { 181 196 exit(EXIT_FAILURE); 182 197 } -
trunk/ippdb/tests/insertfits.c
r9684 r9783 336 336 } 337 337 338 if (!p2MaskInsertFits(dbh, fits)) { 339 exit(EXIT_FAILURE); 340 } 341 342 if (!psFitsClose(fits)) { 343 exit(EXIT_FAILURE); 344 } 345 346 psDBCleanup(dbh); 347 } 348 349 { 350 psDB *dbh; 351 psFits *fits; 352 353 dbh = psDBInit("localhost", "test", NULL, "test"); 354 if (!dbh) { 355 exit(EXIT_FAILURE); 356 } 357 358 // open a temp 359 fits = psFitsOpen(TMP_FILENAME, "r"); 360 if (!fits) { 361 exit(EXIT_FAILURE); 362 } 363 338 364 if (!p2ProcessedImfileInsertFits(dbh, fits)) { 339 365 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insertobject.c
r9705 r9783 212 212 } 213 213 214 object = p2PendingExpRowAlloc("a string", "a string", -32, -32 );214 object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"); 215 215 if (!object) { 216 216 exit(EXIT_FAILURE); … … 256 256 } 257 257 258 object = p2ProcessedExpRowAlloc("a string", -32, -32 );258 object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string"); 259 259 if (!object) { 260 260 exit(EXIT_FAILURE); … … 262 262 263 263 if (!p2ProcessedExpInsertObject(dbh, object)) { 264 exit(EXIT_FAILURE); 265 } 266 267 psFree(object); 268 psDBCleanup(dbh); 269 } 270 271 { 272 psDB *dbh; 273 p2MaskRow *object; 274 275 dbh = psDBInit("localhost", "test", NULL, "test"); 276 if (!dbh) { 277 exit(EXIT_FAILURE); 278 } 279 280 object = p2MaskRowAlloc("a string"); 281 if (!object) { 282 exit(EXIT_FAILURE); 283 } 284 285 if (!p2MaskInsertObject(dbh, object)) { 264 286 exit(EXIT_FAILURE); 265 287 } -
trunk/ippdb/tests/metadatafromobject.c
r9705 r9783 551 551 bool status; 552 552 553 object = p2PendingExpRowAlloc("a string", "a string", -32, -32 );553 object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"); 554 554 if (!object) { 555 555 exit(EXIT_FAILURE); … … 579 579 exit(EXIT_FAILURE); 580 580 } 581 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 582 psFree(md); 583 exit(EXIT_FAILURE); 584 } 581 585 582 586 psFree(md); … … 633 637 bool status; 634 638 635 object = p2ProcessedExpRowAlloc("a string", -32, -32 );639 object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string"); 636 640 if (!object) { 637 641 exit(EXIT_FAILURE); … … 654 658 } 655 659 if (!psMetadataLookupS32(&status, md, "p2_version") == -32) { 660 psFree(md); 661 exit(EXIT_FAILURE); 662 } 663 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 664 psFree(md); 665 exit(EXIT_FAILURE); 666 } 667 668 psFree(md); 669 } 670 671 { 672 psMetadata *md; 673 p2MaskRow *object; 674 bool status; 675 676 object = p2MaskRowAlloc("a string"); 677 if (!object) { 678 exit(EXIT_FAILURE); 679 } 680 681 md = p2MaskMetadataFromObject(object); 682 if (!md) { 683 exit(EXIT_FAILURE); 684 } 685 686 psFree(object); 687 688 if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) { 656 689 psFree(md); 657 690 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r9705 r9783 889 889 exit(EXIT_FAILURE); 890 890 } 891 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 892 psFree(md); 893 exit(EXIT_FAILURE); 894 } 891 895 892 896 object = p2PendingExpObjectFromMetadata(md); … … 914 918 exit(EXIT_FAILURE); 915 919 } 920 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 921 psFree(object); 922 exit(EXIT_FAILURE); 923 } 916 924 917 925 psFree(object); … … 1001 1009 exit(EXIT_FAILURE); 1002 1010 } 1011 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 1012 psFree(md); 1013 exit(EXIT_FAILURE); 1014 } 1003 1015 1004 1016 object = p2ProcessedExpObjectFromMetadata(md); … … 1019 1031 } 1020 1032 if (!object->p2_version == -32) { 1033 psFree(object); 1034 exit(EXIT_FAILURE); 1035 } 1036 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1037 psFree(object); 1038 exit(EXIT_FAILURE); 1039 } 1040 1041 psFree(object); 1042 } 1043 1044 { 1045 psMetadata *md; 1046 p2MaskRow *object; 1047 1048 md = psMetadataAlloc(); 1049 if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) { 1050 psFree(md); 1051 exit(EXIT_FAILURE); 1052 } 1053 1054 object = p2MaskObjectFromMetadata(md); 1055 if (!object) { 1056 psFree(md); 1057 exit(EXIT_FAILURE); 1058 } 1059 1060 psFree(md); 1061 1062 if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) { 1021 1063 psFree(object); 1022 1064 exit(EXIT_FAILURE); -
trunk/ippdb/tests/selectrowsfits.c
r9684 r9783 285 285 } 286 286 287 if (!p2MaskSelectRowsFits(dbh, fits, NULL, 1)) { 288 exit(EXIT_FAILURE); 289 } 290 291 psFree(fits); 292 psDBCleanup(dbh); 293 } 294 295 { 296 psDB *dbh; 297 psFits *fits; 298 299 dbh = psDBInit("localhost", "test", NULL, "test"); 300 if (!dbh) { 301 exit(EXIT_FAILURE); 302 } 303 304 fits = psFitsOpen(TMP_FILENAME, "w"); 305 if (!fits) { 306 exit(EXIT_FAILURE); 307 } 308 287 309 if (!p2ProcessedImfileSelectRowsFits(dbh, fits, NULL, 1)) { 288 310 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
