kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0334-CppunitTest_sw_tiledrendering-replace-various-ifdefs.patch

f325b2
From 2a75ef1ce370310a06b30de34799c0cb39f6bfea Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Sat, 14 Nov 2015 15:35:18 +0100
f325b2
Subject: [PATCH 334/398] CppunitTest_sw_tiledrendering: replace various ifdefs
f325b2
 with a single condition
f325b2
f325b2
LOK is Linux-only at the moment, don't bother with disabling each and
f325b2
every unit test on Mac/Windows for now.
f325b2
f325b2
Change-Id: I2ff1ed47251c16ec6a8d43138789480d95ea720e
f325b2
(cherry picked from commit 18dfcbb11a05b7e702dc2161df9db8386a7ca34b)
f325b2
---
f325b2
 sw/Module_sw.mk                                |  7 +++++-
f325b2
 sw/qa/extras/tiledrendering/tiledrendering.cxx | 34 +-------------------------
f325b2
 2 files changed, 7 insertions(+), 34 deletions(-)
f325b2
f325b2
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
f325b2
index 13453b5beb10..80b1ffb85e14 100644
f325b2
--- a/sw/Module_sw.mk
f325b2
+++ b/sw/Module_sw.mk
f325b2
@@ -68,11 +68,16 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
f325b2
     CppunitTest_sw_odfexport \
f325b2
     CppunitTest_sw_odfimport \
f325b2
     CppunitTest_sw_uiwriter \
f325b2
-    CppunitTest_sw_tiledrendering \
f325b2
     CppunitTest_sw_mailmerge \
f325b2
     CppunitTest_sw_globalfilter \
f325b2
 ))
f325b2
 
f325b2
+ifeq ($(OS),LINUX)
f325b2
+$(eval $(call gb_Module_add_slowcheck_targets,sw,\
f325b2
+    CppunitTest_sw_tiledrendering \
f325b2
+))
f325b2
+endif
f325b2
+
f325b2
 ifneq ($(DISABLE_CVE_TESTS),TRUE)
f325b2
 $(eval $(call gb_Module_add_slowcheck_targets,sw,\
f325b2
     CppunitTest_sw_filters_test \
f325b2
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
f325b2
index 4598c50e5842..9f85fe8e1290 100644
f325b2
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
f325b2
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
f325b2
@@ -150,18 +150,6 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
f325b2
 
f325b2
 void SwTiledRenderingTest::testRegisterCallback()
f325b2
 {
f325b2
-#ifdef MACOSX
f325b2
-    // For some reason this particular test requires window system access on OS X.
f325b2
-
f325b2
-    // Without window system access, we do get a number of "<<<WARNING>>>
f325b2
-    // AquaSalGraphics::CheckContext() FAILED!!!!" [sic] and " <Warning>: CGSConnectionByID: 0 is
f325b2
-    // not a valid connection ID" warnings while running the other tests, too, but they still
f325b2
-    // succeed.
f325b2
-
f325b2
-    if (!vcl::IsWindowSystemAvailable())
f325b2
-        return;
f325b2
-#endif
f325b2
-
f325b2
     SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
f325b2
     pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
f325b2
     SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
f325b2
@@ -170,13 +158,8 @@ void SwTiledRenderingTest::testRegisterCallback()
f325b2
 
f325b2
     // Check that the top left 256x256px tile would be invalidated.
f325b2
     CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, assuming 96 DPI.
f325b2
-    // FIXME - fails on Windows since about cbd48230bb3a90c4c485fa33123c6653234e02e9
f325b2
-    // [plus minus few commits maybe]
f325b2
-    // Also on OS X. But is tiled rendering even supposed to work on Windows and OS X?
f325b2
     CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testPostKeyEvent()
f325b2
@@ -290,9 +273,7 @@ void SwTiledRenderingTest::testSetGraphicSelection()
f325b2
     Rectangle aShapeAfter = pObject->GetSnapRect();
f325b2
     // Check that a resize happened, but aspect ratio is not kept.
f325b2
     CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
f325b2
-#if !defined(MACOSX) // FIXME
f325b2
     CPPUNIT_ASSERT_EQUAL(aShapeBefore.getHeight() + 1000, aShapeAfter.getHeight());
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testResetSelection()
f325b2
@@ -322,7 +303,6 @@ void SwTiledRenderingTest::testResetSelection()
f325b2
     CPPUNIT_ASSERT(!pWrtShell->IsSelFrmMode());
f325b2
 }
f325b2
 
f325b2
-#if !(defined WNT || defined MACOSX)
f325b2
 void lcl_search(bool bBackward)
f325b2
 {
f325b2
     uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
f325b2
@@ -332,11 +312,9 @@ void lcl_search(bool bBackward)
f325b2
     }));
f325b2
     comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
f325b2
 }
f325b2
-#endif
f325b2
 
f325b2
 void SwTiledRenderingTest::testSearch()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     comphelper::LibreOfficeKit::setActive();
f325b2
 
f325b2
     SwXTextDocument* pXTextDocument = createDoc("search.odt");
f325b2
@@ -377,12 +355,10 @@ void SwTiledRenderingTest::testSearch()
f325b2
     CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
f325b2
 
f325b2
     comphelper::LibreOfficeKit::setActive(false);
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testSearchViewArea()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     SwXTextDocument* pXTextDocument = createDoc("search.odt");
f325b2
     SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
f325b2
     // Go to the second page, 1-based.
f325b2
@@ -404,12 +380,10 @@ void SwTiledRenderingTest::testSearchViewArea()
f325b2
     comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
f325b2
     // This was just "Heading", i.e. SwView::SearchAndWrap() did not search from only the top of the second page.
f325b2
     CPPUNIT_ASSERT_EQUAL(OUString("Heading on second page"), pShellCrsr->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testSearchTextFrame()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     comphelper::LibreOfficeKit::setActive();
f325b2
 
f325b2
     SwXTextDocument* pXTextDocument = createDoc("search.odt");
f325b2
@@ -424,12 +398,10 @@ void SwTiledRenderingTest::testSearchTextFrame()
f325b2
     CPPUNIT_ASSERT(!m_aTextSelection.isEmpty());
f325b2
 
f325b2
     comphelper::LibreOfficeKit::setActive(false);
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testSearchTextFrameWrapAround()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     SwXTextDocument* pXTextDocument = createDoc("search.odt");
f325b2
     pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
f325b2
     uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
f325b2
@@ -442,12 +414,10 @@ void SwTiledRenderingTest::testSearchTextFrameWrapAround()
f325b2
     comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
f325b2
     // This failed, i.e. the second time 'not found' was reported, instead of wrapping around.
f325b2
     CPPUNIT_ASSERT(m_bFound);
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testDocumentSizeChanged()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     // Get the current document size.
f325b2
     SwXTextDocument* pXTextDocument = createDoc("2-pages.odt");
f325b2
     pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
f325b2
@@ -462,12 +432,10 @@ void SwTiledRenderingTest::testDocumentSizeChanged()
f325b2
     CPPUNIT_ASSERT_EQUAL(aSize.getWidth(), m_aDocumentSize.getWidth());
f325b2
     // Document height should be smaller now.
f325b2
     CPPUNIT_ASSERT(aSize.getHeight() > m_aDocumentSize.getHeight());
f325b2
-#endif
f325b2
 }
f325b2
 
f325b2
 void SwTiledRenderingTest::testSearchAll()
f325b2
 {
f325b2
-#if !defined(WNT) && !defined(MACOSX)
f325b2
     comphelper::LibreOfficeKit::setActive();
f325b2
 
f325b2
     SwXTextDocument* pXTextDocument = createDoc("search.odt");
f325b2
@@ -485,8 +453,8 @@ void SwTiledRenderingTest::testSearchAll()
f325b2
     CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]);
f325b2
 
f325b2
     comphelper::LibreOfficeKit::setActive(false);
f325b2
-#endif
f325b2
 }
f325b2
+
f325b2
 CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
f325b2
 
f325b2
 CPPUNIT_PLUGIN_IMPLEMENT();
f325b2
-- 
f325b2
2.12.0
f325b2