Bump version to 6.4-15
[LibreOffice.git] / basegfx / test / B2DPointTest.cxx
blob77fa61d90b9d04dd5542e1a6b69c9661d8093623
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <cppunit/TestFixture.h>
21 #include <cppunit/extensions/HelperMacros.h>
22 #include <basegfx/point/b2dpoint.hxx>
24 class B2DPointTest : public CppUnit::TestFixture
26 public:
27 void testCreation();
29 CPPUNIT_TEST_SUITE(B2DPointTest);
30 CPPUNIT_TEST(testCreation);
31 CPPUNIT_TEST_SUITE_END();
34 void B2DPointTest::testCreation()
36 basegfx::B2DPoint aPoint1(5.0, 2.0);
37 CPPUNIT_ASSERT_EQUAL(5.0, aPoint1.getX());
38 CPPUNIT_ASSERT_EQUAL(2.0, aPoint1.getY());
40 basegfx::B2DPoint aPoint2 = { 5.0, 2.0 };
41 CPPUNIT_ASSERT_EQUAL(5.0, aPoint2.getX());
42 CPPUNIT_ASSERT_EQUAL(2.0, aPoint2.getY());
44 std::vector<basegfx::B2DPoint> aPointVector{
45 { 5.0, 2.0 },
46 { 4.0, 3.0 },
48 CPPUNIT_ASSERT_EQUAL(5.0, aPointVector[0].getX());
49 CPPUNIT_ASSERT_EQUAL(2.0, aPointVector[0].getY());
50 CPPUNIT_ASSERT_EQUAL(4.0, aPointVector[1].getX());
51 CPPUNIT_ASSERT_EQUAL(3.0, aPointVector[1].getY());
54 CPPUNIT_TEST_SUITE_REGISTRATION(B2DPointTest);
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */