1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <sal/config.h>
12 #include <cppunit/TestAssert.h>
13 #include <cppunit/TestFixture.h>
14 #include <cppunit/extensions/HelperMacros.h>
15 #include <cppunit/plugin/TestPlugIn.h>
17 #include <com/sun/star/uno/Any.hxx>
18 #include <sal/types.h>
22 class Test
: public CppUnit::TestFixture
{
24 CPPUNIT_TEST_SUITE(Test
);
25 CPPUNIT_TEST(testGet
);
26 CPPUNIT_TEST(testHas
);
27 CPPUNIT_TEST(testExtract
);
28 CPPUNIT_TEST(testInsert
);
29 CPPUNIT_TEST_SUITE_END();
32 css::uno::Any
a(false);
33 CPPUNIT_ASSERT_EQUAL(a
, a
.get
<css::uno::Any
>());
34 CPPUNIT_ASSERT_EQUAL(false, a
.get
<bool>());
38 css::uno::Any
a(false);
39 CPPUNIT_ASSERT_EQUAL(true, a
.has
<css::uno::Any
>());
40 CPPUNIT_ASSERT_EQUAL(true, a
.has
<bool>());
44 css::uno::Any
a1(false);
46 CPPUNIT_ASSERT(a1
>>= a2
);
47 CPPUNIT_ASSERT_EQUAL(a1
, a2
);
52 a
<<= css::uno::Any(false);
53 CPPUNIT_ASSERT_EQUAL(css::uno::Any(false), a
);
57 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
61 CPPUNIT_PLUGIN_IMPLEMENT();
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */