summaryrefslogtreecommitdiffstats
path: root/basebmp/test
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2006-07-06 09:02:07 +0000
committerThorsten Behrens <thb@openoffice.org>2006-07-06 09:02:07 +0000
commit8b7ded16f1756beeb1489709a35fbc19d76e42de (patch)
tree65dc26b293ce107b799882dd3497b42fcbd5065b /basebmp/test
parentINTEGRATION: CWS locales204 (1.1.2); FILE ADDED (diff)
downloadcore-8b7ded16f1756beeb1489709a35fbc19d76e42de.tar.gz
core-8b7ded16f1756beeb1489709a35fbc19d76e42de.zip
#i65904# Reworked accessor framework, is now a hierarchy of nested functionality; added traits for color, iterator and accessor behaviour; finished missing bitmap formats, slightly changed set of predefined formats; swapped order of xor/palette accessor application for the BitmapDevice, which should yield much more sensible results; added a few tests for the new formats
Diffstat (limited to 'basebmp/test')
-rw-r--r--basebmp/test/basictest.cxx58
1 files changed, 53 insertions, 5 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx
index 8126dfd18f99..33209a81a534 100644
--- a/basebmp/test/basictest.cxx
+++ b/basebmp/test/basictest.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: basictest.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: thb $ $Date: 2006-06-30 11:05:21 $
+ * last change: $Author: thb $ $Date: 2006-07-06 10:00:41 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -179,6 +179,54 @@ public:
pDevice->getPixel(aPt3) == aCol6);
}
+ // 16bpp
+ {
+ pDevice = createBitmapDevice( aSize,
+ true,
+ Format::SIXTEEN_BIT_LSB_TC_MASK );
+ const Color aCol7(0);
+ pDevice->clear( aCol7 );
+
+ const Color aCol4(0x00101010);
+ pDevice->setPixel( aPt, aCol4, DrawMode_PAINT );
+ std::ofstream output("16bpp_test.dump");
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #7",
+ pDevice->getPixel(aPt) == aCol4);
+
+ const Color aCol5(0x00F0F0F0);
+ pDevice->setPixel( aPt2, aCol5, DrawMode_PAINT );
+ debugDump( pDevice, output );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #8",
+ pDevice->getPixel(aPt2) == aCol5);
+
+ const Color aCol6(0x00FFFFFF);
+ pDevice->setPixel( aPt3, aCol6, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #9",
+ pDevice->getPixel(aPt3) != aCol7);
+ }
+
+ // 24bpp
+ {
+ pDevice = createBitmapDevice( aSize,
+ true,
+ Format::TWENTYFOUR_BIT_TC_MASK );
+
+ const Color aCol4(0x01010101);
+ pDevice->setPixel( aPt, aCol4, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #10",
+ pDevice->getPixel(aPt) == aCol4);
+
+ const Color aCol5(0x0F0F0F0F);
+ pDevice->setPixel( aPt2, aCol5, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #11",
+ pDevice->getPixel(aPt2) == aCol5);
+
+ const Color aCol6(0xFFFFFFFF);
+ pDevice->setPixel( aPt3, aCol6, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #12",
+ pDevice->getPixel(aPt3) == aCol6);
+ }
+
// 32bpp
{
pDevice = createBitmapDevice( aSize,
@@ -187,17 +235,17 @@ public:
const Color aCol4(0x01010101);
pDevice->setPixel( aPt, aCol4, DrawMode_PAINT );
- CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #7",
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #13",
pDevice->getPixel(aPt) == aCol4);
const Color aCol5(0x0F0F0F0F);
pDevice->setPixel( aPt2, aCol5, DrawMode_PAINT );
- CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #8",
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #14",
pDevice->getPixel(aPt2) == aCol5);
const Color aCol6(0xFFFFFFFF);
pDevice->setPixel( aPt3, aCol6, DrawMode_PAINT );
- CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #9",
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #15",
pDevice->getPixel(aPt3) == aCol6);
}
}