Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
test_bitmapimage.cpp
1 #include "test_bitmapimage.h"
2 #include "bitmapimage.h"
3 
4 void TestBitmapImage::initTestCase()
5 {
6 
7 }
8 
9 void TestBitmapImage::cleanupTestCase()
10 {
11 
12 }
13 
14 void TestBitmapImage::testInitImage()
15 {
16  BitmapImage* b = new BitmapImage;
17  std::shared_ptr< BitmapImage > sp( b );
18 }
19 
20 void TestBitmapImage::testInitSize()
21 {
22  BitmapImage* b = new BitmapImage;
23  std::shared_ptr< BitmapImage > sp( b );
24 
25  QCOMPARE( b->width(), 0 );
26  QCOMPARE( b->height(), 0 );
27  QCOMPARE( b->top(), 0 );
28  QCOMPARE( b->left(), 0 );
29 }
30 
31 void TestBitmapImage::testInitWithColorAndBoundary()
32 {
33  BitmapImage* b = new BitmapImage( QRect( 10, 20, 30, 40 ), Qt::red );
34  std::shared_ptr< BitmapImage > sp( b );
35 
36  QCOMPARE( b->left(), 10 );
37  QCOMPARE( b->top(), 20 );
38  QCOMPARE( b->width(), 30 );
39  QCOMPARE( b->height(), 40 );
40 }