@@ -341,7 +341,6 @@ TEST(cgroupTest, read_string_tests) {
341341 ok = controller->read_string (base_with_slash, result, 1024 );
342342 EXPECT_FALSE (ok) << " Empty file should have failed" ;
343343 EXPECT_STREQ (" " , result) << " Expected untouched result" ;
344- delete_file (test_file);
345344
346345 // File contents larger than 1K
347346 // We only read in the first 1K - 1 bytes
@@ -358,6 +357,8 @@ TEST(cgroupTest, read_string_tests) {
358357 EXPECT_TRUE (1023 == strlen (result)) << " Expected only the first 1023 chars to be read in" ;
359358 EXPECT_EQ (0 , strncmp (too_large, result, 1023 ));
360359 EXPECT_EQ (result[1023 ], ' \0 ' ) << " The last character must be the null character" ;
360+
361+ delete_file (test_file);
361362}
362363
363364TEST (cgroupTest, read_number_tuple_test) {
@@ -393,6 +394,8 @@ TEST(cgroupTest, read_number_tuple_test) {
393394 ok = controller->read_numerical_tuple_value (base_with_slash, true /* use_first */ , &result);
394395 EXPECT_FALSE (ok) << " Empty file should be an error" ;
395396 EXPECT_EQ ((jlong)-10 , result) << " result value should be unchanged" ;
397+
398+ delete_file (test_file);
396399}
397400
398401TEST (cgroupTest, read_numerical_key_beyond_max_path) {
0 commit comments