Skip to content

Commit

Permalink
test_util.cc: do not compare file contents in REQUIRE (commaai#29861)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee authored Sep 9, 2023
1 parent 50b954d commit 95ae876
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/tests/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ TEST_CASE("util::read_file") {
std::string content = random_bytes(64 * 1024);
write(fd, content.c_str(), content.size());
std::string ret = util::read_file(filename);
REQUIRE(ret == content);
bool equal = (ret == content);
REQUIRE(equal);
close(fd);
}
SECTION("read directory") {
Expand Down Expand Up @@ -108,7 +109,8 @@ TEST_CASE("util::safe_fwrite") {
REQUIRE(ret == 0);
ret = fclose(f);
REQUIRE(ret == 0);
REQUIRE(dat == util::read_file(filename));
bool equal = (dat == util::read_file(filename));
REQUIRE(equal);
}

TEST_CASE("util::create_directories") {
Expand Down

0 comments on commit 95ae876

Please sign in to comment.