Skip to content

Commit

Permalink
Only call subcase_end currentSubcaseDepth times
Browse files Browse the repository at this point in the history
Fix doctest#803, presumably broken since doctest#598
  • Loading branch information
patstew committed Sep 7, 2023
1 parent 66ff54a commit 57c2840
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -4885,10 +4885,10 @@ namespace {

DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_exception, {message.c_str(), true});

while (g_cs->subcaseStack.size()) {
g_cs->subcaseStack.pop_back();
for(size_t i = 0; i < g_cs->currentSubcaseDepth; i++) {
DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_end, DOCTEST_EMPTY);
}
g_cs->subcaseStack.clear();

g_cs->finalizeTestCaseData();

Expand Down
4 changes: 2 additions & 2 deletions doctest/parts/doctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,10 +1795,10 @@ namespace {

DOCTEST_ITERATE_THROUGH_REPORTERS(test_case_exception, {message.c_str(), true});

while (g_cs->subcaseStack.size()) {
g_cs->subcaseStack.pop_back();
for(size_t i = 0; i < g_cs->currentSubcaseDepth; i++) {
DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_end, DOCTEST_EMPTY);
}
g_cs->subcaseStack.clear();

g_cs->finalizeTestCaseData();

Expand Down

0 comments on commit 57c2840

Please sign in to comment.