FastLED 3.10.8
Loading...
Searching...
No Matches

◆ enterSubcase()

bool fl::test::TestContext::enterSubcase ( const SubcaseSignature & sig)

Definition at line 342 of file fltest.cpp.hpp.

342 {
343 // We're at subcase discovery depth mSubcaseDiscoveryDepth
344 // mSubcaseStack contains the path we're following this iteration
345
347 // We're following a predetermined path
349 // This is the subcase we should enter
352 mReporter->subcaseStart(sig.mName);
353 return true;
354 }
355 // Not the subcase we're looking for, skip it
356 return false;
357 } else {
358 // We're past our predetermined path, discovering new subcases
359 fl::u32 pathHash = hashCurrentPath(sig);
360
361 if (isFullyTraversed(pathHash)) {
362 // This subcase path has already been fully explored
363 return false;
364 }
365
366 if (!mShouldReenter) {
367 // First untraversed subcase at this level - enter it
370 mReporter->subcaseStart(sig.mName);
371 return true;
372 } else {
373 // We've already found a subcase to explore next time
374 // Just record this one for future exploration
376 // Build the path to this subcase for next iteration
377 mNextSubcaseStack.clear();
378 for (fl::size i = 0; i < mSubcaseDiscoveryDepth && i < mSubcaseStack.size(); ++i) {
379 mNextSubcaseStack.push_back(mSubcaseStack[i]);
380 }
381 mNextSubcaseStack.push_back(sig);
382 }
383 return false;
384 }
385 }
386}
fl::vector< SubcaseSignature > mNextSubcaseStack
Definition fltest.h:253
fl::size mSubcaseDiscoveryDepth
Definition fltest.h:263
fl::u32 hashCurrentPath(const SubcaseSignature &sig) const FL_NO_EXCEPT
fl::size mCurrentSubcaseDepth
Definition fltest.h:262
fl::vector< SubcaseSignature > mSubcaseStack
Definition fltest.h:252
bool isFullyTraversed(fl::u32 hash) const FL_NO_EXCEPT
IReporter * mReporter
Definition fltest.h:256

References fl::FL_NO_EXCEPT, hashCurrentPath(), isFullyTraversed(), mCurrentSubcaseDepth, mNextSubcaseStack, mReporter, mShouldReenter, mSubcaseDiscoveryDepth, and mSubcaseStack.

+ Here is the call graph for this function: