@@ -13,12 +13,12 @@ void setUp(void) {
1313}
1414
1515void test_loop (void ) {
16- Animation animationA (0 , FPS, FRAMES );
17- Animation animationB (1 , FPS, FRAMES );
16+ Animation animationA (FPS, 4 );
17+ Animation animationB (FPS, 5 );
1818
1919 Show show;
20- show.addAnimation (animationA);
2120 show.addAnimation (animationB);
21+ show.addAnimation (animationA);
2222
2323 TEST_ASSERT_TRUE (show.hasAnimations ());
2424 TEST_ASSERT_EQUAL (2 , show.countAnimations ());
@@ -28,21 +28,21 @@ void test_loop(void) {
2828 show.loop (0 );
2929
3030 TEST_ASSERT_EQUAL (Show::MODE_LOOP, show.getMode ());
31- TEST_ASSERT_EQUAL (0 , show.getCurrentAnimation ()->getID ());
31+ TEST_ASSERT_EQUAL (5 , show.getCurrentAnimation ()->getFrames ());
3232
33- for (long i = 0 ; i < FRAME_MICROS * (long )6 ; i++ ) {
33+ for (long i = 0 ; i < FRAME_MICROS * (long )6 ; i += FRAME_MICROS ) {
3434 show.run (i);
3535 }
3636
3737 TEST_ASSERT_EQUAL (Show::MODE_LOOP, show.getMode ());
38- TEST_ASSERT_EQUAL (1 , show.getCurrentAnimation ()->getID ());
38+ TEST_ASSERT_EQUAL (4 , show.getCurrentAnimation ()->getFrames ());
3939
40- for (long i = 0 ; i < FRAME_MICROS * (long )5 ; i++ ) {
40+ for (long i = 0 ; i < FRAME_MICROS * (long )4 ; i += FRAME_MICROS ) {
4141 show.run (i);
4242 }
4343
4444 TEST_ASSERT_EQUAL (Show::MODE_LOOP, show.getMode ());
45- TEST_ASSERT_EQUAL (0 , show.getCurrentAnimation ()->getID ());
45+ TEST_ASSERT_EQUAL (5 , show.getCurrentAnimation ()->getFrames ());
4646}
4747
4848void test_without_animations (void ) {
@@ -52,7 +52,7 @@ void test_without_animations(void) {
5252}
5353
5454void test_prevented (void ) {
55- Animation animation (0 , FPS, FRAMES);
55+ Animation animation (FPS, FRAMES);
5656 Serial_ mock;
5757 Show show;
5858 show.addAnimation (animation);
0 commit comments