Add pivot tables tests

This commit is contained in:
Viktor Andreev
2023-12-07 21:10:08 +06:00
parent 5c7f07f71d
commit daba967cdc
2 changed files with 39 additions and 0 deletions

View File

@ -309,4 +309,43 @@ TEST_F(XlsbSimpleTests2, SlicerCacheTest)
ASSERT_EQ(fileContent, exampleContent);
}
TEST_F(XlsbSimpleTests2, PivotTableTest)
{
auto tempDir = XlsbSimpleTests2::tempDir;
std::wstring path1(tempDir + FILE_SEPARATOR_STR + L"result_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotTables" + FILE_SEPARATOR_STR + L"pivotTable2.bin");
std::wstring path2(tempDir + FILE_SEPARATOR_STR +L"example_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotTables" + FILE_SEPARATOR_STR + L"pivotTable2.bin");
std::vector<char> fileContent;
std::vector<char> exampleContent;
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
TEST_F(XlsbSimpleTests2, PivotCacheDefTest)
{
auto tempDir = XlsbSimpleTests2::tempDir;
std::wstring path1(tempDir + FILE_SEPARATOR_STR + L"result_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotCache" + FILE_SEPARATOR_STR + L"pivotCacheDefinition2.bin");
std::wstring path2(tempDir + FILE_SEPARATOR_STR +L"example_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotCache" + FILE_SEPARATOR_STR + L"pivotCacheDefinition2.bin");
std::vector<char> fileContent;
std::vector<char> exampleContent;
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
TEST_F(XlsbSimpleTests2, PivotCacheRecordsTest)
{
auto tempDir = XlsbSimpleTests2::tempDir;
std::wstring path1(tempDir + FILE_SEPARATOR_STR + L"result_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotCache" + FILE_SEPARATOR_STR + L"pivotCacheRecords2.bin");
std::wstring path2(tempDir + FILE_SEPARATOR_STR +L"example_unpacked"+ FILE_SEPARATOR_STR + L"xl" +
FILE_SEPARATOR_STR + L"pivotCache" + FILE_SEPARATOR_STR + L"pivotCacheRecords2.bin");
std::vector<char> fileContent;
std::vector<char> exampleContent;
ASSERT_EQ(readBinaryFiles(path1, path2, fileContent, exampleContent), 0);
ASSERT_EQ(fileContent, exampleContent);
}
}