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

Method SubcaseImpl

tests/shared/fl_unittest.cpp:17–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15// ============================================================================
16
17SubcaseImpl::SubcaseImpl(const char* name, const char* file, int line) : mEntered(false) {
18 SubcaseCtx* ctx = _fl_get_subcase_ctx();
19 if (!ctx) return;
20
21 SubcaseCtx& subcase_ctx = *ctx;
22
23 // Expand path if needed
24 if (subcase_ctx.depth >= (int)subcase_ctx.path.size()) {
25 subcase_ctx.path.resize(subcase_ctx.depth + 1);
26 }
27
28 SubcaseCtx::Node& node = subcase_ctx.path[subcase_ctx.depth];
29
30 // Check if we should enter this subcase
31 if (node.to_enter == node.seen) {
32 // We want to execute this subcase iteration
33 mEntered = true;
34 subcase_ctx.needs_rerun = true; // Signal that another pass is needed
35 }
36
37 node.seen++;
38 subcase_ctx.depth++;
39}
40
41SubcaseImpl::~SubcaseImpl() {
42 SubcaseCtx* ctx = _fl_get_subcase_ctx();

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected