Kaydet (Commit) 23159e5a authored tarafından Ursache Vladimir's avatar Ursache Vladimir Kaydeden (comit) Markus Mohrhard

tdf#68117 Unit test

Change-Id: I2c1b935648ea2728878f606dfe8a141c3c1ddda2
üst 480de8e2
......@@ -18,6 +18,9 @@
#include <sfx2/docfile.hxx>
#include <sfx2/sfxmodelfactory.hxx>
#include <svl/stritem.hxx>
#include <svl/nfkeytab.hxx>
//#include <zformat.hxx>
#include <svl/zformat.hxx>
#include <svx/svdograf.hxx>
#include "drwlayer.hxx"
......@@ -86,6 +89,7 @@ public:
virtual void tearDown() SAL_OVERRIDE;
//ods, xls, xlsx filter tests
void testBooleanFormatXLSX();
void testBasicCellContentODS();
void testRangeNameXLS();
void testRangeNameLocalXLS();
......@@ -186,6 +190,7 @@ public:
void testEmbeddedImageXLS();
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBooleanFormatXLSX);
CPPUNIT_TEST(testBasicCellContentODS);
CPPUNIT_TEST(testRangeNameXLS);
CPPUNIT_TEST(testRangeNameLocalXLS);
......@@ -352,6 +357,27 @@ void ScFiltersTest::testBasicCellContentODS()
xDocSh->DoClose();
}
void ScFiltersTest::testBooleanFormatXLSX()
{
ScDocShellRef xDocSh = loadDoc("check-boolean.", XLSX);
ScDocument& rDoc = xDocSh->GetDocument();
SvNumberFormatter *pNumFormatter = rDoc.GetFormatTable();
const OUString aBooleanTypeStr = "\"TRUE\";\"TRUE\";\"FALSE\"";
CPPUNIT_ASSERT_MESSAGE("Failed to load check-boolean.xlsx", xDocSh.Is());
sal_uInt32 nNumberFormat;
for (SCROW i = 0; i <= 1; i++)
{
rDoc.GetNumberFormat(0, i, 0, nNumberFormat);
const SvNumberformat *pSvnumberFormat = pNumFormatter->GetEntry(nNumberFormat);
const OUString &rFormatStr = pSvnumberFormat->GetFormatstring();
CPPUNIT_ASSERT_MESSAGE("Number format != boolean", rFormatStr == aBooleanTypeStr);
}
xDocSh->DoClose();
}
void ScFiltersTest::testRangeNameXLS()
{
ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment