Skip to content

Commit

Permalink
Add test to confirm no duplicate signal is sent
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 22, 2020
1 parent 61298ad commit a4bcdc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/src/core/testqgstemporalnavigationobject.cpp
Expand Up @@ -197,13 +197,14 @@ void TestQgsTemporalNavigationObject::frameSettings()

navigationObject->setFrameDuration( QgsInterval( 1, QgsUnitTypes::TemporalHours ) );
QCOMPARE( navigationObject->frameDuration(), QgsInterval( 1, QgsUnitTypes::TemporalHours ) );
QCOMPARE( temporalRangeSignal.count(), 2 );

QCOMPARE( navigationObject->currentFrameNumber(), 0 );
QCOMPARE( navigationObject->totalFrameCount(), 5 );

navigationObject->setCurrentFrameNumber( 1 );
QCOMPARE( navigationObject->currentFrameNumber(), 1 );
QCOMPARE( temporalRangeSignal.count(), 2 );
QCOMPARE( temporalRangeSignal.count(), 3 );

navigationObject->setFramesPerSecond( 1 );
QCOMPARE( navigationObject->framesPerSecond(), 1.0 );
Expand All @@ -212,6 +213,10 @@ void TestQgsTemporalNavigationObject::frameSettings()

navigationObject->setTemporalRangeCumulative( true );
QCOMPARE( navigationObject->dateTimeRangeForFrameNumber( 4 ), range );

navigationObject->setFrameDuration( QgsInterval( 2, QgsUnitTypes::TemporalHours ) );
QCOMPARE( navigationObject->currentFrameNumber(), 0 );
QCOMPARE( temporalRangeSignal.count(), 4 );
}

void TestQgsTemporalNavigationObject::expressionContext()
Expand Down

0 comments on commit a4bcdc4

Please sign in to comment.