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/types.h>
11 #include "cppunit/TestAssert.h"
12 #include "cppunit/TestFixture.h"
13 #include "cppunit/extensions/HelperMacros.h"
14 #include "cppunit/plugin/TestPlugIn.h"
15 #include <tools/color.hxx>
20 class Test
: public CppUnit::TestFixture
23 void test_asRGBColor();
25 CPPUNIT_TEST_SUITE(Test
);
26 CPPUNIT_TEST(test_asRGBColor
);
27 CPPUNIT_TEST_SUITE_END();
30 void Test::test_asRGBColor()
34 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("000000"));
37 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("ffffff"));
40 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("800000"));
42 aColor
= COL_TRANSPARENT
;
43 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("ffffff"));
46 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("000080"));
49 aColor
.SetGreen(0x34);
51 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("123456"));
54 CPPUNIT_ASSERT_EQUAL(aColor
.AsRGBHexString(), OUString("ffffff"));
57 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */