cppcanvas/CppunitTest_cppcanvas_test.mk | 3 ++- cppcanvas/Module_cppcanvas.mk | 2 +- cppcanvas/qa/unit/test.cxx | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-)
New commits: commit 1f7a367f0d3722502561701cbafae448cb11cbb3 Author: Khaled Hosny <kha...@libreoffice.org> AuthorDate: Mon Jun 19 12:58:51 2023 +0300 Commit: خالد حسني <kha...@libreoffice.org> CommitDate: Mon Jun 19 20:46:13 2023 +0200 CppunitTest_cppcanvas_test: generalize testComposite Make it pass without cairo canvas. Change-Id: I81dd5d21bde6d1e09c2e8eeea75d05ddf1793d91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153263 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@libreoffice.org> diff --git a/cppcanvas/CppunitTest_cppcanvas_test.mk b/cppcanvas/CppunitTest_cppcanvas_test.mk index 020015da3aa3..9e9a1c9eaf60 100644 --- a/cppcanvas/CppunitTest_cppcanvas_test.mk +++ b/cppcanvas/CppunitTest_cppcanvas_test.mk @@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_vcl,cppcanvas_test)) $(eval $(call gb_CppunitTest_use_components,cppcanvas_test,\ $(if $(ENABLE_CAIRO_CANVAS),canvas/source/cairo/cairocanvas) \ + canvas/source/vcl/vclcanvas \ canvas/source/factory/canvasfactory \ configmgr/source/configmgr \ i18npool/util/i18npool \ diff --git a/cppcanvas/qa/unit/test.cxx b/cppcanvas/qa/unit/test.cxx index 1ad9139641a8..9454df0f2ecc 100644 --- a/cppcanvas/qa/unit/test.cxx +++ b/cppcanvas/qa/unit/test.cxx @@ -30,12 +30,10 @@ public: CPPUNIT_TEST_FIXTURE(CanvasTest, testComposite) { -#if ENABLE_CAIRO_CANVAS ScopedVclPtrInstance<WorkWindow> pWin( nullptr, WB_STDWORK ); uno::Reference<rendering::XCanvas> xCanvas = pWin->GetOutDev()->GetCanvas (); - if( !xCanvas.is() ) - return; // can't get a canvas working at all - truly headless ? + CPPUNIT_ASSERT(xCanvas.is()); // a huge canvas ... Size aSize (1, 1); @@ -70,8 +68,6 @@ CPPUNIT_TEST_FIXTURE(CanvasTest, testComposite) XCachedPrimitive fillPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState ) #endif } - -#endif } CPPUNIT_PLUGIN_IMPLEMENT(); commit fc72d1d0c635031b577a12ffbfa79bd04adbae66 Author: Khaled Hosny <kha...@libreoffice.org> AuthorDate: Mon Jun 19 12:56:50 2023 +0300 Commit: خالد حسني <kha...@libreoffice.org> CommitDate: Mon Jun 19 20:46:03 2023 +0200 CppunitTest_cppcanvas_test: enable even if cairo canvas is not I want to add more tests to it. Change-Id: Ibadfbafbaa6d6b1cfc1f9aa3761a04de2e2c1f09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153262 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@libreoffice.org> diff --git a/cppcanvas/CppunitTest_cppcanvas_test.mk b/cppcanvas/CppunitTest_cppcanvas_test.mk index e6e7a39d3bae..020015da3aa3 100644 --- a/cppcanvas/CppunitTest_cppcanvas_test.mk +++ b/cppcanvas/CppunitTest_cppcanvas_test.mk @@ -39,7 +39,7 @@ $(eval $(call gb_CppunitTest_use_ure,cppcanvas_test)) $(eval $(call gb_CppunitTest_use_vcl,cppcanvas_test)) $(eval $(call gb_CppunitTest_use_components,cppcanvas_test,\ - canvas/source/cairo/cairocanvas \ + $(if $(ENABLE_CAIRO_CANVAS),canvas/source/cairo/cairocanvas) \ canvas/source/factory/canvasfactory \ configmgr/source/configmgr \ i18npool/util/i18npool \ diff --git a/cppcanvas/Module_cppcanvas.mk b/cppcanvas/Module_cppcanvas.mk index b341bc00d60b..2522c0a02007 100644 --- a/cppcanvas/Module_cppcanvas.mk +++ b/cppcanvas/Module_cppcanvas.mk @@ -25,11 +25,11 @@ $(eval $(call gb_Module_add_targets,cppcanvas,\ )) # FIXME: should generalize these ... -ifeq ($(ENABLE_CAIRO_CANVAS),TRUE) $(eval $(call gb_Module_add_check_targets,cppcanvas,\ CppunitTest_cppcanvas_test \ )) +ifeq ($(ENABLE_CAIRO_CANVAS),TRUE) ifneq ($(DISPLAY),) $(eval $(call gb_Module_add_slowcheck_targets,cppcanvas,\ CppunitTest_cppcanvas_emfplus \ diff --git a/cppcanvas/qa/unit/test.cxx b/cppcanvas/qa/unit/test.cxx index ff3fc215f224..1ad9139641a8 100644 --- a/cppcanvas/qa/unit/test.cxx +++ b/cppcanvas/qa/unit/test.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <config_cairo_canvas.h> + #include <sal/config.h> #include <test/bootstrapfixture.hxx> @@ -28,7 +30,7 @@ public: CPPUNIT_TEST_FIXTURE(CanvasTest, testComposite) { -#ifdef LINUX +#if ENABLE_CAIRO_CANVAS ScopedVclPtrInstance<WorkWindow> pWin( nullptr, WB_STDWORK ); uno::Reference<rendering::XCanvas> xCanvas = pWin->GetOutDev()->GetCanvas ();