| 83 | } |
| 84 | |
| 85 | static Status VerifyRowCount(ReferenceRowsMap& cache) { |
| 86 | for (const auto& it : cache) { |
| 87 | DCHECK_GE(it.second.reference_rows_count, 0); |
| 88 | if (it.second.reference_rows_count == 0) { |
| 89 | return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY, |
| 90 | Substitute("Row count abnormal for key '$0', '$1' vs '$2'", it.first, |
| 91 | it.second.reference_rows_count, it.second.comparison_rows_count)); |
| 92 | } |
| 93 | if (it.second.reference_rows_count != it.second.comparison_rows_count) { |
| 94 | return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY, |
| 95 | Substitute("Row count doesn't match for key '$0', '$1' vs '$2'", it.first, |
| 96 | it.second.reference_rows_count, it.second.comparison_rows_count)); |
| 97 | } |
| 98 | } |
| 99 | return Status::OK(); |
| 100 | } |
| 101 | |
| 102 | Status TupleTextFileUtil::VerifyRows( |
| 103 | const string& cmp_file_path, const string& ref_file_path) { |
no test coverage detected