Changeset 21471 for trunk/psModules/test/objects/tap_pmSource.c
- Timestamp:
- Feb 13, 2009, 12:41:28 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/objects/tap_pmSource.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/objects/tap_pmSource.c
r21223 r21471 48 48 readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32); 49 49 readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8); 50 readout-> weight= psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);50 readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32); 51 51 for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) { 52 52 psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32); … … 77 77 ok(src->peak == NULL, "pmSourceAlloc() pmSource->peak correctly"); 78 78 ok(src->pixels == NULL, "pmSourceAlloc() pmSource->pixels correctly"); 79 ok(src-> weight == NULL, "pmSourceAlloc() pmSource->weightcorrectly");79 ok(src->variance == NULL, "pmSourceAlloc() pmSource->variance correctly"); 80 80 ok(src->maskObj == NULL, "pmSourceAlloc() pmSource->maskObj correctly"); 81 81 ok(src->maskView == NULL, "pmSourceAlloc() pmSource->maskView correctly"); … … 169 169 170 170 src->pixels = psImageAlloc(2, 4, PS_TYPE_F32); 171 src-> weight= psImageAlloc(6, 8, PS_TYPE_F32);171 src->variance = psImageAlloc(6, 8, PS_TYPE_F32); 172 172 src->maskView = psImageAlloc(10, 12, PS_TYPE_U8); 173 173 pmSource *dst = pmSourceCopy(src); … … 207 207 ok(dst->pixels->numCols == src->pixels->numCols && dst->pixels->numRows == src->pixels->numRows, 208 208 "pmSourceCopy() generated correct size pmSource->pixels"); 209 ok(dst-> weight != NULL, "pmSourceCopy() allocated a new pmSource->weight");210 ok(dst-> weight->numCols == src->weight->numCols && dst->weight->numRows == src->weight->numRows,211 "pmSourceCopy() generated correct size pmSource-> weight");209 ok(dst->variance != NULL, "pmSourceCopy() allocated a new pmSource->variance"); 210 ok(dst->variance->numCols == src->variance->numCols && dst->variance->numRows == src->variance->numRows, 211 "pmSourceCopy() generated correct size pmSource->variance"); 212 212 ok(dst->maskView != NULL, "pmSourceCopy() allocated a new pmSource->maskView"); 213 213 ok(dst->maskView->numCols == src->maskView->numCols && dst->maskView->numRows == src->maskView->numRows, … … 290 290 int expectedNumCols = 1 + (TEST_NUM_COLS/2); 291 291 int expectedNumRows = 1 + (TEST_NUM_COLS/2); 292 // XX: We only verify the size of the pixels, weight, maskView, and maskObj292 // XX: We only verify the size of the pixels, variance, maskView, and maskObj 293 293 // images. A better test would verify that the actual data is set correctly. 294 294 // We don't do that here since it basically duplicated psLib function tests. 295 295 ok(src->pixels->numCols == expectedNumCols && src->pixels->numRows == expectedNumRows, 296 296 "pmSourceDefinePixels() set the size of pmSource->pixels correctly"); 297 ok(src-> weight->numCols == expectedNumCols && src->weight->numRows == expectedNumRows,298 "pmSourceDefinePixels() set the size of pmSource-> weightcorrectly");297 ok(src->variance->numCols == expectedNumCols && src->variance->numRows == expectedNumRows, 298 "pmSourceDefinePixels() set the size of pmSource->variance correctly"); 299 299 ok(src->maskView->numCols == expectedNumCols && src->maskView->numRows == expectedNumRows, 300 300 "pmSourceDefinePixels() set the size of pmSource->maskView correctly"); … … 396 396 int expectedNumCols = 1 + (TEST_NUM_COLS/2); 397 397 int expectedNumRows = 1 + (TEST_NUM_COLS/2); 398 // XX: We only verify the size of the pixels, weight, maskView, and maskObj398 // XX: We only verify the size of the pixels, variance, maskView, and maskObj 399 399 // images. A better test would verify that the actual data is set correctly. 400 400 // We don't do that here since it basically duplicated psLib function tests. 401 401 ok(src->pixels->numCols == expectedNumCols && src->pixels->numRows == expectedNumRows, 402 402 "pmSourceRedefinePixels() set the size of pmSource->pixels correctly"); 403 ok(src-> weight->numCols == expectedNumCols && src->weight->numRows == expectedNumRows,404 "pmSourceRedefinePixels() set the size of pmSource-> weightcorrectly");403 ok(src->variance->numCols == expectedNumCols && src->variance->numRows == expectedNumRows, 404 "pmSourceRedefinePixels() set the size of pmSource->variance correctly"); 405 405 ok(src->maskView->numCols == expectedNumCols && src->maskView->numRows == expectedNumRows, 406 406 "pmSourceRedefinePixels() set the size of pmSource->maskView correctly"); … … 584 584 // We only test with a single Gaussian model, with no residuals or masks. 585 585 // For completeness, additional tests should be added. 586 // We should also set mode &= PM_MODEL_OP_NOISE to test that the src-> weights are added.586 // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->variances are added. 587 587 { 588 588 psMemId id = psMemGetId(); … … 632 632 // call pmSourceOp() with acceptable parameters 633 633 // Test source->modelFlux 634 // We should also set mode &= PM_MODEL_OP_NOISE to test that the src-> weights are added.634 // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->variances are added. 635 635 { 636 636 psMemId id = psMemGetId();
Note:
See TracChangeset
for help on using the changeset viewer.
