Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SUBCASE infinite loop #725

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

AlexanderHederstaf
Copy link

  • Insert and check same hash for fullyTraversedSubcases

Description

Change the saved hash to match the hash later checked in the Subcase constructor.
This fixes an infinite loop that I encountered with at least two different nested SUBCASEs inside a loop.

TEST_CASE("Infinite")
{
  for (int idx = 0; idx < 2; ++idx)
  {
      SUBCASE("A")
      {
          SUBCASE("SUB A")
          {
              std::cout << "sub a" << std::endl;
          }
      }
      SUBCASE("B")
      {
          SUBCASE("SUB B")
          {
              std::cout << "sub b" << std::endl;
          }
      }
  }
}

DanielKriz and others added 11 commits September 13, 2022 04:36
Name of target is different from the name of executable. Therefore this
example would fail in the generation phase.
CMake's `FindMPI` module sets `MPIEXEC_EXECUTABLE` and `MPIEXEC_NUMPROC_FLAG`. We use them so it works for different MPI implementations.
* Explicitly convert pointer in `filldata<T*>::fill`

* Add regression test

* Increase standard compliance

* Collect test output

* Collect test output

* Fix warnings

* Add GCC workaround

* Update doctest.h

* Move __extension__

* Use different workaround

* Add missing const qualifier

Co-authored-by: Salvage <29021710+Saalvage@users.noreply.github.com>
* Add sanitizer CI

* Fix setup

* Separate sanatizers

* Add integer sanitizers

* Finalize sanitizer list

* Specify libc++

* Remove overly complicated sanitizers

* Readd removed CI

* Suppress hash() clang integer sanitizer issues

* Add changes to parts

* Add version limit

Co-authored-by: Stefan <29021710+Saalvage@users.noreply.github.com>
* Add newer CI versions

* Fix old and new versions

* Add debian repos

* Fix typo

* Try add keys

* Update main.yml

* Revert broken changes

* Whitespace fix
* Fix stringification of enums that overload `operator<<`

* Make operator<< static
* Use include guards (doctest#679)

* Change to ‘Include Guards’ to enhance compatibility

* Update doctest/extensions/mpi_sub_comm.h

Optimising macro names

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

* Update doctest/extensions/mpi_reporter.h

Optimising macro names

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

* Add vcpkg installation instructions (doctest#695)

* Add vcpkg installation instructions

* Fix typo

Co-authored-by: Salvage <29021710+Saalvage@users.noreply.github.com>

* Fix typo

* Clarify ..._THROWS documentation

Co-authored-by: Yongpeng Zhang <zhangyp6603@outlook.com>
Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
* Insert and check same hash for fullyTraversedSubcases
@codecov
Copy link

codecov bot commented Nov 24, 2022

Codecov Report

Merging #725 (f695fb9) into dev (96273fd) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #725      +/-   ##
==========================================
- Coverage   92.19%   92.05%   -0.14%     
==========================================
  Files           2        2              
  Lines        2127     2153      +26     
==========================================
+ Hits         1961     1982      +21     
- Misses        166      171       +5     
Impacted Files Coverage Δ
doctest/parts/doctest.cpp 91.66% <100.00%> (-0.05%) ⬇️
doctest/parts/doctest_fwd.h 96.55% <0.00%> (-1.15%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@AlexanderHederstaf
Copy link
Author

I encountered this issue when bumping from 2.4.6 to 2.4.9. The impacted test did not have all its asserts trigger previously, related to #597. After the change in this PR all assertions are triggered and the test does not get stuck in an infinite loop.

@AlexanderHederstaf
Copy link
Author

Might be related to #684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants