Skip to content

Commit

Permalink
Testsuite: do not use 0 for task limit
Browse files Browse the repository at this point in the history
  • Loading branch information
tamiko committed Feb 9, 2022
1 parent 3d745b1 commit 5b63ed2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,20 @@ filter_out_small_numbers(const Number number, const double tolerance)
inline unsigned int
testing_max_num_threads()
{
const int default_n_threads = 3;

if (const char *penv = std::getenv("TEST_N_THREADS"))
try
{
return Utilities::string_to_int(std::string(penv));
const int n_threads = Utilities::string_to_int(std::string(penv));
return n_threads > 0 ? n_threads : default_n_threads;
}
catch (...)
{
return 3;
return default_n_threads;
}
else
return 3;
return default_n_threads;
}

struct LimitConcurrency
Expand Down

0 comments on commit 5b63ed2

Please sign in to comment.