Skip to content

Commit 5b632e6

Browse files
committed
fix tests
1 parent b97fca6 commit 5b632e6

File tree

5 files changed

+1
-8
lines changed

5 files changed

+1
-8
lines changed

src/internal/Scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool Scene::isNewFrame(unsigned long currentMicros) {
7373
}
7474

7575
bool Scene::hasFinished() {
76-
return this->frame + 1 == this->frames;
76+
return this->frame == this->frames;
7777
}
7878

7979
byte Scene::getFPS() {

test/animation/test_loop/test_loop.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ void test_loop(void) {
1717
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
1818

1919
TEST_ASSERT_TRUE(animation.hasScenes());
20-
TEST_ASSERT_EQUAL(2, animation.countScenes());
21-
2220
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());
2321

2422
animation.loop();

test/animation/test_play/test_play.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ void test_play(void) {
1515
animation.onPositionChange(move);
1616

1717
TEST_ASSERT_FALSE(animation.hasScenes());
18-
TEST_ASSERT_EQUAL(0, animation.countScenes());
1918
TEST_ASSERT_EQUAL(nullptr, animation.getCurrentScene());
2019

2120
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
2221

2322
TEST_ASSERT_TRUE(animation.hasScenes());
24-
TEST_ASSERT_EQUAL(1, animation.countScenes());
25-
2623
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());
2724

2825
animation.play();

test/animation/test_play_random/test_play_random.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ void test_play_random(void) {
1717
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
1818
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
1919

20-
TEST_ASSERT_EQUAL(3, animation.countScenes());
2120
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());
2221

2322
When(OverloadedMethod(ArduinoFake(), random, long(long))).Return(1, 0, 2);

test/animation/test_play_single/test_play_single.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ void test_play_single(void) {
1717
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
1818
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
1919

20-
TEST_ASSERT_EQUAL(3, animation.countScenes());
2120
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());
2221

2322
animation.playSingle(2);

0 commit comments

Comments
 (0)