@@ -61,7 +61,7 @@ void delete_file(const char* filename) {
6161class TestController : public CgroupController {
6262public:
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
104107TEST (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
154160TEST (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