| 269 | |
| 270 | template <typename IterT> |
| 271 | void CheckLineExtractionOne(IterT iter) |
| 272 | { |
| 273 | IterT end; |
| 274 | |
| 275 | // At the start, we are on a newline, which is an empty |
| 276 | // string |
| 277 | BOOST_TEST(iter.get_currentline() == string()); |
| 278 | BOOST_TEST( |
| 279 | string(iter.get_currentline_begin(), iter.get_currentline_end()) |
| 280 | == string()); |
| 281 | |
| 282 | ++iter; // a |
| 283 | ++iter; // b |
| 284 | ++iter; // c |
| 285 | BOOST_TEST(iter.get_currentline() == line1); |
| 286 | AssertIterString( |
| 287 | iter.get_currentline_begin(), |
| 288 | iter.get_currentline_end(), |
| 289 | line1); |
| 290 | |
| 291 | ++iter; // d |
| 292 | ++iter; // newline |
| 293 | ++iter; // e |
| 294 | |
| 295 | // check that copy construction and assignment do |
| 296 | // not interfere with get_currentline |
| 297 | IterT iter2(iter); |
| 298 | IterT iter3; iter3 = iter; |
| 299 | BOOST_TEST(iter2.get_currentline() == line2); |
| 300 | BOOST_TEST(iter3.get_currentline() == line2); |
| 301 | AssertIterString( |
| 302 | iter2.get_currentline_begin(), |
| 303 | iter2.get_currentline_end(), |
| 304 | line2); |
| 305 | AssertIterString( |
| 306 | iter3.get_currentline_begin(), |
| 307 | iter3.get_currentline_end(), |
| 308 | line2); |
| 309 | |
| 310 | ++iter; // f |
| 311 | ++iter; // g |
| 312 | ++iter; // h |
| 313 | ++iter; // newline |
| 314 | |
| 315 | // Check when the iterator is on a newline |
| 316 | BOOST_TEST(iter.get_currentline() == line2); |
| 317 | AssertIterString( |
| 318 | iter.get_currentline_begin(), |
| 319 | iter.get_currentline_end(), |
| 320 | line2); |
| 321 | |
| 322 | ++iter; |
| 323 | BOOST_TEST(iter == end); |
| 324 | } |
| 325 | |
| 326 | |
| 327 | void CheckLineExtraction(void) |
no test coverage detected