From a6a958838d9edd9ab06e90bbcc2f187bc262414a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 1 Nov 2023 21:16:18 +0100 Subject: [PATCH] Trying to fix file utils unit test on Windows - cannot remove file when still open? --- src/tl/unit_tests/tlFileUtilsTests.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tl/unit_tests/tlFileUtilsTests.cc b/src/tl/unit_tests/tlFileUtilsTests.cc index 768b0943a5..1397268bd4 100644 --- a/src/tl/unit_tests/tlFileUtilsTests.cc +++ b/src/tl/unit_tests/tlFileUtilsTests.cc @@ -886,8 +886,10 @@ TEST (21) os << "A test"; os.close (); - tl::InputStream is (p); - EXPECT_EQ (is.read_all (), "A test"); + { + tl::InputStream is (p); + EXPECT_EQ (is.read_all (), "A test"); + } EXPECT_EQ (tl::rm_file (p), true); EXPECT_EQ (tl::file_exists (p), false); @@ -925,8 +927,10 @@ TEST (23) os << "A test"; os.close (); - tl::InputStream is (tl::combine_path (p, "test")); - EXPECT_EQ (is.read_all (), "A test"); + { + tl::InputStream is (tl::combine_path (p, "test")); + EXPECT_EQ (is.read_all (), "A test"); + } EXPECT_EQ (tl::rm_dir_recursive (p), true); EXPECT_EQ (tl::file_exists (p), false);