MCPcopy Create free account
hub / github.com/FastLED/FastLED / FL_TEST_FILE

Function FL_TEST_FILE

tests/fl/video/frame_tracker.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "test.h"
10
11FL_TEST_FILE(FL_FILEPATH) {
12using namespace fl;
13using namespace fl::video;
14FL_TEST_CASE("FrameTracker basic frame advancement") {
15 FrameTracker tracker(1.0f); // 1fps == 1000ms per frame
16 uint32_t currentFrame, nextFrame;
17 uint8_t amountOfNextFrame;
18
19 //tracker.reset(1000); // start at time 1000ms
20
21 // Shift the time to 500 ms or 50% of the first frame
22 tracker.get_interval_frames(500, &currentFrame, &nextFrame, &amountOfNextFrame);
23 FL_CHECK(currentFrame == 0);
24 FL_CHECK(nextFrame == 1);
25 FL_CHECK(amountOfNextFrame == 127);
26}
27
28} // FL_TEST_FILE

Callers

nothing calls this directly

Calls 1

get_interval_framesMethod · 0.80

Tested by

no test coverage detected