File indexing completed on 2024-04-21 03:50:37

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0004 //
0005 
0006 #include "FrameGraphicsItem.h"
0007 
0008 #include <QBrush>
0009 #include <QTest>
0010 
0011 namespace Marble
0012 {
0013 
0014 class FrameGraphicsItemTest : public QObject
0015 {
0016     Q_OBJECT
0017 
0018 private Q_SLOTS:
0019     void constructorDefaultValues();
0020 };
0021 
0022 void FrameGraphicsItemTest::constructorDefaultValues()
0023 {
0024     const FrameGraphicsItem item;
0025 
0026     QCOMPARE( item.position(), QPointF( 0, 0 ) );
0027     QCOMPARE( item.frame(), FrameGraphicsItem::NoFrame );
0028     QCOMPARE( item.margin(), 0. );
0029     QCOMPARE( item.marginTop(), 0. );
0030     QCOMPARE( item.marginBottom(), 0. );
0031     QCOMPARE( item.marginLeft(), 0. );
0032     QCOMPARE( item.marginRight(), 0. );
0033     QCOMPARE( item.borderWidth(), 1. );
0034     QCOMPARE( item.padding(), 0. );
0035     QCOMPARE( item.contentSize(), QSizeF( 0, 0 ) );
0036     QCOMPARE( item.contentRect(), QRectF( QPointF( 0, 0 ), QSizeF( 0, 0 ) ) );
0037     QCOMPARE( item.paintedRect(), QRectF( QPointF( 0, 0 ), QSizeF( 1, 1 ) ) );
0038     QCOMPARE( item.borderBrush(), QBrush( Qt::black ) );
0039     QCOMPARE( item.borderStyle(), Qt::SolidLine );
0040     QCOMPARE( item.background(), QBrush( QColor( 192, 192, 192, 192 ) ) );
0041 }
0042 
0043 }
0044 
0045 QTEST_MAIN( Marble::FrameGraphicsItemTest )
0046 
0047 #include "FrameGraphicsItemTest.moc"