| 139 | |
| 140 | TEST ( test_merger_base_sources ) { |
| 141 | UIFile in ( "merger.cfg" ); |
| 142 | |
| 143 | shared_ptr<merger_base> mb = |
| 144 | UI::build<merger_base> ( in, "Merger", UI::compulsory ); |
| 145 | |
| 146 | mpdf_array sources; |
| 147 | UI::get ( sources, in, "Sources", UI::compulsory ); |
| 148 | mb->set_sources ( sources ); |
| 149 | |
| 150 | shared_ptr<rectangular_support> support = |
| 151 | UI::build<rectangular_support> ( in, "Support", UI::compulsory ); |
| 152 | mb->set_support( *support ); |
| 153 | |
| 154 | mb->merge(); |
| 155 | vec m = mb->mean(); |
| 156 | CHECK_EQUAL ( 2, m.size() ); |
| 157 | } |
| 158 | |
| 159 | TEST ( test_merger_base_sources_error ) { |
| 160 | UIFile in ( "merger_error.cfg" ); |
| 161 | |
| 162 | mpdf_array sources; |
| 163 | try { |
| 164 | UI::get ( sources, in, "Sources", UI::compulsory ); |
| 165 | CHECK ( false ); |
| 166 | } catch ( UISettingException &exc ) { |
| 167 | CHECK ( exc.what() ); |
| 168 | } |
| 169 | } |