calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / tools / qa / cppunit / test_100mm2twips.cxx
blob1fb69d98209b60628e9e3bfe49e9d4a5779d92d5
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 <sal/types.h>
22 #include <cppunit/TestFixture.h>
23 #include <cppunit/extensions/HelperMacros.h>
25 #include <tools/UnitConversion.hxx>
27 class UnitConversionTest : public CppUnit::TestFixture
29 public:
30 void testSanitiseMm100ToTwip()
32 CPPUNIT_ASSERT_EQUAL(sal_Int64(145), sanitiseMm100ToTwip(255));
33 CPPUNIT_ASSERT_EQUAL(sal_Int64(-145), sanitiseMm100ToTwip(-255));
36 void testConvertPointToMm100()
38 CPPUNIT_ASSERT_DOUBLES_EQUAL(599.72, convertPointToMm100(17.0), 1E-2);
39 CPPUNIT_ASSERT_EQUAL(sal_Int64(600), convertPointToMm100(sal_Int64(17)));
41 CPPUNIT_ASSERT_DOUBLES_EQUAL(22930.55, convertPointToMm100(650.0), 1E-2);
42 CPPUNIT_ASSERT_EQUAL(sal_Int64(22931), convertPointToMm100(sal_Int64(650)));
45 CPPUNIT_TEST_SUITE(UnitConversionTest);
46 CPPUNIT_TEST(testSanitiseMm100ToTwip);
47 CPPUNIT_TEST(testConvertPointToMm100);
48 CPPUNIT_TEST_SUITE_END();
51 CPPUNIT_TEST_SUITE_REGISTRATION(UnitConversionTest);
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */