Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timhendriks93 committed Feb 3, 2024
1 parent b97fca6 commit 5b632e6
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion src/internal/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool Scene::isNewFrame(unsigned long currentMicros) {
}

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

byte Scene::getFPS() {
Expand Down
2 changes: 0 additions & 2 deletions test/animation/test_loop/test_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ void test_loop(void) {
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);

TEST_ASSERT_TRUE(animation.hasScenes());
TEST_ASSERT_EQUAL(2, animation.countScenes());

TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());

animation.loop();
Expand Down
3 changes: 0 additions & 3 deletions test/animation/test_play/test_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ void test_play(void) {
animation.onPositionChange(move);

TEST_ASSERT_FALSE(animation.hasScenes());
TEST_ASSERT_EQUAL(0, animation.countScenes());
TEST_ASSERT_EQUAL(nullptr, animation.getCurrentScene());

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

TEST_ASSERT_TRUE(animation.hasScenes());
TEST_ASSERT_EQUAL(1, animation.countScenes());

TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());

animation.play();
Expand Down
1 change: 0 additions & 1 deletion test/animation/test_play_random/test_play_random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ void test_play_random(void) {
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);

TEST_ASSERT_EQUAL(3, animation.countScenes());
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());

When(OverloadedMethod(ArduinoFake(), random, long(long))).Return(1, 0, 2);
Expand Down
1 change: 0 additions & 1 deletion test/animation/test_play_single/test_play_single.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ void test_play_single(void) {
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);
animation.addScene(PROGMEM_DATA, DATA_SIZE, FPS, FRAMES);

TEST_ASSERT_EQUAL(3, animation.countScenes());
TEST_ASSERT_EQUAL(Animation::MODE_DEFAULT, animation.getMode());

animation.playSingle(2);
Expand Down

0 comments on commit 5b632e6

Please sign in to comment.