1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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>
12 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
13 #include <com/sun/star/sheet/addin/XAnalysis.hpp>
14 #include <com/sun/star/uno/XInterface.hpp>
16 #include <com/sun/star/uno/Reference.hxx>
18 #include <comphelper/processfactory.hxx>
22 class Test
: public test::BootstrapFixture
25 virtual void setUp() override
;
28 css::uno::Reference
<css::sheet::addin::XAnalysis
> mxAnalysis
;
33 test::BootstrapFixture::setUp();
34 auto xFactory(comphelper::getProcessServiceFactory());
35 mxAnalysis
.set(xFactory
->createInstance(u
"com.sun.star.sheet.addin.Analysis"_ustr
),
36 css::uno::UNO_QUERY_THROW
);
39 CPPUNIT_TEST_FIXTURE(Test
, test_getDec2Hex
)
41 // Test that 'Places' argument accepts different numeric types
42 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
43 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_Int8(10))));
44 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
45 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_Int16(10))));
46 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
47 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_uInt16(10))));
48 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
49 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_Int32(10))));
50 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
51 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_uInt32(10))));
52 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
53 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_Int64(10))));
54 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
55 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(sal_uInt64(10))));
56 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
57 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(double(10))));
58 CPPUNIT_ASSERT_EQUAL(u
"000000006E"_ustr
,
59 mxAnalysis
->getDec2Hex({}, 110, css::uno::Any(float(10))));
63 CPPUNIT_PLUGIN_IMPLEMENT();
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */