Kaydet (Commit) ba70050d authored tarafından Eike Rathke's avatar Eike Rathke

add test case document to unit tests, tdf#69552

Change-Id: I73da1e00dd2b19088fbbe7e999611835f2ed4882
üst bcace9ac
...@@ -271,6 +271,21 @@ void testFunctionsExcel2010_Impl( ScDocument& rDoc ) ...@@ -271,6 +271,21 @@ void testFunctionsExcel2010_Impl( ScDocument& rDoc )
} }
} }
void testCeilingFloor_Impl( ScDocument& rDoc )
{
// Original test case document is ceiling-floor.xlsx
// Sheet1.K1 has =AND(K3:K81) to evaluate all results.
const char* pORef = "Sheet1.K1";
OUString aRef( OUString::createFromAscii( pORef));
ScAddress aPos;
aPos.Parse(aRef);
if (!checkFormula( rDoc, aPos, "AND(K3:K81)"))
CPPUNIT_FAIL("Wrong formula.");
CPPUNIT_ASSERT_MESSAGE( OString( OString(pORef) + " result is error.").getStr(),
isFormulaWithoutError( rDoc, aPos));
CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos));
}
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -126,6 +126,11 @@ public: ...@@ -126,6 +126,11 @@ public:
void testFunctionsExcel2010XLS(); void testFunctionsExcel2010XLS();
void testFunctionsExcel2010ODS(); void testFunctionsExcel2010ODS();
void testCeilingFloor( sal_uLong nFormatType );
void testCeilingFloorXLSX();
void testCeilingFloorXLS();
void testCeilingFloorODS();
void testRelativePaths(); void testRelativePaths();
void testSheetProtection(); void testSheetProtection();
...@@ -182,13 +187,16 @@ public: ...@@ -182,13 +187,16 @@ public:
CPPUNIT_TEST(testSharedFormulaStringResultExportXLSX); CPPUNIT_TEST(testSharedFormulaStringResultExportXLSX);
CPPUNIT_TEST(testFunctionsExcel2010XLSX); CPPUNIT_TEST(testFunctionsExcel2010XLSX);
CPPUNIT_TEST(testFunctionsExcel2010XLS); CPPUNIT_TEST(testFunctionsExcel2010XLS);
CPPUNIT_TEST(testFunctionsExcel2010ODS);
CPPUNIT_TEST(testCeilingFloorXLSX);
CPPUNIT_TEST(testCeilingFloorXLS);
CPPUNIT_TEST(testCeilingFloorODS);
#if !defined(WNT) #if !defined(WNT)
CPPUNIT_TEST(testRelativePaths); CPPUNIT_TEST(testRelativePaths);
#endif #endif
CPPUNIT_TEST(testSheetProtection); CPPUNIT_TEST(testSheetProtection);
CPPUNIT_TEST(testPivotTableXLSX); CPPUNIT_TEST(testPivotTableXLSX);
CPPUNIT_TEST(testPivotTableTwoDataFieldsXLSX); CPPUNIT_TEST(testPivotTableTwoDataFieldsXLSX);
CPPUNIT_TEST(testFunctionsExcel2010ODS);
#if !defined(WNT) #if !defined(WNT)
CPPUNIT_TEST(testSupBookVirtualPath); CPPUNIT_TEST(testSupBookVirtualPath);
#endif #endif
...@@ -1988,6 +1996,37 @@ void ScExportTest::testFunctionsExcel2010XLS() ...@@ -1988,6 +1996,37 @@ void ScExportTest::testFunctionsExcel2010XLS()
testFunctionsExcel2010(XLS); testFunctionsExcel2010(XLS);
} }
void ScExportTest::testCeilingFloor( sal_uLong nFormatType )
{
ScDocShellRef xShell = loadDoc("ceiling-floor.", XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xShell.Is());
ScDocShellRef xDocSh = saveAndReload(xShell, nFormatType);
ScDocument& rDoc = xDocSh->GetDocument();
rDoc.CalcAll(); // perform hard re-calculation.
testCeilingFloor_Impl(rDoc);
xDocSh->DoClose();
}
void ScExportTest::testCeilingFloorXLSX()
{
testCeilingFloor(XLSX);
}
void ScExportTest::testCeilingFloorXLS()
{
// CEILING.PRECISE() and FLOOR.PRECISE() with one parameter only currently
// (2015-06-18) don't survive .xls save/reload and give NA()
//testCeilingFloor(XLS);
}
void ScExportTest::testCeilingFloorODS()
{
testCeilingFloor(ODS);
}
void ScExportTest::testRelativePaths() void ScExportTest::testRelativePaths()
{ {
ScDocShellRef xDocSh = loadDoc("fdo79305.", ODS); ScDocShellRef xDocSh = loadDoc("fdo79305.", ODS);
......
...@@ -107,6 +107,7 @@ public: ...@@ -107,6 +107,7 @@ public:
void testHardRecalcODS(); void testHardRecalcODS();
void testFunctionsODS(); void testFunctionsODS();
void testFunctionsExcel2010(); void testFunctionsExcel2010();
void testCeilingFloorXLSX();
void testCachedFormulaResultsODS(); void testCachedFormulaResultsODS();
void testCachedMatrixFormulaResultsODS(); void testCachedMatrixFormulaResultsODS();
void testFormulaDepAcrossSheetsODS(); void testFormulaDepAcrossSheetsODS();
...@@ -213,6 +214,7 @@ public: ...@@ -213,6 +214,7 @@ public:
CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testHardRecalcODS);
CPPUNIT_TEST(testFunctionsODS); CPPUNIT_TEST(testFunctionsODS);
CPPUNIT_TEST(testFunctionsExcel2010); CPPUNIT_TEST(testFunctionsExcel2010);
CPPUNIT_TEST(testCeilingFloorXLSX);
CPPUNIT_TEST(testCachedFormulaResultsODS); CPPUNIT_TEST(testCachedFormulaResultsODS);
CPPUNIT_TEST(testFormulaDepAcrossSheetsODS); CPPUNIT_TEST(testFormulaDepAcrossSheetsODS);
CPPUNIT_TEST(testFormulaDepDeleteContentsODS); CPPUNIT_TEST(testFormulaDepDeleteContentsODS);
...@@ -547,6 +549,18 @@ void ScFiltersTest::testFunctionsExcel2010() ...@@ -547,6 +549,18 @@ void ScFiltersTest::testFunctionsExcel2010()
xDocSh->DoClose(); xDocSh->DoClose();
} }
void ScFiltersTest::testCeilingFloorXLSX()
{
ScDocShellRef xDocSh = loadDoc("ceiling-floor.", XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xDocSh.Is());
ScDocument& rDoc = xDocSh->GetDocument();
rDoc.CalcAll(); // perform hard re-calculation.
testCeilingFloor_Impl(rDoc);
xDocSh->DoClose();
}
void ScFiltersTest::testCachedFormulaResultsODS() void ScFiltersTest::testCachedFormulaResultsODS()
{ {
{ {
......
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