Add slicer tests

This commit is contained in:
Viktor Andreev
2023-12-07 20:57:20 +06:00
parent e4031da0ba
commit 92312df5ad

View File

@ -282,4 +282,31 @@ TEST_F(XlsbSimpleTests2, TablesTest)
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
TEST_F(XlsbSimpleTests2, SlicerTest)
{
auto tempDir = XlsbSimpleTests2::tempDir;
std::wstring path1(tempDir + FILE_SEPARATOR_STR + L"result_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"slicers" + FILE_SEPARATOR_STR + L"slicer2.bin");
std::wstring path2(tempDir + FILE_SEPARATOR_STR +L"example_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"slicers" + FILE_SEPARATOR_STR + L"slicer2.bin");
std::vector<char> fileContent;
std::vector<char> exampleContent;
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
TEST_F(XlsbSimpleTests2, SlicerCacheTest)
{
auto tempDir = XlsbSimpleTests2::tempDir;
std::wstring path1(tempDir + FILE_SEPARATOR_STR + L"result_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"slicerCaches" + FILE_SEPARATOR_STR + L"slicerCache2.bin");
std::wstring path2(tempDir + FILE_SEPARATOR_STR +L"example_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"slicerCaches" + FILE_SEPARATOR_STR + L"slicerCache2.bin");
std::vector<char> fileContent;
std::vector<char> exampleContent;
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
}