1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/bootstrapfixture.hxx>
11 #include <cppunit/TestAssert.h>
13 #include <vcl/animate/Animation.hxx>
15 class VclAnimationTest
: public test::BootstrapFixture
19 : BootstrapFixture(true, false)
23 void testFrameCount();
24 void testDisplaySize();
26 CPPUNIT_TEST_SUITE(VclAnimationTest
);
27 CPPUNIT_TEST(testFrameCount
);
28 CPPUNIT_TEST(testDisplaySize
);
29 CPPUNIT_TEST_SUITE_END();
32 void VclAnimationTest::testFrameCount()
36 CPPUNIT_ASSERT_EQUAL(size_t(0), aAnimation
.Count());
39 AnimationFrame(BitmapEx(Size(3, 4), vcl::PixelFormat::N24_BPP
), Point(0, 0), Size(3, 4)));
40 CPPUNIT_ASSERT_EQUAL(size_t(1), aAnimation
.Count());
43 AnimationFrame(BitmapEx(Size(3, 3), vcl::PixelFormat::N24_BPP
), Point(0, 0), Size(10, 10)));
44 CPPUNIT_ASSERT_EQUAL(size_t(2), aAnimation
.Count());
47 CPPUNIT_ASSERT_EQUAL(size_t(0), aAnimation
.Count());
50 void VclAnimationTest::testDisplaySize()
53 CPPUNIT_ASSERT_EQUAL(Size(0, 0), aAnimation
.GetDisplaySizePixel());
56 AnimationFrame(BitmapEx(Size(3, 4), vcl::PixelFormat::N24_BPP
), Point(0, 0), Size(3, 4)));
57 CPPUNIT_ASSERT_EQUAL(Size(3, 4), aAnimation
.GetDisplaySizePixel());
59 aAnimation
.Insert(AnimationFrame(BitmapEx(Size(10, 10), vcl::PixelFormat::N24_BPP
), Point(0, 0),
61 CPPUNIT_ASSERT_EQUAL(Size(10, 10), aAnimation
.GetDisplaySizePixel());
64 CPPUNIT_ASSERT_EQUAL(Size(0, 0), aAnimation
.GetDisplaySizePixel());
67 CPPUNIT_TEST_SUITE_REGISTRATION(VclAnimationTest
);
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */