From f4ab9cf69c3b1e9f17fc3873f160ddebd5f812fb Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 23 Dec 2022 15:43:27 +0100 Subject: CppunitTest_sc_subsequent_filters_test2: fix test depending on current year While at it, move the file from ods to fods for better tracking in git Change-Id: I16df221e3a7341dc7c53de6130158c3887c472a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127361 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sc/qa/unit/data/fods/tdf126116.fods | 170 ++++++++++++++++++++++++++++++++ sc/qa/unit/data/ods/tdf126116.ods | Bin 7813 -> 0 bytes sc/qa/unit/subsequent_filters_test2.cxx | 7 +- 3 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 sc/qa/unit/data/fods/tdf126116.fods delete mode 100644 sc/qa/unit/data/ods/tdf126116.ods diff --git a/sc/qa/unit/data/fods/tdf126116.fods b/sc/qa/unit/data/fods/tdf126116.fods new file mode 100644 index 000000000000..2db351642f73 --- /dev/null +++ b/sc/qa/unit/data/fods/tdf126116.fods @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + + Page 1 + + + + + + + + ???(???) + + + 00/00/0000, 00:00:00 + + + + + + Page 1/ 99 + + + + + + + + + + + + + + 02/02/21 + + + 21 + + + + + + + diff --git a/sc/qa/unit/data/ods/tdf126116.ods b/sc/qa/unit/data/ods/tdf126116.ods deleted file mode 100644 index c9fb2816e21c..000000000000 Binary files a/sc/qa/unit/data/ods/tdf126116.ods and /dev/null differ diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 71476a752f98..c2e6725ae316 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -1358,7 +1358,7 @@ void ScFiltersTest2::testTdf103734() void ScFiltersTest2::testTdf126116() { - ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_ODS); + ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_FODS); CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is()); ScDocument& rDoc = xDocSh->GetDocument(); @@ -1366,10 +1366,13 @@ void ScFiltersTest2::testTdf126116() rDoc.SetString(ScAddress(0, 0, 0), "03/03"); + // Get the current year from B1 with format YY + OUString aYear = rDoc.GetString(ScAddress(1, 0, 0)); + // Without the fix in place, this test would have failed with // - Expected: 03/03/21 // - Actual : 03/03/2021 - CPPUNIT_ASSERT_EQUAL(OUString("03/03/21"), rDoc.GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(OUString("03/03/" + aYear), rDoc.GetString(ScAddress(0, 0, 0))); xDocSh->DoClose(); } -- cgit