| 530 | } // compareStrings() |
| 531 | |
| 532 | bool FuzzyStringComparator::compareStreams(std::istream& input_1, std::istream& input_2) |
| 533 | { |
| 534 | // reset 'success' state to true, in case its currently false due to a prior call (reporting depends on it) |
| 535 | const_cast<bool&>(is_status_success_) = true; |
| 536 | |
| 537 | std::string line_str_1; |
| 538 | std::string line_str_2; |
| 539 | |
| 540 | while (input_1 || input_2) |
| 541 | { |
| 542 | |
| 543 | readNextLine_(input_1, line_str_1, line_num_1_); |
| 544 | #ifdef DEBUG_FUZZY |
| 545 | std::cout << "eof: " << input_1.eof() << " failbit: " << input_1.fail() << " badbit: " << input_1.bad() << " reading " << input_1.tellg () << "chars\n"; |
| 546 | #endif |
| 547 | |
| 548 | readNextLine_(input_2, line_str_2, line_num_2_); |
| 549 | #ifdef DEBUG_FUZZY |
| 550 | std::cout << "eof: " << input_2.eof() << " failbit: " << input_2.fail() << " badbit: " << input_2.bad() << " reading " << input_2.tellg () << "chars\n"; |
| 551 | std::cout << line_str_1 << "\n" << line_str_2 << std::endl; |
| 552 | #endif |
| 553 | // compare the two lines of input |
| 554 | if (!compareLines_(line_str_1, line_str_2) && verbose_level_ < 3) |
| 555 | { |
| 556 | break; |
| 557 | } |
| 558 | |
| 559 | } // while ( input_1 || input_2 ) |
| 560 | |
| 561 | reportSuccess_(); |
| 562 | |
| 563 | return is_status_success_; |
| 564 | |
| 565 | } // compareStreams() |
| 566 | |
| 567 | void FuzzyStringComparator::readNextLine_(std::istream& input_stream, std::string& line_string, int& line_number) const |
| 568 | { |
no outgoing calls
no test coverage detected