From 7d476f8be408afbeb3fa24e1918928fd04885f8d Mon Sep 17 00:00:00 2001 From: Christian Feldmann Date: Wed, 4 Dec 2024 15:25:37 +0100 Subject: [PATCH] Also wait before modifying the file a bit. --- YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp b/YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp index 1a790162a..5039aa212 100644 --- a/YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp +++ b/YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp @@ -165,6 +165,8 @@ TEST(DataSourceLocalFileTest, ModifyOpenedFileExternally_ShouldBeDetected) EXPECT_EQ(file.read(buffer, 4), 4); EXPECT_THAT(buffer, ElementsAre('t', 'e', 's', 't')); + std::this_thread::sleep_for(std::chrono::seconds(1)); + std::ofstream tempFileWriter(tempFile.getFilePath(), std::iostream::out | std::iostream::binary); tempFileWriter << 'm' << 'o' << 'd' << 'i' << 'f' << 'i' << 'e' << 'd'; tempFileWriter.close();