From: Xisco Fauli Date: Fri, 23 Dec 2022 14:43:27 +0000 (+0100) Subject: [PATCH] CppunitTest_sc_subsequent_filters_test2: fix test depending on current year X-Git-Tag: archive/raspbian/1%7.3.0_rc2-2+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4e518096bd1f82a4715d2c3243cc3375d84a3b59;p=libreoffice.git [PATCH] 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 Gbp-Pq: Name fix-Tdf126116-test.diff --- diff --git a/sc/qa/unit/data/fods/tdf126116.fods b/sc/qa/unit/data/fods/tdf126116.fods new file mode 100644 index 00000000000..2db351642f7 --- /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/subsequent_filters-test2.cxx b/sc/qa/unit/subsequent_filters-test2.cxx index 9c15eebfff0..18a571e0853 100644 --- a/sc/qa/unit/subsequent_filters-test2.cxx +++ b/sc/qa/unit/subsequent_filters-test2.cxx @@ -1357,7 +1357,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(); @@ -1365,10 +1365,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(); }