From 766ce853d18da813e8d435776f462470cd072538 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 6 Dec 2019 15:17:38 +0100 Subject: Swap expected and actual values in CPPUNIT_ASSERT... the first parameter is the expected value and the second the actual value. Passing them swapped is confusing if the test is failing. Change-Id: I06f8f345d52c3743d10441aae6d8c943f9b49b41 Reviewed-on: https://gerrit.libreoffice.org/84635 Reviewed-by: Eike Rathke Tested-by: Jenkins --- test/source/sheet/xspreadsheets2.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/source') diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index a65d68716c9a..fc7f1023fc1c 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -85,7 +85,7 @@ void XSpreadsheets2::testImportString() uno::Reference< text::XTextRange > xDestTextRange(xDestCell, UNO_QUERY_THROW); OUString aDestString = xDestTextRange->getString(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong string imported", aDestString, aSrcString); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong string imported", aSrcString, aDestString); } void XSpreadsheets2::testImportValue() @@ -119,7 +119,7 @@ void XSpreadsheets2::testImportFormulaBasicMath() // potential problem later: formulas might be adjusted // add some tests that the formulas are correctly adjusted - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula imported", aDestFormula, aSrcFormula); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula imported", aSrcFormula, aDestFormula); } void XSpreadsheets2::testImportFormulaWithNamedRange() @@ -135,7 +135,7 @@ void XSpreadsheets2::testImportFormulaWithNamedRange() uno::Reference< table::XCell > xDestCell = xDestSheet->getCellByPosition(3,0); OUString aDestFormula = xDestCell->getFormula(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Namedrange formula imported", aDestFormula, aSrcFormula); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Namedrange formula imported", aSrcFormula, aDestFormula); } void XSpreadsheets2::testImportOverExistingNamedRange() @@ -157,7 +157,7 @@ void XSpreadsheets2::testImportOverExistingNamedRange() OUString const aExpectedContent("$Sheet1.$B$1"); std::cout << "testImportSheet : initial1 aNrDestContent " << aNrDestContent << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for initial1", aNrDestContent, aExpectedContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for initial1", aExpectedContent, aNrDestContent); } @@ -182,7 +182,7 @@ void XSpreadsheets2::testImportNamedRangeDefinedInSource() std::cout << "testImportSheet : InSheetRangeName content " << aNewInSheetNrDestContent << std::endl; std::cout << "testImportSheet : InSheetRangeName expected " << aNewInSheetExpectedContent << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for InSheetRangeName", aNewInSheetNrDestContent, aNewInSheetExpectedContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for InSheetRangeName", aNewInSheetExpectedContent, aNewInSheetNrDestContent); } void XSpreadsheets2::testImportNamedRangeRedefinedInSource() @@ -204,7 +204,7 @@ void XSpreadsheets2::testImportNamedRangeRedefinedInSource() OUString aRedefinedInSheetNrDestContent = xDestRedefinedInSheetNamedRange->getContent(); OUString const aRedefinedInSheetExpectedContent("$Sheet1.$B$2"); std::cout << "testImportSheet : initial2 content " << aRedefinedInSheetNrDestContent << std::endl; - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for Redefined InSheet named range", aRedefinedInSheetNrDestContent, aRedefinedInSheetExpectedContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong address for Redefined InSheet named range", aRedefinedInSheetExpectedContent, aRedefinedInSheetNrDestContent); } void XSpreadsheets2::testImportNewNamedRange() @@ -258,7 +258,7 @@ void XSpreadsheets2::testImportCellStyle() OUString aDestStyleName; CPPUNIT_ASSERT(xDestCellPropSet->getPropertyValue(aCellProperty) >>= aDestStyleName); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong imported Cell Style", aDestStyleName, aSrcStyleName); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong imported Cell Style", aSrcStyleName, aDestStyleName); uno::Reference< style::XStyleFamiliesSupplier > xFamiliesSupplier (xDestDoc, UNO_QUERY_THROW); uno::Reference< container::XNameAccess > xFamiliesNameAccess (xFamiliesSupplier->getStyleFamilies(), UNO_SET_THROW); @@ -307,7 +307,7 @@ void XSpreadsheets2::importSheetToCopy() uno::Reference< sheet::XSpreadsheets2 > xDestSheets (xDestDoc->getSheets(), UNO_QUERY_THROW); sal_Int32 nDestPos = 0; sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, gaSrcSheetName, nDestPos); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, nDestPos); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPos, nDestPosEffective); uno::Reference< container::XIndexAccess > xDestSheetIndexAccess (xDestDoc->getSheets(), UNO_QUERY_THROW); xDestSheet.set( xDestSheetIndexAccess->getByIndex(nDestPosEffective), UNO_QUERY_THROW); -- cgit