Skip to content

Commit 2918a11

Browse files
author
duke
committed
Backport e889b460c03b3887ec5477fa734c430d3c3a41c8
1 parent bd1728a commit 2918a11

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void delete_file(const char* filename) {
6161
class TestController : public CgroupController {
6262
public:
6363
char* subsystem_path() override {
64-
// The real subsystem is in /tmp/, generaed by temp_file()
64+
// The real subsystem is in /tmp/, generated by temp_file()
6565
return (char*)"/";
6666
};
6767
};
@@ -99,6 +99,9 @@ TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesErrorCases) {
9999
fill_file(test_file, "foof bar");
100100
err = subsystem_file_line_contents(&my_controller, test_file, "foo", "%s", &s);
101101
EXPECT_NE(err, 0) << "Key must be exact match";
102+
103+
// Cleanup
104+
delete_file(test_file);
102105
}
103106

104107
TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesSuccessCases) {
@@ -149,6 +152,9 @@ TEST(cgroupTest, SubSystemFileLineContentsMultipleLinesSuccessCases) {
149152
err = subsystem_file_line_contents(&my_controller, test_file, nullptr, "%*s %d", &x);
150153
EXPECT_EQ(err, 0);
151154
EXPECT_EQ(x, 10001);
155+
156+
// Cleanup
157+
delete_file(test_file);
152158
}
153159

154160
TEST(cgroupTest, SubSystemFileLineContentsSingleLine) {
@@ -190,6 +196,9 @@ TEST(cgroupTest, SubSystemFileLineContentsSingleLine) {
190196
err = subsystem_file_line_contents(&my_controller, test_file, nullptr, JULONG_FORMAT, &z);
191197
EXPECT_EQ(err, 0);
192198
EXPECT_EQ(z, (julong)1337) << "Wrong value for z";
199+
200+
// Cleanup
201+
delete_file(test_file);
193202
}
194203

195204
#endif // LINUX

0 commit comments

Comments
 (0)