calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / vcl / qa / cppunit / animation.cxx
blobbbedacbdf3036173837fe07fff7f934b87371cd8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include <test/bootstrapfixture.hxx>
11 #include <cppunit/TestAssert.h>
13 #include <vcl/animate/Animation.hxx>
15 class VclAnimationTest : public test::BootstrapFixture
17 public:
18 VclAnimationTest()
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()
34 Animation aAnimation;
36 CPPUNIT_ASSERT_EQUAL(size_t(0), aAnimation.Count());
38 aAnimation.Insert(
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());
42 aAnimation.Insert(
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());
46 aAnimation.Clear();
47 CPPUNIT_ASSERT_EQUAL(size_t(0), aAnimation.Count());
50 void VclAnimationTest::testDisplaySize()
52 Animation aAnimation;
53 CPPUNIT_ASSERT_EQUAL(Size(0, 0), aAnimation.GetDisplaySizePixel());
55 aAnimation.Insert(
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),
60 Size(10, 10)));
61 CPPUNIT_ASSERT_EQUAL(Size(10, 10), aAnimation.GetDisplaySizePixel());
63 aAnimation.Clear();
64 CPPUNIT_ASSERT_EQUAL(Size(0, 0), aAnimation.GetDisplaySizePixel());
67 CPPUNIT_TEST_SUITE_REGISTRATION(VclAnimationTest);
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */