diff --git a/cpptests/test_fixation_pruning_during_simulation.cc b/cpptests/test_fixation_pruning_during_simulation.cc index 2ce37003a..f8fee82d9 100644 --- a/cpptests/test_fixation_pruning_during_simulation.cc +++ b/cpptests/test_fixation_pruning_during_simulation.cc @@ -36,9 +36,9 @@ strong_positive_selection() auto sweights = std::vector(1.); std::vector> nregions, sregions; - sregions.emplace_back(fwdpy11::ExpS(fwdpy11::Region(0., 10., 1.0, true, 0), - 2.0, 0.025, fwdpy11::fixed_dominance(1.)) - .clone()); + sregions.emplace_back(fwdpy11::ExpS(fwdpy11::Region(0., 10., 1.0, true, 0), 2.0, + 0.025, fwdpy11::fixed_dominance(1.)) + .clone()); return fwdpy11::MutationRegions::create(0., nweights, sweights, nregions, sregions); } @@ -87,10 +87,35 @@ BOOST_AUTO_TEST_SUITE(test_remove_fixations_multiplicative) BOOST_FIXTURE_TEST_CASE(test_remove_fixations, common_setup) { - const auto sample_recorder_callback - = [](const fwdpy11::DiploidPopulation &, fwdpy11::SampleRecorder &) { - - }; + const auto sample_recorder_callback = [](const fwdpy11::DiploidPopulation &pop, + fwdpy11::SampleRecorder &) { + for (const auto diploid : pop.diploids) + { + for (const auto m : pop.haploid_genomes[diploid.first].smutations) + { + if (pop.mcounts[m] == 2 * pop.N) + { + for (std::size_t i = 0; i < pop.fixations.size(); ++i) + { + if (pop.fixations[i].g == pop.mutations[m].g + && pop.fixations[i].pos + == pop.mutations[m].pos + && pop.fixations[i].s == pop.mutations[m].s) + { + if (pop.fixation_times[i] + != pop.generation) + { + throw std::runtime_error( + "fixation found in genome " + "that did not occur this " + "generation"); + } + } + } + } + } + } + }; BOOST_REQUIRE_EQUAL(mregions.weights.size(), mregions.regions.size()); BOOST_REQUIRE_EQUAL(mregions.weights.size(), 1); options.track_mutation_counts_during_sim = true;