Changeset 8368 for trunk/ippdb/tests
- Timestamp:
- Aug 15, 2006, 4:31:35 PM (20 years ago)
- Location:
- trunk/ippdb/tests
- Files:
-
- 14 edited
-
alloc.c (modified) (1 diff)
-
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) (1 diff)
-
metadatafromobject.c (modified) (1 diff)
-
objectfrommetadata.c (modified) (1 diff)
-
pop.c (modified) (1 diff)
-
popfits.c (modified) (1 diff)
-
popobject.c (modified) (1 diff)
-
selectrowsfits.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/tests/alloc.c
r8325 r8368 1042 1042 1043 1043 { 1044 detNormalizedStatImfileRow *object; 1045 1046 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32 ); 1047 1048 if (!object) { 1049 exit(EXIT_FAILURE); 1050 } 1051 1052 if (!object->det_id == -32) { 1053 psFree(object); 1054 exit(EXIT_FAILURE); 1055 } 1056 if (!object->iteration == -32) { 1057 psFree(object); 1058 exit(EXIT_FAILURE); 1059 } 1060 if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) { 1061 psFree(object); 1062 exit(EXIT_FAILURE); 1063 } 1064 if (!object->norm == 32.32) { 1065 psFree(object); 1066 exit(EXIT_FAILURE); 1067 } 1068 1069 psFree(object); 1070 } 1071 1072 { 1044 1073 detNormalizedImfileRow *object; 1045 1074 -
trunk/ippdb/tests/createtable.c
r7461 r8368 403 403 } 404 404 405 if(!detNormalizedStatImfileCreateTable(dbh)) { 406 exit(EXIT_FAILURE); 407 } 408 409 psDBCleanup(dbh); 410 } 411 412 { 413 psDB *dbh; 414 415 dbh = psDBInit("localhost", "test", NULL, "test"); 416 if (!dbh) { 417 exit(EXIT_FAILURE); 418 } 419 405 420 if(!detNormalizedImfileCreateTable(dbh)) { 406 421 exit(EXIT_FAILURE); -
trunk/ippdb/tests/dbcleanup.c
r7461 r8368 37 37 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detProcessedImfile"); 38 38 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detStackedImfile"); 39 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedStatImfile"); 39 40 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedImfile"); 40 41 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detMasterFrame"); -
trunk/ippdb/tests/dbsetup.c
r7461 r8368 91 91 detStackedImfileCreateTable(dbh); 92 92 93 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedStatImfile"); 94 detNormalizedStatImfileCreateTable(dbh); 95 93 96 p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedImfile"); 94 97 detNormalizedImfileCreateTable(dbh); -
trunk/ippdb/tests/droptable.c
r7461 r8368 403 403 } 404 404 405 if (!detNormalizedStatImfileDropTable(dbh)) { 406 exit(EXIT_FAILURE); 407 } 408 409 psDBCleanup(dbh); 410 } 411 412 { 413 psDB *dbh; 414 415 dbh = psDBInit("localhost", "test", NULL, "test"); 416 if (!dbh) { 417 exit(EXIT_FAILURE); 418 } 419 405 420 if (!detNormalizedImfileDropTable(dbh)) { 406 421 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r8319 r8368 403 403 } 404 404 405 if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32)) { 406 exit(EXIT_FAILURE); 407 } 408 409 psDBCleanup(dbh); 410 } 411 412 { 413 psDB *dbh; 414 415 dbh = psDBInit("localhost", "test", NULL, "test"); 416 if (!dbh) { 417 exit(EXIT_FAILURE); 418 } 419 405 420 if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", "a string")) { 406 421 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insertfits.c
r7461 r8368 700 700 } 701 701 702 if (!detNormalizedStatImfileInsertFits(dbh, fits)) { 703 exit(EXIT_FAILURE); 704 } 705 706 if (!psFitsClose(fits)) { 707 exit(EXIT_FAILURE); 708 } 709 710 psDBCleanup(dbh); 711 } 712 713 { 714 psDB *dbh; 715 psFits *fits; 716 717 dbh = psDBInit("localhost", "test", NULL, "test"); 718 if (!dbh) { 719 exit(EXIT_FAILURE); 720 } 721 722 // open a temp 723 fits = psFitsOpen(TMP_FILENAME, "r"); 724 if (!fits) { 725 exit(EXIT_FAILURE); 726 } 727 702 728 if (!detNormalizedImfileInsertFits(dbh, fits)) { 703 729 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insertobject.c
r8319 r8368 579 579 { 580 580 psDB *dbh; 581 detNormalizedStatImfileRow *object; 582 583 dbh = psDBInit("localhost", "test", NULL, "test"); 584 if (!dbh) { 585 exit(EXIT_FAILURE); 586 } 587 588 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32); 589 if (!object) { 590 exit(EXIT_FAILURE); 591 } 592 593 if (!detNormalizedStatImfileInsertObject(dbh, object)) { 594 exit(EXIT_FAILURE); 595 } 596 597 psFree(object); 598 psDBCleanup(dbh); 599 } 600 601 { 602 psDB *dbh; 581 603 detNormalizedImfileRow *object; 582 604 -
trunk/ippdb/tests/metadatafromobject.c
r8325 r8368 1252 1252 { 1253 1253 psMetadata *md; 1254 detNormalizedStatImfileRow *object; 1255 bool status; 1256 1257 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32); 1258 if (!object) { 1259 exit(EXIT_FAILURE); 1260 } 1261 1262 md = detNormalizedStatImfileMetadataFromObject(object); 1263 if (!md) { 1264 exit(EXIT_FAILURE); 1265 } 1266 1267 psFree(object); 1268 1269 if (!psMetadataLookupS32(&status, md, "det_id") == -32) { 1270 psFree(md); 1271 exit(EXIT_FAILURE); 1272 } 1273 if (!psMetadataLookupS32(&status, md, "iteration") == -32) { 1274 psFree(md); 1275 exit(EXIT_FAILURE); 1276 } 1277 if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) { 1278 psFree(md); 1279 exit(EXIT_FAILURE); 1280 } 1281 if (!psMetadataLookupF32(&status, md, "norm") == 32.32) { 1282 psFree(md); 1283 exit(EXIT_FAILURE); 1284 } 1285 1286 psFree(md); 1287 } 1288 1289 { 1290 psMetadata *md; 1254 1291 detNormalizedImfileRow *object; 1255 1292 bool status; -
trunk/ippdb/tests/objectfrommetadata.c
r8325 r8368 1870 1870 { 1871 1871 psMetadata *md; 1872 detNormalizedStatImfileRow *object; 1873 1874 md = psMetadataAlloc(); 1875 if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) { 1876 psFree(md); 1877 exit(EXIT_FAILURE); 1878 } 1879 if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) { 1880 psFree(md); 1881 exit(EXIT_FAILURE); 1882 } 1883 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) { 1884 psFree(md); 1885 exit(EXIT_FAILURE); 1886 } 1887 if (!psMetadataAddF32(md, PS_LIST_TAIL, "norm", 0, NULL, 32.32)) { 1888 psFree(md); 1889 exit(EXIT_FAILURE); 1890 } 1891 1892 object = detNormalizedStatImfileObjectFromMetadata(md); 1893 if (!object) { 1894 psFree(md); 1895 exit(EXIT_FAILURE); 1896 } 1897 1898 psFree(md); 1899 1900 if (!object->det_id == -32) { 1901 psFree(object); 1902 exit(EXIT_FAILURE); 1903 } 1904 if (!object->iteration == -32) { 1905 psFree(object); 1906 exit(EXIT_FAILURE); 1907 } 1908 if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) { 1909 psFree(object); 1910 exit(EXIT_FAILURE); 1911 } 1912 if (!object->norm == 32.32) { 1913 psFree(object); 1914 exit(EXIT_FAILURE); 1915 } 1916 1917 psFree(object); 1918 } 1919 1920 { 1921 psMetadata *md; 1872 1922 detNormalizedImfileRow *object; 1873 1923 -
trunk/ippdb/tests/pop.c
r8325 r8368 574 574 psS32 iteration; 575 575 char class_id[256]; 576 psF32 norm; 577 578 dbh = psDBInit("localhost", "test", NULL, "test"); 579 if (!dbh) { 580 exit(EXIT_FAILURE); 581 } 582 583 if (!detNormalizedStatImfilePop(dbh, &det_id, &iteration, (char **)&class_id, &norm)) { 584 exit(EXIT_FAILURE); 585 } 586 587 psDBCleanup(dbh); 588 } 589 590 { 591 psDB *dbh; 592 psS32 det_id; 593 psS32 iteration; 594 char class_id[256]; 576 595 char uri[256]; 577 596 char recipe[256]; -
trunk/ippdb/tests/popfits.c
r7461 r8368 700 700 } 701 701 702 if (!detNormalizedStatImfilePopFits(dbh, fits, 1)) { 703 exit(EXIT_FAILURE); 704 } 705 706 if (!psFitsClose(fits)) { 707 exit(EXIT_FAILURE); 708 } 709 710 psDBCleanup(dbh); 711 } 712 713 { 714 psDB *dbh; 715 psFits *fits; 716 717 dbh = psDBInit("localhost", "test", NULL, "test"); 718 if (!dbh) { 719 exit(EXIT_FAILURE); 720 } 721 722 // allocate a temp 723 fits = psFitsOpen(TMP_FILENAME, "w"); 724 if (!fits) { 725 exit(EXIT_FAILURE); 726 } 727 702 728 if (!detNormalizedImfilePopFits(dbh, fits, 1)) { 703 729 exit(EXIT_FAILURE); -
trunk/ippdb/tests/popobject.c
r7461 r8368 475 475 { 476 476 psDB *dbh; 477 detNormalizedStatImfileRow *object; 478 479 dbh = psDBInit("localhost", "test", NULL, "test"); 480 if (!dbh) { 481 exit(EXIT_FAILURE); 482 } 483 484 object = detNormalizedStatImfilePopObject(dbh); 485 if (!object) { 486 exit(EXIT_FAILURE); 487 } 488 489 psFree(object); 490 psDBCleanup(dbh); 491 } 492 493 { 494 psDB *dbh; 477 495 detNormalizedImfileRow *object; 478 496 -
trunk/ippdb/tests/selectrowsfits.c
r7461 r8368 593 593 } 594 594 595 if (!detNormalizedStatImfileSelectRowsFits(dbh, fits, NULL, 1)) { 596 exit(EXIT_FAILURE); 597 } 598 599 psFree(fits); 600 psDBCleanup(dbh); 601 } 602 603 { 604 psDB *dbh; 605 psFits *fits; 606 607 dbh = psDBInit("localhost", "test", NULL, "test"); 608 if (!dbh) { 609 exit(EXIT_FAILURE); 610 } 611 612 fits = psFitsOpen(TMP_FILENAME, "w"); 613 if (!fits) { 614 exit(EXIT_FAILURE); 615 } 616 595 617 if (!detNormalizedImfileSelectRowsFits(dbh, fits, NULL, 1)) { 596 618 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
