sc/qa/unit/PivotTableFormatsImportExport.cxx | 181 ++++++--------------------- 1 file changed, 41 insertions(+), 140 deletions(-)
New commits: commit 7b7f1c3880c05eb9c2ee941b70025bac0a6decda Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed May 1 21:48:27 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 2 08:18:25 2024 +0200 workaround compiler crash on macos affects x86 and clang-13, crash looks like 1 llvm::APInt::APInt(unsigned int, llvm::ArrayRef<unsigned long long>) + 112 2 (anonymous namespace)::StmtPrinter::VisitUserDefinedLiteral(clang::UserDefinedLiteral*) + 1019 3 (anonymous namespace)::StmtPrinter::VisitInitListExpr(clang::InitListExpr*) + 189 4 clang::Stmt::printPretty(llvm::raw_ostream&, clang::PrinterHelper*, clang::PrintingPolicy const&, unsigned int, llvm::StringRef, clang::ASTContext const*) const + 165 5 clang::APValue::printPretty(llvm::raw_ostream&, clang::PrintingPolicy const&, clang::QualType, clang::ASTContext const*) const + 3357 6 (anonymous namespace)::CallStackFrame::describe(llvm::raw_ostream&) + 569 7 clang::interp::State::addCallStack(unsigned int) + 388 8 clang::interp::State::diag(clang::SourceLocation, unsigned int, unsigned int, bool) + 277 9 CheckConstexprFunction((anonymous namespace)::EvalInfo&, clang::SourceLocation, clang::FunctionDe cl const*, clang::FunctionDecl const*, clang::Stmt const*) + 282 Change-Id: I24a111f064fc17e289a4a6c8e7a40c776fa71e43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166986 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx b/sc/qa/unit/PivotTableFormatsImportExport.cxx index 3477d574918c..33d0adc8f6f5 100644 --- a/sc/qa/unit/PivotTableFormatsImportExport.cxx +++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx @@ -82,21 +82,10 @@ static void assertDataFieldInRow_RowLabelColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getFontColor(rDoc, u"G7"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"G5"_ustr, - u"H5"_ustr, - u"I5"_ustr, - u"J5"_ustr, - u"K5"_ustr, - u"H6"_ustr, - u"I6"_ustr, - u"J6"_ustr, - u"K6"_ustr, - u"H7"_ustr, - u"I7"_ustr, - u"J7"_ustr, - u"K7"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"G5"_ustr, u"H5"_ustr, u"I5"_ustr, u"J5"_ustr, u"K5"_ustr, u"H6"_ustr, u"I6"_ustr, + u"J6"_ustr, u"K6"_ustr, u"H7"_ustr, u"I7"_ustr, u"J7"_ustr, u"K7"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -114,22 +103,10 @@ static void assertDataFieldInRow_ColumnLabelColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(Color(0x00B050), getBackgroundColor(rDoc, u"H5"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"G5"_ustr, - u"I5"_ustr, - u"J5"_ustr, - u"K5"_ustr, - u"G6"_ustr, - u"H6"_ustr, - u"I6"_ustr, - u"J6"_ustr, - u"K6"_ustr, - u"G7"_ustr, - u"H7"_ustr, - u"I7"_ustr, - u"J7"_ustr, - u"K7"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"G5"_ustr, u"I5"_ustr, u"J5"_ustr, u"K5"_ustr, u"G6"_ustr, u"H6"_ustr, u"I6"_ustr, + u"J6"_ustr, u"K6"_ustr, u"G7"_ustr, u"H7"_ustr, u"I7"_ustr, u"J7"_ustr, u"K7"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -149,21 +126,10 @@ static void assertDataFieldInColumn_ColumnLabelColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(Color(0x92D050), getBackgroundColor(rDoc, u"I5"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"G5"_ustr, - u"G6"_ustr, - u"H6"_ustr, - u"I6"_ustr, - u"G7"_ustr, - u"H7"_ustr, - u"I7"_ustr, - u"G8"_ustr, - u"H8"_ustr, - u"I8"_ustr, - u"G9"_ustr, - u"H9"_ustr, - u"I9"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"G5"_ustr, u"G6"_ustr, u"H6"_ustr, u"I6"_ustr, u"G7"_ustr, u"H7"_ustr, u"I7"_ustr, + u"G8"_ustr, u"H8"_ustr, u"I8"_ustr, u"G9"_ustr, u"H9"_ustr, u"I9"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -182,21 +148,10 @@ static void assertDataFieldInColumn_DataColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getFontColor(rDoc, u"H7"_ustr)); CPPUNIT_ASSERT_EQUAL(Color(0x92D050), getBackgroundColor(rDoc, u"I9"_ustr)); - auto aEmptyAddresses = std::to_array<OUString>({ - u"G5"_ustr, - u"H5"_ustr, - u"I5"_ustr, - u"G6"_ustr, - u"H6"_ustr, - u"I6"_ustr, - u"G7"_ustr, - u"I7"_ustr, - u"G8"_ustr, - u"H8"_ustr, - u"I8"_ustr, - u"G9"_ustr, - u"H9"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"G5"_ustr, u"H5"_ustr, u"I5"_ustr, u"G6"_ustr, u"H6"_ustr, u"I6"_ustr, u"G7"_ustr, + u"I7"_ustr, u"G8"_ustr, u"H8"_ustr, u"I8"_ustr, u"G9"_ustr, u"H9"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -215,14 +170,14 @@ static void assertDataFieldInColumnAndTwoRowFields_DataColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getBackgroundColor(rDoc, u"I11"_ustr)); CPPUNIT_ASSERT_EQUAL(Color(0x0070C0), getBackgroundColor(rDoc, u"J13"_ustr)); - auto aEmptyAddresses = std::to_array<OUString>({ + std::vector<OUString> aEmptyAddresses{ u"G5"_ustr, u"H5"_ustr, u"I5"_ustr, u"J5"_ustr, u"G6"_ustr, u"H6"_ustr, u"I6"_ustr, u"J6"_ustr, u"G7"_ustr, u"H7"_ustr, u"I7"_ustr, u"J7"_ustr, u"G8"_ustr, u"H8"_ustr, u"J8"_ustr, u"G9"_ustr, u"H9"_ustr, u"I9"_ustr, u"J9"_ustr, u"G10"_ustr, u"H10"_ustr, u"I10"_ustr, u"J10"_ustr, u"G11"_ustr, u"H11"_ustr, u"J11"_ustr, u"G12"_ustr, u"H12"_ustr, u"I12"_ustr, u"J12"_ustr, u"G13"_ustr, u"H13"_ustr, u"I13"_ustr, u"G14"_ustr, u"H14"_ustr, u"I14"_ustr, u"J14"_ustr, - }); + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -278,21 +233,10 @@ static void assertDataFieldInRow_DataColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"K7"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"G5"_ustr, - u"H5"_ustr, - u"I5"_ustr, - u"J5"_ustr, - u"K5"_ustr, - u"G6"_ustr, - u"H6"_ustr, - u"J6"_ustr, - u"K6"_ustr, - u"G7"_ustr, - u"H7"_ustr, - u"I7"_ustr, - u"J7"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"G5"_ustr, u"H5"_ustr, u"I5"_ustr, u"J5"_ustr, u"K5"_ustr, u"G6"_ustr, u"H6"_ustr, + u"J6"_ustr, u"K6"_ustr, u"G7"_ustr, u"H7"_ustr, u"I7"_ustr, u"J7"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); }; @@ -353,18 +297,10 @@ static void assertWholeDataColumnSelected(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"G7"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"F1"_ustr, - u"G1"_ustr, - u"F2"_ustr, - u"F3"_ustr, - u"F4"_ustr, - u"F5"_ustr, - u"F6"_ustr, - u"F7"_ustr, - u"F8"_ustr, - u"G8"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"F1"_ustr, u"G1"_ustr, u"F2"_ustr, u"F3"_ustr, u"F4"_ustr, + u"F5"_ustr, u"F6"_ustr, u"F7"_ustr, u"F8"_ustr, u"G8"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -387,18 +323,10 @@ static void assertWholeLabelColumnSelected(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getBackgroundColor(rDoc, u"F7"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"F1"_ustr, - u"G1"_ustr, - u"G2"_ustr, - u"G3"_ustr, - u"G4"_ustr, - u"G5"_ustr, - u"G6"_ustr, - u"G7"_ustr, - u"F8"_ustr, - u"G8"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"F1"_ustr, u"G1"_ustr, u"G2"_ustr, u"G3"_ustr, u"G4"_ustr, + u"G5"_ustr, u"G6"_ustr, u"G7"_ustr, u"F8"_ustr, u"G8"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -417,22 +345,10 @@ static void assertSelectionInLabelAndData(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getBackgroundColor(rDoc, u"G5"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"F1"_ustr, - u"G1"_ustr, - u"F2"_ustr, - u"G2"_ustr, - u"F3"_ustr, - u"G3"_ustr, - u"F4"_ustr, - u"G4"_ustr, - u"F6"_ustr, - u"G6"_ustr, - u"F7"_ustr, - u"G7"_ustr, - u"F8"_ustr, - u"G8"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"F1"_ustr, u"G1"_ustr, u"F2"_ustr, u"G2"_ustr, u"F3"_ustr, u"G3"_ustr, u"F4"_ustr, + u"G4"_ustr, u"F6"_ustr, u"G6"_ustr, u"F7"_ustr, u"G7"_ustr, u"F8"_ustr, u"G8"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -451,14 +367,14 @@ static void assertTwoRowsDataFieldInColumn_LabelColor(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getBackgroundColor(rDoc, u"J5"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ + std::vector<OUString> aEmptyAddresses{ u"G5"_ustr, u"H5"_ustr, u"G6"_ustr, u"H6"_ustr, u"i6"_ustr, u"j6"_ustr, u"G7"_ustr, u"H7"_ustr, u"i7"_ustr, u"j7"_ustr, u"G8"_ustr, u"H8"_ustr, u"i8"_ustr, u"j8"_ustr, u"G9"_ustr, u"H9"_ustr, u"i9"_ustr, u"j9"_ustr, u"G10"_ustr, u"H10"_ustr, u"i10"_ustr, u"j10"_ustr, u"G11"_ustr, u"H11"_ustr, u"i11"_ustr, u"j11"_ustr, u"G12"_ustr, u"H12"_ustr, u"i12"_ustr, u"j12"_ustr, u"G13"_ustr, u"H13"_ustr, u"i13"_ustr, u"j13"_ustr, u"G14"_ustr, u"H14"_ustr, u"i14"_ustr, u"j14"_ustr, - }); + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); } @@ -482,26 +398,11 @@ static void assertTwoDataFieldColumns_WholeDataColumnSelected(ScDocument& rDoc) CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"H8"_ustr)); // Make sure the other cells have the font color or background set to default - auto aEmptyAddresses = std::to_array<OUString>({ - u"F1"_ustr, - u"G1"_ustr, - u"H1"_ustr, - u"F2"_ustr, - u"G2"_ustr, - u"H2"_ustr, - u"F3"_ustr, - u"G3"_ustr, - u"F4"_ustr, - u"G4"_ustr, - u"F5"_ustr, - u"G5"_ustr, - u"F6"_ustr, - u"G6"_ustr, - u"F7"_ustr, - u"G7"_ustr, - u"F8"_ustr, - u"G8"_ustr, - }); + std::vector<OUString> aEmptyAddresses{ + u"F1"_ustr, u"G1"_ustr, u"H1"_ustr, u"F2"_ustr, u"G2"_ustr, u"H2"_ustr, + u"F3"_ustr, u"G3"_ustr, u"F4"_ustr, u"G4"_ustr, u"F5"_ustr, u"G5"_ustr, + u"F6"_ustr, u"G6"_ustr, u"F7"_ustr, u"G7"_ustr, u"F8"_ustr, u"G8"_ustr, + }; CPPUNIT_ASSERT_EQUAL(OUString(), checkNonEmptyAddresses(rDoc, aEmptyAddresses)); }