From 34902e06cf2f19fba8b858d5f8fa3e3817f728f8 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 21 Jul 2023 22:23:43 +0300 Subject: [PATCH] Add test - LoadFileFromArchive (memory) --- OfficeUtils/tests/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OfficeUtils/tests/main.cpp b/OfficeUtils/tests/main.cpp index 8632668fb3..20f975ee4b 100644 --- a/OfficeUtils/tests/main.cpp +++ b/OfficeUtils/tests/main.cpp @@ -461,6 +461,19 @@ TEST_F(COfficeUtilsTest, other_win) ASSERT_EQ(error_code, S_OK); EXPECT_EQ(wstr, L"123 321"); + + DWORD bytes_count = 0; + BYTE* bytes = new BYTE[MAX_SIZE]; + NSFile::CFileBinary::ReadAllBytes(zip_path, &bytes, bytes_count); + + data = new BYTE[100]; + error_code = utils.LoadFileFromArchive(zip_path, L"MF/file.txt", &data, nFileSize); + wstr = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8(data, nFileSize); + delete[] data; + delete[] bytes; + + ASSERT_EQ(error_code, S_OK); + EXPECT_EQ(wstr, L"123 321"); }