mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
[tests] Update composer effect tests
This commit is contained in:
parent
aa3e40a0eb
commit
f3d5e0b270
@ -41,6 +41,7 @@ class TestQgsComposerEffects: public QObject
|
||||
QgsComposerShape* mComposerRect1;
|
||||
QgsComposerShape* mComposerRect2;
|
||||
QgsMapRenderer* mMapRenderer;
|
||||
QString mReport;
|
||||
};
|
||||
|
||||
void TestQgsComposerEffects::initTestCase()
|
||||
@ -62,11 +63,21 @@ void TestQgsComposerEffects::initTestCase()
|
||||
mComposerRect2->setShapeType( QgsComposerShape::Rectangle );
|
||||
mComposition->addComposerShape( mComposerRect2 );
|
||||
|
||||
mReport = "<h1>Composer Effects Tests</h1>\n";
|
||||
}
|
||||
|
||||
void TestQgsComposerEffects::cleanupTestCase()
|
||||
{
|
||||
delete mComposition;
|
||||
|
||||
QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
|
||||
QFile myFile( myReportFile );
|
||||
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
|
||||
{
|
||||
QTextStream myQTextStream( &myFile );
|
||||
myQTextStream << mReport;
|
||||
myFile.close();
|
||||
}
|
||||
}
|
||||
|
||||
void TestQgsComposerEffects::init()
|
||||
@ -83,9 +94,8 @@ void TestQgsComposerEffects::blend_modes()
|
||||
{
|
||||
mComposerRect2->setBlendMode( QPainter::CompositionMode_Multiply );
|
||||
|
||||
QgsCompositionChecker checker( "Composer effects blending", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
|
||||
"control_images" + QDir::separator() + "expected_composereffects" + QDir::separator() + "composereffect_blend.png" ) );
|
||||
QVERIFY( checker.testComposition() );
|
||||
QgsCompositionChecker checker( "composereffects_blend", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport) );
|
||||
// reset blending
|
||||
mComposerRect2->setBlendMode( QPainter::CompositionMode_SourceOver );
|
||||
}
|
||||
@ -94,9 +104,8 @@ void TestQgsComposerEffects::transparency()
|
||||
{
|
||||
mComposerRect2->setTransparency( 50 );
|
||||
|
||||
QgsCompositionChecker checker( "Composer item transparency", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
|
||||
"control_images" + QDir::separator() + "expected_composereffects" + QDir::separator() + "composereffect_transparency.png" ) );
|
||||
QVERIFY( checker.testComposition() );
|
||||
QgsCompositionChecker checker( "composereffects_transparency", mComposition );
|
||||
QVERIFY( checker.testComposition( mReport ) );
|
||||
}
|
||||
|
||||
QTEST_MAIN( TestQgsComposerEffects )
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Loading…
x
Reference in New Issue
Block a user