summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tools/color.hxx5
-rw-r--r--tools/qa/cppunit/test_color.cxx20
2 files changed, 5 insertions, 20 deletions
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 25032c5d29b9..9643f4028dc9 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -243,6 +243,11 @@ namespace com { namespace sun { namespace star { namespace uno {
}
} } } }
+// Test compile time conversion of Color to sal_uInt32
+
+static_assert (sal_uInt32(Color(0x00, 0x12, 0x34, 0x56)) == 0x00123456);
+static_assert (sal_uInt32(Color(0x12, 0x34, 0x56)) == 0x00123456);
+
// Color types
constexpr ::Color COL_BLACK ( 0x00, 0x00, 0x00 );
diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx
index 571a1f37291d..8ecf03572295 100644
--- a/tools/qa/cppunit/test_color.cxx
+++ b/tools/qa/cppunit/test_color.cxx
@@ -21,7 +21,6 @@ namespace
class Test: public CppUnit::TestFixture
{
public:
- void testConstruction();
void testVariables();
void test_asRGBColor();
void test_readAndWriteStream();
@@ -31,7 +30,6 @@ public:
void testBColor();
CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(testConstruction);
CPPUNIT_TEST(testVariables);
CPPUNIT_TEST(test_asRGBColor);
CPPUNIT_TEST(test_readAndWriteStream);
@@ -42,24 +40,6 @@ public:
CPPUNIT_TEST_SUITE_END();
};
-void Test::testConstruction()
-{
- // Compile time construction of the Color and representation as a sal_uInt32
-
- Color aColor = Color(0xFF, 0xFF, 0x00);
-
- switch (sal_uInt32(aColor))
- {
- case sal_uInt32(Color(0xFF, 0xFF, 0x00)):
- break;
- case sal_uInt32(Color(0x00, 0x00, 0xFF, 0xFF)):
- break;
- default:
- CPPUNIT_ASSERT(false);
- break;
- }
-}
-
void Test::testVariables()
{
Color aColor(0x44, 0x88, 0xAA);