diff --git a/tools/trace_analyzer_test.cc b/tools/trace_analyzer_test.cc index 63787a3c0b..2321b472f5 100644 --- a/tools/trace_analyzer_test.cc +++ b/tools/trace_analyzer_test.cc @@ -162,8 +162,8 @@ class TraceAnalyzerTest : public testing::Test { ASSERT_OK(lf_reader.GetStatus()); - ASSERT_EQ(cnt.size(), result.size()); - for (int i = 0; i < static_cast(result.size()); i++) { + size_t min_size = std::min(cnt.size(), result.size()); + for (size_t i = 0; i < min_size; i++) { if (full_content) { ASSERT_EQ(result[i], cnt[i]); } else {