| 15 | // ============================================================================ |
| 16 | |
| 17 | SubcaseImpl::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 | |
| 41 | SubcaseImpl::~SubcaseImpl() { |
| 42 | SubcaseCtx* ctx = _fl_get_subcase_ctx(); |