FastLED 3.9.15
Loading...
Searching...
No Matches

◆ enterSubcase()

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

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

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

References FL_NOEXCEPT, hashCurrentPath(), isFullyTraversed(), mCurrentSubcaseDepth, mNextSubcaseStack, mReporter, mShouldReenter, mSubcaseDiscoveryDepth, and mSubcaseStack.

+ Here is the call graph for this function: