From f25e59b951f62306fee8a596b916684644bbb216 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 7 Oct 2025 20:10:30 +0000 Subject: [PATCH] intel/mda/tests: use an ASSERT on fread() Coverity is pointing out that we should check this, and in reality if this isn't what we expect the rest of the test is probably invalid anyway. CID: 1666504 CID: 1666544 CID: 1666552 Reviewed-by: Caio Oliveira Part-of: --- src/intel/mda/tar_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/mda/tar_test.cpp b/src/intel/mda/tar_test.cpp index 0b092ac1843..5e1560e4c2a 100644 --- a/src/intel/mda/tar_test.cpp +++ b/src/intel/mda/tar_test.cpp @@ -30,7 +30,7 @@ TEST(Tar, RoundtripSmallFile) char *contents = new char[size]; fseek(f, 0, SEEK_SET); - fread(contents, size, 1, f); + ASSERT_EQ(fread(contents, size, 1, f), 1); fclose(f); { @@ -79,7 +79,7 @@ TEST(Tar, RoundtripContentsWithRecordSize) char *contents = new char[size]; fseek(f, 0, SEEK_SET); - fread(contents, size, 1, f); + ASSERT_EQ(fread(contents, size, 1, f), 1); fclose(f); { @@ -128,7 +128,7 @@ TEST(Tar, TimestampRoundtrip) char *contents = new char[size]; fseek(f, 0, SEEK_SET); - fread(contents, size, 1, f); + ASSERT_EQ(fread(contents, size, 1, f), 1); fclose(f); {