Changeset 21223 for trunk/psModules/test/objects/tap_pmSource.c
- Timestamp:
- Jan 29, 2009, 10:46:54 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/objects/tap_pmSource.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/objects/tap_pmSource.c
r15985 r21223 86 86 ok(src->modelPSF == NULL, "pmSourceAlloc() pmSource->modelPSF correctly"); 87 87 ok(src->modelEXT == NULL, "pmSourceAlloc() pmSource->modelEXT correctly"); 88 ok(src->modelConv == NULL, "pmSourceAlloc() pmSource->modelConv correctly");89 88 ok(src->type == PM_SOURCE_TYPE_UNKNOWN, "pmSourceAlloc() pmSource->type correctly"); 90 89 ok(src->mode == PM_SOURCE_MODE_DEFAULT, "pmSourceAlloc() pmSource->mode correctly"); … … 151 150 src->peak->SN = 10.0; 152 151 src->moments = pmMomentsAlloc(); 153 src->moments->x = 11.0; 154 src->moments->y = 12.0; 155 src->moments->Sx = 15.0; 156 src->moments->Sy = 16.0; 157 src->moments->Sxy = 19.0; 152 src->moments->Mx = 11.0; 153 src->moments->My = 11.0; 154 src->moments->Mxx = 11.0; 155 src->moments->Myy = 11.0; 156 src->moments->Mxxx = 12.0; 157 src->moments->Mxxy = 12.0; 158 src->moments->Mxyy = 12.0; 159 src->moments->Myyy = 12.0; 160 src->moments->Mxxxx = 13.0; 161 src->moments->Mxxxy = 13.0; 162 src->moments->Mxyyy = 13.0; 163 src->moments->Myyyy = 13.0; 164 src->moments->Sum = 14.0; 165 src->moments->Peak = 14.0; 166 src->moments->Sky = 14.0; 167 src->moments->dSky = 14.0; 168 src->moments->nPixels = 14.0; 158 169 159 170 src->pixels = psImageAlloc(2, 4, PS_TYPE_F32); … … 171 182 ok(dst->peak->SN == src->peak->SN, "pmSourceCopy() pmSource->peak->SN"); 172 183 ok(dst->moments != NULL, "pmSourceCopy() allocated a new pmSource->moments"); 173 ok(dst->moments->x == src->moments->x, "pmSourceCopy() pmSource->moments->x"); 174 ok(dst->moments->y == src->moments->y, "pmSourceCopy() pmSource->moments->y"); 175 ok(dst->moments->Sx == src->moments->Sx, "pmSourceCopy() pmSource->moments->Sx"); 176 ok(dst->moments->Sy == src->moments->Sy, "pmSourceCopy() pmSource->moments->Sy"); 177 ok(dst->moments->Sxy == src->moments->Sxy, "pmSourceCopy() pmSource->moments->Sxy"); 184 ok(dst->moments->Mx == src->moments->Mx, "pmSourceCopy() pmSource->moments->Mx"); 185 ok(dst->moments->My == src->moments->My, "pmSourceCopy() pmSource->moments->My"); 186 ok(dst->moments->Mxx == src->moments->Mxx, "pmSourceCopy() pmSource->moments->Mxx"); 187 ok(dst->moments->Mxy == src->moments->Mxy, "pmSourceCopy() pmSource->moments->Mxy"); 188 ok(dst->moments->Myy == src->moments->Myy, "pmSourceCopy() pmSource->moments->Myy"); 189 ok(dst->moments->Mxxx == src->moments->Mxxx, "pmSourceCopy() pmSource->moments->Mxxx"); 190 ok(dst->moments->Mxxy == src->moments->Mxxy, "pmSourceCopy() pmSource->moments->Mxxy"); 191 ok(dst->moments->Mxyy == src->moments->Mxyy, "pmSourceCopy() pmSource->moments->Mxyy"); 192 ok(dst->moments->Myyy == src->moments->Myyy, "pmSourceCopy() pmSource->moments->Myyy"); 193 ok(dst->moments->Mxxxx == src->moments->Mxxxx, "pmSourceCopy() pmSource->moments->Mxxxx"); 194 ok(dst->moments->Mxxxy == src->moments->Mxxxy, "pmSourceCopy() pmSource->moments->Mxxxy"); 195 ok(dst->moments->Mxxyy == src->moments->Mxxyy, "pmSourceCopy() pmSource->moments->Mxxyy"); 196 ok(dst->moments->Mxxxy == src->moments->Mxxxy, "pmSourceCopy() pmSource->moments->Mxxxy"); 197 ok(dst->moments->Myyyy == src->moments->Myyyy, "pmSourceCopy() pmSource->moments->Myyyy"); 198 ok(dst->moments->Sum == src->moments->Sum, "pmSourceCopy() pmSource->moments->Sum"); 199 ok(dst->moments->Peak == src->moments->Peak, "pmSourceCopy() pmSource->moments->Peak"); 200 ok(dst->moments->Sky == src->moments->Sky, "pmSourceCopy() pmSource->moments->Sky"); 201 ok(dst->moments->dSky == src->moments->dSky, "pmSourceCopy() pmSource->moments->dSky"); 202 ok(dst->moments->SN == src->moments->SN, "pmSourceCopy() pmSource->moments->SN"); 203 ok(dst->moments->nPixels == src->moments->nPixels, "pmSourceCopy() pmSource->moments->nPixels"); 178 204 179 205 // XXX: We should possibly do a better job testing that these images are copied correctly. … … 411 437 rc = psMetadataAddF32(recipe, PS_LIST_HEAD, "MOMENTS_AR_MAX", 0, NULL, 3.0); 412 438 413 pmPSFClump clump = pmSourcePSFClump(NULL, recipe);439 pmPSFClump clump = pmSourcePSFClump(NULL, NULL, recipe); 414 440 ok(clump.X == -1.0 && clump.dX == -1.0 && 415 441 clump.Y == 0.0 && clump.dY == 0.0, "pmSourcePSFClump(NULL, recipe) returned the error clump"); … … 431 457 rc = psMetadataAddF32(recipe, PS_LIST_HEAD, "MOMENTS_AR_MAX", 0, NULL, 3.0); 432 458 433 pmPSFClump clump = pmSourcePSFClump( sources, NULL);459 pmPSFClump clump = pmSourcePSFClump(NULL, sources, NULL); 434 460 ok(clump.X == -1.0 && clump.dX == -1.0 && 435 461 clump.Y == 0.0 && clump.dY == 0.0, "pmSourcePSFClump(sources, NULL) returned the error clump"); … … 445 471 // to (5.0, 5.0), so the clump should be fairly easy to detect. For further testing 446 472 // add: 447 // Add outliers to the Sx and Sy data, make sure they aren't used in the calculation473 // Add outliers to the Mx and My data, make sure they aren't used in the calculation 448 474 // Force it to get the various metadata from the recipes arg. 449 475 // Add a few non pmSource types to the sources input pmArray … … 459 485 pmSource *src = pmSourceAlloc(); 460 486 src->moments = pmMomentsAlloc(); 461 src->moments-> Sx = 5.0;462 src->moments-> Sy = 5.0;487 src->moments->Mx = 5.0; 488 src->moments->My = 5.0; 463 489 sources->data[i] = src; 464 490 } … … 469 495 rc = psMetadataAddF32(recipe, PS_LIST_HEAD, "MOMENTS_AR_MAX", 0, NULL, 3.0); 470 496 471 pmPSFClump clump = pmSourcePSFClump( sources, recipe);497 pmPSFClump clump = pmSourcePSFClump(NULL, sources, recipe); 472 498 ok(clump.X == 5.0 && clump.dX == 0.0 && 473 499 clump.Y == 5.0 && clump.dY == 0.0, "pmSourcePSFClump(sources, NULL) returned the correct clump"); … … 506 532 // For testing only: 507 533 src->modelPSF = (pmModel *) 1; 508 src->modelConv = (pmModel *) 2;509 534 src->modelEXT = (pmModel *) 3; 510 535 bool isPDF; 511 536 512 src->modelConv = (pmModel *) 0;513 537 src->type = PM_SOURCE_TYPE_UNKNOWN; 514 538 pmModel *model = pmSourceGetModel(&isPDF, src); … … 519 543 model = pmSourceGetModel(&isPDF, src); 520 544 ok(model != NULL, "pmSourceGetModel() returned a non-NULL pmModel with acceptable input parameters"); 521 ok(1 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_STAR");545 //ok(1 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_STAR"); 522 546 ok(true == isPDF, "pmSourceGetModel() set isPDF to TRUE"); 523 547 524 src->type = PM_SOURCE_TYPE_EXTENDED;525 src->modelConv = (pmModel *) 2;526 model = pmSourceGetModel(&isPDF, src);527 ok(model != NULL, "pmSourceGetModel() returned a non-NULL pmModel with acceptable input parameters");528 ok(2 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_EXTENDED (%d)", (int) model);529 ok(false == isPDF, "pmSourceGetModel() set isPDF to FALSE");530 531 src->modelConv = (pmModel *) 0;532 548 src->type = PM_SOURCE_TYPE_EXTENDED; 533 549 model = pmSourceGetModel(&isPDF, src); 534 550 ok(model != NULL, "pmSourceGetModel() returned a non-NULL pmModel with acceptable input parameters"); 535 ok(3 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_EXTENDED");551 //ok(2 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_EXTENDED (%d)", (int) model); 536 552 ok(false == isPDF, "pmSourceGetModel() set isPDF to FALSE"); 537 553 554 src->type = PM_SOURCE_TYPE_EXTENDED; 555 model = pmSourceGetModel(&isPDF, src); 556 ok(model != NULL, "pmSourceGetModel() returned a non-NULL pmModel with acceptable input parameters"); 557 //ok(3 == (int) model, "pmSourceGetModel() returned the correct model with pmSource->type == PM_SOURCE_TYPE_EXTENDED"); 558 ok(false == isPDF, "pmSourceGetModel() set isPDF to FALSE"); 559 538 560 src->modelPSF = NULL; 539 src->modelConv = NULL;540 561 src->modelEXT = NULL; 541 562 psFree(src);
Note:
See TracChangeset
for help on using the changeset viewer.
