summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorofftkp <parisoplop@gmail.com>2023-10-29 13:12:02 +0200
committerParis Oplopoios <parisoplop@gmail.com>2023-10-29 22:18:05 +0100
commit6d423ed9bb89da15bfd9ac3555cb01696458fa71 (patch)
treea55a74cab33fc4dc178cc2f9042e02ffc7f47c22 /vcl/qa
parent3b39360edc104f4ecfed1228b08812388f5126a1 (diff)
CppunitTest_vcl_animate: use CPPUNIT_TEST_FIXTURE
CPPUNIT_TEST_FIXTURE is easier to write tests for and separate if needed Change-Id: I2c478205847e4d15c0f8d65d498dd8d82079fa5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158616 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/animationrenderer.cxx45
1 files changed, 15 insertions, 30 deletions
diff --git a/vcl/qa/cppunit/animationrenderer.cxx b/vcl/qa/cppunit/animationrenderer.cxx
index 86ad06c47941..93f80970f2ea 100644
--- a/vcl/qa/cppunit/animationrenderer.cxx
+++ b/vcl/qa/cppunit/animationrenderer.cxx
@@ -31,6 +31,18 @@ public:
void ReleaseGraphics(bool) override {}
bool UsePolyPolygonForComplexGradient() override { return false; }
};
+
+Animation createAnimation()
+{
+ Animation aAnimation;
+
+ aAnimation.Insert(
+ AnimationFrame(BitmapEx(Size(3, 4), vcl::PixelFormat::N24_BPP), Point(0, 0), Size(10, 10)));
+ aAnimation.Insert(
+ AnimationFrame(BitmapEx(Size(3, 3), vcl::PixelFormat::N24_BPP), Point(0, 0), Size(10, 10)));
+
+ return aAnimation;
+}
}
class VclAnimationRendererTest : public test::BootstrapFixture
@@ -40,22 +52,9 @@ public:
: BootstrapFixture(true, false)
{
}
-
- void testMatching();
- void testDrawToPos();
- void testGetPosSizeWindow();
-
- CPPUNIT_TEST_SUITE(VclAnimationRendererTest);
- CPPUNIT_TEST(testMatching);
- CPPUNIT_TEST(testDrawToPos);
- CPPUNIT_TEST(testGetPosSizeWindow);
- CPPUNIT_TEST_SUITE_END();
-
-private:
- Animation createAnimation();
};
-void VclAnimationRendererTest::testMatching()
+CPPUNIT_TEST_FIXTURE(VclAnimationRendererTest, testMatching)
{
Animation aTestAnim = createAnimation();
ScopedVclPtrInstance<TestRenderingContext> pTestRC;
@@ -69,7 +68,7 @@ void VclAnimationRendererTest::testMatching()
CPPUNIT_ASSERT(pAnimationRenderer->matches(pTestRC, 0));
}
-void VclAnimationRendererTest::testDrawToPos()
+CPPUNIT_TEST_FIXTURE(VclAnimationRendererTest, testDrawToPos)
{
Animation aTestAnim = createAnimation();
ScopedVclPtrInstance<VirtualDevice> pTestRC;
@@ -84,7 +83,7 @@ void VclAnimationRendererTest::testDrawToPos()
CPPUNIT_ASSERT_EQUAL(Size(1, 1), pTestRC->GetOutputSizePixel());
}
-void VclAnimationRendererTest::testGetPosSizeWindow()
+CPPUNIT_TEST_FIXTURE(VclAnimationRendererTest, testGetPosSizeWindow)
{
Animation aTestAnim = createAnimation();
ScopedVclPtrInstance<TestRenderingContext> pTestRC;
@@ -102,20 +101,6 @@ void VclAnimationRendererTest::testGetPosSizeWindow()
CPPUNIT_ASSERT_EQUAL(Size(10, 10), aSize);
}
-Animation VclAnimationRendererTest::createAnimation()
-{
- Animation aAnimation;
-
- aAnimation.Insert(
- AnimationFrame(BitmapEx(Size(3, 4), vcl::PixelFormat::N24_BPP), Point(0, 0), Size(10, 10)));
- aAnimation.Insert(
- AnimationFrame(BitmapEx(Size(3, 3), vcl::PixelFormat::N24_BPP), Point(0, 0), Size(10, 10)));
-
- return aAnimation;
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION(VclAnimationRendererTest);
-
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */