diff options
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 4 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_starmath.cxx | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index 692e2a8132a1..5d21670416ec 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -212,8 +212,8 @@ void ScFiltersTest::testTdf91979() Point aPos = aViewData.GetScrPos(MAXCOL - 1, 10000, SC_SPLIT_TOPLEFT, true); int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(0, 0), aViewData.GetPPTX()); int nRowHeight = ScViewData::ToPixel(pDoc->GetRowHeight(0, 0), aViewData.GetPPTY()); - CPPUNIT_ASSERT(aPos.getX() == (MAXCOL - 1) * nColWidth); - CPPUNIT_ASSERT(aPos.getY() == 10000 * nRowHeight); + CPPUNIT_ASSERT_EQUAL(static_cast<long>((MAXCOL - 1) * nColWidth), aPos.getX()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(10000 * nRowHeight), aPos.getY()); xComponent->dispose(); } diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index 91a14bd91a9f..05cddc500d8e 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -114,7 +114,7 @@ void Test::editMarker() m_pEditWindow->SetText(sMarkedText); m_pEditWindow->Flush(); OUString sFinalText = m_pEditWindow->GetText(); - CPPUNIT_ASSERT_MESSAGE("Should be equal text", sFinalText == sMarkedText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be equal text", sMarkedText, sFinalText); } { @@ -135,7 +135,7 @@ void Test::editMarker() m_pEditWindow->Flush(); OUString sFinalText = m_pEditWindow->GetText(); - CPPUNIT_ASSERT_MESSAGE("Should be a under b under c", sFinalText == sTargetText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be a under b under c", sTargetText, sFinalText); } { @@ -178,7 +178,7 @@ void Test::editUndoRedo() rEditEngine.SetText(0, sStringOne); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); - CPPUNIT_ASSERT_MESSAGE("Strings must match", sStringOne == sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Strings must match", sFinalText, sStringOne); } OUString sStringTwo("a over b"); @@ -186,7 +186,7 @@ void Test::editUndoRedo() rEditEngine.SetText(0, sStringTwo); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); - CPPUNIT_ASSERT_MESSAGE("Strings must match", sStringTwo == sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Strings must match", sFinalText, sStringTwo); } SfxRequest aUndo(SID_UNDO, SfxCallMode::SYNCHRON, SmDocShell::GetPool()); @@ -195,7 +195,7 @@ void Test::editUndoRedo() m_xDocShRef->Execute(aUndo); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); - CPPUNIT_ASSERT_MESSAGE("Strings much match", sStringOne == sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Strings much match", sFinalText, sStringOne); } { @@ -210,7 +210,7 @@ void Test::editUndoRedo() m_xDocShRef->Execute(aRedo); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); - CPPUNIT_ASSERT_MESSAGE("Strings much match", sStringOne == sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Strings much match", sFinalText, sStringOne); } { @@ -245,7 +245,7 @@ void Test::viewZoom() rEditEngine.SetText(0, sStringOne); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); - CPPUNIT_ASSERT_MESSAGE("Strings must match", sStringOne == sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Strings must match", sFinalText, sStringOne); } SmGraphicWindow &rGraphicWindow = m_pViewShell->GetGraphicWindow(); @@ -263,7 +263,7 @@ void Test::viewZoom() SfxRequest aZoomOut(SID_ZOOMOUT, SfxCallMode::SYNCHRON, m_pViewShell->GetPool()); m_pViewShell->Execute(aZoomOut); nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be equal", nFinalZoom == nOrigZoom); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be equal", nOrigZoom, nFinalZoom); } sal_uInt16 nOptimalZoom=0; @@ -281,7 +281,7 @@ void Test::viewZoom() SfxRequest aZoom(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON, aSet); m_pViewShell->Execute(aZoom); nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be optimal zoom", nFinalZoom == nOptimalZoom); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be optimal zoom", nOptimalZoom, nFinalZoom); } //To-Do: investigate GetPrinter logic of SvxZoomType::PAGEWIDTH/SvxZoomType::WHOLEPAGE to ensure @@ -327,7 +327,7 @@ void Test::viewZoom() SfxRequest aZoom(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON, aSet); m_pViewShell->Execute(aZoom); nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be 50%", nFinalZoom == 50); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be 50%", static_cast<sal_uInt16>(50), nFinalZoom); } { @@ -336,7 +336,7 @@ void Test::viewZoom() SfxRequest aZoom(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON, aSet); m_pViewShell->Execute(aZoom); nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be Clipped to 25%", nFinalZoom == 25); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be Clipped to 25%", static_cast<sal_uInt16>(25), nFinalZoom); } { @@ -345,7 +345,7 @@ void Test::viewZoom() SfxRequest aZoom(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON, aSet); m_pViewShell->Execute(aZoom); nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be Clipped to 800%", nFinalZoom == 800); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be Clipped to 800%", static_cast<sal_uInt16>(800), nFinalZoom); } } |