Skip to content

Commit

Permalink
Merge pull request #1149 from PetholzA/feature/20231123_fix_erdosreny…
Browse files Browse the repository at this point in the history
…iGtest

fix ErdosRenyiEnumeratorGTest
  • Loading branch information
fabratu committed Dec 12, 2023
2 parents 936bee4 + 7d132d6 commit 865c451
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions networkit/cpp/generators/test/ErdosRenyiEnumeratorGTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <tuple>

#include <networkit/Globals.hpp>
#include <networkit/auxiliary/Parallelism.hpp>
#include <networkit/auxiliary/Random.hpp>
#include <networkit/generators/ErdosRenyiEnumerator.hpp>

Expand Down Expand Up @@ -72,7 +73,6 @@ static void testEre(const bool directed, const node n, const double prob) {

// Check that result is somewhat balanced along threads
if (Parallel && prob > 0) {
EXPECT_EQ(omp_get_max_threads(), static_cast<int>(active_threads));
for (auto count : num_edges_thread)
ASSERT_LE(count, 2 * num_edges / active_threads);
}
Expand Down Expand Up @@ -123,11 +123,17 @@ TEST_P(ErdosRenyiEnumeratorGTest, TestFixedPointParallel) {

INSTANTIATE_TEST_SUITE_P(
ErdosRenyiEnumeratorGTest, ErdosRenyiEnumeratorGTest,
::testing::Values(std::make_tuple(false, 100, 0.0), std::make_tuple(true, 100, 0.0),
std::make_tuple(false, 100, 0.1), std::make_tuple(true, 100, 0.1),
std::make_tuple(false, 100, 0.5), std::make_tuple(true, 100, 0.5),
std::make_tuple(false, 100, 0.7), std::make_tuple(true, 100, 0.7),
std::make_tuple(false, 100, 1.0), std::make_tuple(true, 100, 1.0),
std::make_tuple(false, 200, 0.01), std::make_tuple(true, 200, 0.01)));
::testing::Values(std::make_tuple(false, 25 * Aux::getMaxNumberOfThreads(), 0.0),
std::make_tuple(true, 25 * Aux::getMaxNumberOfThreads(), 0.0),
std::make_tuple(false, 25 * Aux::getMaxNumberOfThreads(), 0.1),
std::make_tuple(true, 25 * Aux::getMaxNumberOfThreads(), 0.1),
std::make_tuple(false, 25 * Aux::getMaxNumberOfThreads(), 0.5),
std::make_tuple(true, 25 * Aux::getMaxNumberOfThreads(), 0.5),
std::make_tuple(false, 25 * Aux::getMaxNumberOfThreads(), 0.7),
std::make_tuple(true, 25 * Aux::getMaxNumberOfThreads(), 0.7),
std::make_tuple(false, 25 * Aux::getMaxNumberOfThreads(), 1.0),
std::make_tuple(true, 25 * Aux::getMaxNumberOfThreads(), 1.0),
std::make_tuple(false, 100 * Aux::getMaxNumberOfThreads(), 0.01),
std::make_tuple(true, 100 * Aux::getMaxNumberOfThreads(), 0.01)));

} // namespace NetworKit

0 comments on commit 865c451

Please sign in to comment.