| 58 | } |
| 59 | |
| 60 | static Status VerifyRowsFromComparisonFile(const string& ref_file_path, |
| 61 | ReferenceRowsMap& cache, TupleTextFileReader* reader, int64_t* row_count) { |
| 62 | TupleCacheRowFunction verify_fn = [&ref_file_path, &cache, reader](const string& str) { |
| 63 | auto iter = cache.find(str); |
| 64 | if (iter == cache.end()) { |
| 65 | return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY, |
| 66 | Substitute("Result '$0' of file '$1' doesn't exist in the reference file: '$2'", |
| 67 | str, reader->GetPath() + DEBUG_TUPLE_CACHE_BAD_POSTFIX, |
| 68 | ref_file_path + DEBUG_TUPLE_CACHE_BAD_POSTFIX)); |
| 69 | } |
| 70 | iter->second.comparison_rows_count++; |
| 71 | return Status::OK(); |
| 72 | }; |
| 73 | return ForEachRow(reader, verify_fn, row_count); |
| 74 | } |
| 75 | |
| 76 | static Status InsertRowsFromReferenceFile( |
| 77 | ReferenceRowsMap& cache, TupleTextFileReader* reader, int64_t* row_count) { |
no test coverage detected