From 8742d78051165f98fbb466ca83306406da7af6da Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 17 Jun 2021 15:03:59 -0700 Subject: [PATCH] fix /proc test case for util::read_file old-commit-hash: ea6f779b3e8bf1a7918617d59534057bad54b990 --- selfdrive/common/tests/test_util.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/common/tests/test_util.cc b/selfdrive/common/tests/test_util.cc index fbf190576e..42c57940e5 100644 --- a/selfdrive/common/tests/test_util.cc +++ b/selfdrive/common/tests/test_util.cc @@ -20,16 +20,16 @@ std::string random_bytes(int size) { } TEST_CASE("util::read_file") { - SECTION("read /proc") { - std::string ret = util::read_file("/proc/self/cmdline"); - REQUIRE(ret.find("test_util") != std::string::npos); + SECTION("read /proc/version") { + std::string ret = util::read_file("/proc/version"); + REQUIRE(ret.find("Linux version") != std::string::npos); } SECTION("read file") { char filename[] = "/tmp/test_read_XXXXXX"; int fd = mkstemp(filename); REQUIRE(util::read_file(filename).empty()); - + std::string content = random_bytes(64 * 1024); write(fd, content.c_str(), content.size()); std::string ret = util::read_file(filename);