diff options
author | Thorsten Behrens <thb@openoffice.org> | 2006-06-28 15:50:20 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2006-06-28 15:50:20 +0000 |
commit | 0535516a2f4f08b15ad9a8007f12f9a57d4fbbb1 (patch) | |
tree | 5d366d47572bc783da6daf1a4aaaef4c7a7c904b /basebmp/test/basictest.cxx | |
parent | b40eed0e55f88aae77acbffd9b9b667c42547ea4 (diff) |
#i65904# Added more docs; made clip masks for all cases (except masked bitmap); removed hardcoded unsigned int in favor of a metafunction; added tests for clips; fixed Color channel modification methods
Diffstat (limited to 'basebmp/test/basictest.cxx')
-rw-r--r-- | basebmp/test/basictest.cxx | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx index 8e33561303f6..893fdae489d9 100644 --- a/basebmp/test/basictest.cxx +++ b/basebmp/test/basictest.cxx @@ -4,9 +4,9 @@ * * $RCSfile: basictest.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: thb $ $Date: 2006-06-07 14:27:36 $ + * last change: $Author: thb $ $Date: 2006-06-28 16:50:19 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -61,6 +61,44 @@ namespace class BasicTest : public CppUnit::TestFixture { public: + void colorTest() + { + Color aTestColor; + + aTestColor = Color(0xDEADBEEF); + CPPUNIT_ASSERT_MESSAGE("unary constructor", + aTestColor.toInt32() == 0xDEADBEEF ); + + aTestColor = Color( 0x10, 0x20, 0xFF ); + CPPUNIT_ASSERT_MESSAGE("ternary constructor", + aTestColor.toInt32() == 0x001020FF ); + + aTestColor.setRed( 0x0F ); + CPPUNIT_ASSERT_MESSAGE("setRed()", + aTestColor.toInt32() == 0x00F20FF ); + + aTestColor.setGreen( 0x0F ); + CPPUNIT_ASSERT_MESSAGE("setGreen()", + aTestColor.toInt32() == 0x00F0FFF ); + + aTestColor.setBlue( 0x10 ); + CPPUNIT_ASSERT_MESSAGE("setBlue()", + aTestColor.toInt32() == 0x00F0F10 ); + + aTestColor.setGray( 0x13 ); + CPPUNIT_ASSERT_MESSAGE("setGray()", + aTestColor.toInt32() == 0x00131313 ); + + aTestColor = Color( 0x10, 0x20, 0xFF ); + CPPUNIT_ASSERT_MESSAGE("getRed()", + aTestColor.getRed() == 0x10 ); + CPPUNIT_ASSERT_MESSAGE("getGreen()", + aTestColor.getGreen() == 0x20 ); + CPPUNIT_ASSERT_MESSAGE("getBlue()", + aTestColor.getBlue() == 0xFF ); + + } + void testConstruction() { const basegfx::B2ISize aSize(101,101); @@ -117,10 +155,6 @@ public: const Color aCol4(0x010101); pDevice->setPixel( aPt, aCol4, DrawMode_PAINT ); - - std::ofstream output("32bpp_test.dump"); - debugDump( pDevice, output ); - CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #4", pDevice->getPixel(aPt) == aCol4); @@ -163,6 +197,7 @@ public: // because these macros are need by auto register mechanism. CPPUNIT_TEST_SUITE(BasicTest); + CPPUNIT_TEST(colorTest); CPPUNIT_TEST(testConstruction); CPPUNIT_TEST(testPixelFuncs); CPPUNIT_TEST_SUITE_END(); |