Skip to content

Commit

Permalink
Tests: Fix std::TestPopulation.generateHouseholdStructures for older gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood committed Dec 2, 2024
1 parent 16c7aea commit 241bf7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/exateppabm/test_population.cu
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ TEST(TestPopulation, getHouseholdSizeCumulativeProbabilityVector) {
TEST(TestPopulation, generateHouseholdStructures) {
const double EPSILON = 1.0e-7;
std::vector<exateppabm::population::HouseholdStructure> households;
std::mt19937_64 rng = {};
std::mt19937_64 rng = std::mt19937_64(0);
exateppabm::input::config params = {};
std::uint64_t totalPeople = 0;

Expand All @@ -170,7 +170,7 @@ TEST(TestPopulation, generateHouseholdStructures) {
params.population_60_69 = 0;
params.population_70_79 = 0;
params.population_80 = 0;
rng = std::mt19937_64(params.rng_seed);
rng.seed(params.rng_seed);
households = exateppabm::population::generateHouseholdStructures(params, rng, false);
// Should be 1 household
ASSERT_EQ(households.size(), 1u);
Expand Down Expand Up @@ -220,7 +220,7 @@ TEST(TestPopulation, generateHouseholdStructures) {
params.population_60_69 = 0;
params.population_70_79 = 1;
params.population_80 = 1;
rng = std::mt19937_64(params.rng_seed);
rng.seed(params.rng_seed);
households = exateppabm::population::generateHouseholdStructures(params, rng, false);
// Should be between 1 and 32 households
ASSERT_GE(households.size(), 1u);
Expand Down

0 comments on commit 241bf7d

Please sign in to comment.