Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / tools / qa / cppunit / test_100mm2twips.cxx
blob93eab264f8dac946f25be36b00155b838dee3ece
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>
21 #include <sal/log.hxx>
23 #include <cppunit/TestFixture.h>
24 #include <cppunit/extensions/HelperMacros.h>
25 #include <cppunit/plugin/TestPlugIn.h>
27 #include <tools/helpers.hxx>
29 #include <cassert>
31 namespace tools
33 class cm2TwipsTest : public CppUnit::TestFixture
35 public:
36 void testConvert()
38 sal_Int32 nActual = sanitiseMm100ToTwip(255);
39 sal_Int32 nExpected = 145;
40 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
42 nActual = sanitiseMm100ToTwip(-255);
43 nExpected = -145;
44 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
47 CPPUNIT_TEST_SUITE(cm2TwipsTest);
48 CPPUNIT_TEST(testConvert);
49 CPPUNIT_TEST_SUITE_END();
52 CPPUNIT_TEST_SUITE_REGISTRATION(cm2TwipsTest);
53 } // namespace tools
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */