diff options
author | crupest <crupest@outlook.com> | 2022-02-03 18:00:59 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-03 18:00:59 +0800 |
commit | 03be170f6ebfd292b564b54448ff435990ce2f5c (patch) | |
tree | a9582de7736e20092123751be2ae89a7242d490f | |
parent | 3c0461b10984eaa156b95a3006f093b1ef2d918b (diff) | |
download | cru-03be170f6ebfd292b564b54448ff435990ce2f5c.tar.gz cru-03be170f6ebfd292b564b54448ff435990ce2f5c.tar.bz2 cru-03be170f6ebfd292b564b54448ff435990ce2f5c.zip |
...
-rw-r--r-- | test/common/platform/win/StreamConvertTest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/common/platform/win/StreamConvertTest.cpp b/test/common/platform/win/StreamConvertTest.cpp index 43c6f46c..a8fdd8ff 100644 --- a/test/common/platform/win/StreamConvertTest.cpp +++ b/test/common/platform/win/StreamConvertTest.cpp @@ -20,11 +20,12 @@ TEST(StreamConvert, FileStreamWork) { String path = temp_file_path; - Win32FileStream file( - path, OpenFileFlags::Read | OpenFileFlags::Write | OpenFileFlags::Create); + Win32FileStream file(path, OpenFileFlags::Write | OpenFileFlags::Create); file.Write("abc", 3); + file.Close(); - IStream* com_stream = ConvertStreamToComStream(&file); + Win32FileStream file2(path, OpenFileFlags::Read); + IStream* com_stream = ConvertStreamToComStream(&file2); LARGE_INTEGER position; position.QuadPart = 0; ThrowIfFailed(com_stream->Seek(position, SEEK_SET, nullptr)); @@ -32,7 +33,7 @@ TEST(StreamConvert, FileStreamWork) { ThrowIfFailed(com_stream->Read(buffer.get(), 3, nullptr)); ASSERT_EQ(std::string_view(buffer.get(), 3), "abc"); com_stream->Release(); - file.Close(); + file2.Close(); std::filesystem::remove(temp_file_path); } |