first commit
This commit is contained in:
commit
5893b00dd2
1669 changed files with 1982740 additions and 0 deletions
27
libraries/FastLED/tests/test_frame_tracker.cpp
Normal file
27
libraries/FastLED/tests/test_frame_tracker.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
// g++ --std=c++11 test.cpp
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include "test.h"
|
||||
#include "fx/frame.h"
|
||||
#include "fx/video/frame_tracker.h"
|
||||
#include "fl/namespace.h"
|
||||
|
||||
#include "fl/namespace.h"
|
||||
FASTLED_USING_NAMESPACE
|
||||
|
||||
TEST_CASE("FrameTracker basic frame advancement") {
|
||||
FrameTracker tracker(1.0f); // 1fps == 1000ms per frame
|
||||
uint32_t currentFrame, nextFrame;
|
||||
uint8_t amountOfNextFrame;
|
||||
|
||||
//tracker.reset(1000); // start at time 1000ms
|
||||
|
||||
// Shift the time to 500 ms or 50% of the first frame
|
||||
tracker.get_interval_frames(500, ¤tFrame, &nextFrame, &amountOfNextFrame);
|
||||
CHECK(currentFrame == 0);
|
||||
CHECK(nextFrame == 1);
|
||||
CHECK(amountOfNextFrame == 127);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue