diff --git a/test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp b/test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp index 3b8e6929730..463955fd401 100644 --- a/test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp +++ b/test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp @@ -61,7 +61,7 @@ static void delete_file(const char* filename) { class TestController : public CgroupController { public: char* subsystem_path() override { - // The real subsystem is in /tmp/, generaed by temp_file() + // The real subsystem is in /tmp/, generated by temp_file() return (char*)"/"; }; }; @@ -99,6 +99,9 @@ TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesErrorCases) { fill_file(test_file, "foof bar"); err = subsystem_file_line_contents(&my_controller, test_file, "foo", "%s", &s); EXPECT_NE(err, 0) << "Key must be exact match"; + + // Cleanup + delete_file(test_file); } TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesSuccessCases) { @@ -149,6 +152,9 @@ TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesSuccessCases) { err = subsystem_file_line_contents(&my_controller, test_file, nullptr, "%*s %d", &x); EXPECT_EQ(err, 0); EXPECT_EQ(x, 10001); + + // Cleanup + delete_file(test_file); } TEST(cgroupTest, SubSystemFileLineContentsSingleLine) { @@ -190,6 +196,9 @@ TEST(cgroupTest, SubSystemFileLineContentsSingleLine) { err = subsystem_file_line_contents(&my_controller, test_file, nullptr, JULONG_FORMAT, &z); EXPECT_EQ(err, 0); EXPECT_EQ(z, (julong)1337) << "Wrong value for z"; + + // Cleanup + delete_file(test_file); } #endif // LINUX