Commit 47ef310a7fc9b94103f207c1f14645f2b932897c

Authored by Jürgen Knödlseder
1 parent 2b093fd1

Adapt for existence of diffuse cube test file.

test/test_GModel.cpp
... ... @@ -46,6 +46,7 @@ void TestGModel::set(void)
46 46  
47 47 // Set attributes
48 48 m_map_file = "data/cena_lobes_parkes.fits";
  49 + m_cube_file = "data/test_cube.fits";
49 50 m_xml_file = "data/crab.xml";
50 51 m_xml_model_point_const = "data/model_point_const.xml";
51 52 m_xml_model_point_plaw = "data/model_point_plaw.xml";
... ... @@ -526,7 +527,7 @@ void TestGModel::test_diffuse_cube(void)
526 527 GModelSpatialDiffuseCube model;
527 528 test_assert(model.type() == "MapCubeFunction",
528 529 "Model type \"MapCubeFunction\" expected.");
529   - test_assert(!model.isloaded(), "Map cube is not yet loaded");
  530 + test_assert(!model.isloaded(), "Map cube is not yet loaded.");
530 531 test_assert(model.filename() == "", "Model filename \"\" expected.");
531 532 test_try_success();
532 533 }
... ... @@ -537,10 +538,10 @@ void TestGModel::test_diffuse_cube(void)
537 538 // Test filename value constructor
538 539 test_try("Test filename value constructor");
539 540 try {
540   - GModelSpatialDiffuseCube model("file.fits", 3.0);
  541 + GModelSpatialDiffuseCube model(m_cube_file, 3.0);
541 542 test_value(model.value(), 3.0);
542   - test_assert(model.filename() == "file.fits", "Expected \"file.fits\"");
543   - test_assert(!model.isloaded(), "Map cube is not yet loaded");
  543 + test_assert(model.filename() == m_cube_file, "Expected \""+m_cube_file+"\"");
  544 + test_assert(model.isloaded(), "Map cube has not been loaded.");
544 545 test_try_success();
545 546 }
546 547 catch (std::exception &e) {
... ... @@ -554,7 +555,7 @@ void TestGModel::test_diffuse_cube(void)
554 555 GModelSpatialDiffuseCube model(map, 3.0);
555 556 test_value(model.value(), 3.0);
556 557 test_assert(model.filename() == "", "Expected \"\"");
557   - test_assert(model.isloaded(), "Map cube is loaded");
  558 + test_assert(model.isloaded(), "Map cube is loaded.");
558 559 //test_assert(model.cube() == map, "Map cube is not the expected one");
559 560 test_try_success();
560 561 }
... ... @@ -572,9 +573,9 @@ void TestGModel::test_diffuse_cube(void)
572 573 test_value(model.size(), 1);
573 574 test_assert(model.type() == "MapCubeFunction", "Expected \"MapCubeFunction\"");
574 575 test_value(model.value(), 1.0);
575   - test_assert(!model.isloaded(), "Map cube is not yet loaded");
576   - test_assert(model.filename() == "test_file.fits",
577   - "Model filename \"test_file.fits\" expected.");
  576 + test_assert(model.isloaded(), "Map cube has not been loaded.");
  577 + test_assert(model.filename() == m_cube_file,
  578 + "Model filename \""+m_cube_file+"\" expected.");
578 579  
579 580 // Test value method
580 581 model.value(3.9);
... ... @@ -1781,8 +1782,8 @@ void TestGModel::test_spatial_model(void)
1781 1782 test_xml_model("GModelSpatialRadialShell", m_xml_model_radial_shell);
1782 1783 test_xml_model("GModelSpatialEllipticalDisk", m_xml_model_elliptical_disk);
1783 1784 test_xml_model("GModelSpatialDiffuseConst", m_xml_model_diffuse_const);
1784   - test_xml_model("GModelSpatialDiffuseCube", m_xml_model_diffuse_cube);
1785 1785 test_xml_model("GModelSpatialDiffuseMap", m_xml_model_diffuse_map);
  1786 + test_xml_model("GModelSpatialDiffuseCube", m_xml_model_diffuse_cube);
1786 1787  
1787 1788 // Return
1788 1789 return;
... ...
test/test_GModel.hpp
... ... @@ -74,6 +74,7 @@ private:
74 74  
75 75 // Private attributes
76 76 std::string m_map_file;
  77 + std::string m_cube_file;
77 78 std::string m_xml_file;
78 79 std::string m_xml_model_point_const;
79 80 std::string m_xml_model_point_plaw;
... ...