24 #include "cheetah/pipeline/test/MultiBeamConfigTest.h" 25 #include "cheetah/pipeline/MultiBeamConfig.h" 26 #include <boost/property_tree/xml_parser.hpp> 34 MultiBeamConfigTest::MultiBeamConfigTest()
39 MultiBeamConfigTest::~MultiBeamConfigTest()
43 void MultiBeamConfigTest::SetUp()
47 void MultiBeamConfigTest::TearDown()
51 TEST_F(MultiBeamConfigTest, test_multiple_beam_config_parse)
53 MultiBeamConfig<uint8_t> mb_config;
54 std::vector<std::string> sigproc_filenames = {
"sigproc_1.fil",
"sigproc_2.fil" };
57 boost::property_tree::ptree pt_root;
58 boost::property_tree::ptree pt_beams;
60 boost::property_tree::ptree pt_beam_1;
61 boost::property_tree::ptree pt_beam_2;
62 boost::property_tree::ptree source_1;
63 boost::property_tree::ptree source_2;
64 boost::property_tree::ptree source_3;
65 source_3.put<std::string>(
"id",
"source_3_id");
69 boost::property_tree::ptree pt_sigproc_1;
70 pt_sigproc_1.put<std::string>(
"file",sigproc_filenames[0]);
71 pt_sigproc_1.put<std::string>(
"id",
"sigproc_1_id");
72 boost::property_tree::ptree pt_sigproc_2;
73 pt_sigproc_2.put<std::string>(
"file",sigproc_filenames[1]);
74 pt_sigproc_2.put<std::string>(
"id",
"sigproc_2_id");
75 source_1.add_child(
"sigproc",pt_sigproc_1);
76 source_2.add_child(
"sigproc", pt_sigproc_2);
78 pt_beam_1.put<std::string>(
"active",
"true");
79 pt_beam_2.put<std::string>(
"active",
"true");
80 pt_beam_1.add_child(
"source", source_1);
81 pt_beam_2.add_child(
"source", source_2);
82 pt_beams.add_child(
"beam", pt_beam_1);
83 pt_beams.add_child(
"beam", pt_beam_2);
84 pt_root.put_child(
"beams", pt_beams);
88 boost::program_options::variables_map vm;
89 mb_config.parse_property_tree(pt_beams, vm);
90 boost::program_options::notify(vm);
92 auto it = mb_config.beams();
94 while (it != mb_config.beams_end())
96 auto const& beam_config = *it;
97 ASSERT_EQ(1U, beam_config.sigproc_config().sigproc_files().size());
98 ASSERT_EQ(beam_config.sigproc_config().sigproc_files()[0], sigproc_filenames[count]);
102 ASSERT_EQ(count, 2U);
Some limits and constants for FLDO.