Commit d26f54c079fbd87f6f91def61904959dfdfa470a
1 parent
e9252cfb
Adapt CTA unit test to new FITS file logic that keeps existing extensions.
Showing
1 changed file
with
7 additions
and
1 deletions
inst/cta/test/test_CTA.cpp
| ... | ... | @@ -1401,6 +1401,10 @@ void TestGCTAObservation::test_unbinned_obs(void) |
| 1401 | 1401 | test_try_failure(e); |
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | + // Remove test files | |
| 1405 | + std::remove("test_cta_events1.fits"); | |
| 1406 | + std::remove("test_cta_events2.fits"); | |
| 1407 | + | |
| 1404 | 1408 | // Test loading of the event file and saving into a different extension |
| 1405 | 1409 | run.load(cta_events); |
| 1406 | 1410 | run.save("test_cta_events1.fits[EVENTS2;GTI2]", true); |
| ... | ... | @@ -1411,7 +1415,9 @@ void TestGCTAObservation::test_unbinned_obs(void) |
| 1411 | 1415 | fits.close(); |
| 1412 | 1416 | run.save("test_cta_events1.fits[EVENTS3;GTI3]", true); |
| 1413 | 1417 | fits.open("test_cta_events1.fits"); |
| 1414 | - test_value(fits.size(), 3, "FITS file should contain 3 HDUs"); | |
| 1418 | + test_value(fits.size(), 5, "FITS file should contain 5 HDUs"); | |
| 1419 | + test_assert(fits.contains("EVENTS2"), "FITS should contain \"EVENTS2\" HDU"); | |
| 1420 | + test_assert(fits.contains("GTI2"), "FITS should contain \"GTI2\" HDU"); | |
| 1415 | 1421 | test_assert(fits.contains("EVENTS3"), "FITS should contain \"EVENTS3\" HDU"); |
| 1416 | 1422 | test_assert(fits.contains("GTI3"), "FITS should contain \"GTI3\" HDU"); |
| 1417 | 1423 | fits.close(); | ... | ... |