diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-19 13:56:03 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:11:54 +0100 |
commit | 2177201e655767f6f15e9b44aedf7a4f99d2994a (patch) | |
tree | b3040350f605dcd84133cc972f7bfda7d3dad996 /vcl | |
parent | a83de85dad1c296188a24ca046f483381deb0a61 (diff) |
fix VirtualDevice unit test.
Change-Id: I7a1f95ae1d8577114634c62aa89d3c7e1fde62c1
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/outdev.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 6ee359320931..4b1a44629a8d 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -32,17 +32,17 @@ public: void VclOutdevTest::testVirtualDevice() { - VirtualDevice aVDev; - aVDev.SetOutputSizePixel(Size(32,32)); - aVDev.SetBackground(Wallpaper(COL_WHITE)); - aVDev.Erase(); - aVDev.DrawPixel(Point(1,2),COL_BLUE); - aVDev.DrawPixel(Point(31,30),COL_RED); - - Size aSize = aVDev.GetOutputSizePixel(); + ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + pVDev->SetOutputSizePixel(Size(32,32)); + pVDev->SetBackground(Wallpaper(COL_WHITE)); + pVDev->Erase(); + pVDev->DrawPixel(Point(1,2),COL_BLUE); + pVDev->DrawPixel(Point(31,30),COL_RED); + + Size aSize = pVDev->GetOutputSizePixel(); CPPUNIT_ASSERT(aSize == Size(32,32)); - Bitmap aBmp = aVDev.GetBitmap(Point(),aSize); + Bitmap aBmp = pVDev->GetBitmap(Point(),aSize); #if 0 OUString rFileName("/tmp/foo-unx.png"); @@ -56,12 +56,12 @@ void VclOutdevTest::testVirtualDevice() } #endif - CPPUNIT_ASSERT_EQUAL(COL_WHITE, aVDev.GetPixel(Point(0,0)).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0,0)).GetColor()); #if defined LINUX //TODO: various failures on Mac and Windows tinderboxes - CPPUNIT_ASSERT_EQUAL(COL_BLUE, aVDev.GetPixel(Point(1,2)).GetColor()); - CPPUNIT_ASSERT_EQUAL(COL_RED, aVDev.GetPixel(Point(31,30)).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, pVDev->GetPixel(Point(1,2)).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_RED, pVDev->GetPixel(Point(31,30)).GetColor()); #endif - CPPUNIT_ASSERT_EQUAL(COL_WHITE, aVDev.GetPixel(Point(30,31)).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(30,31)).GetColor()); // Gotcha: y and x swap for BitmapReadAccess: deep joy. Bitmap::ScopedReadAccess pAcc(aBmp); |