|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 10 tests for the Hashlife engine (tpl_ca_hashlife.H).
More...
#include <cstdint>#include <set>#include <sstream>#include <string>#include <utility>#include <gtest/gtest.h>#include <tpl_ca_hashlife.H>Go to the source code of this file.
Classes | |
| struct | Rule_Sample |
| class | CAHashlifeBruteForceMatch |
Functions | |
| TEST (CAHashlife, EmptyUniverseHasZeroPopulation) | |
| TEST (CAHashlife, SetAndGetSingleCell) | |
| TEST (CAHashlife, SetMultipleCellsKeepsExactSet) | |
| TEST (CAHashlife, ClearResetsUniverse) | |
| TEST (CAHashlife, ReadOutsideRootIsDead) | |
| TEST (CAHashlife, BlockIsAStillLife) | |
| TEST (CAHashlife, BlinkerIsPeriod2) | |
| TEST (CAHashlife, GliderTravelsByOneCellEveryFourSteps) | |
| TEST (CAHashlife, GliderMatchesBruteForceForManySteps) | |
| TEST_P (CAHashlifeBruteForceMatch, MatchesUnboundedReference) | |
| INSTANTIATE_TEST_SUITE_P (CAHashlifeBruteForce, CAHashlifeBruteForceMatch, ::testing::Values(Rule_Sample{ "Conway_blinker_128", Conway_Life, blinker(), 128u }, Rule_Sample{ "Conway_block_128", Conway_Life, block(), 128u }, Rule_Sample{ "Conway_glider_256", Conway_Life, glider(), 256u }, Rule_Sample{ "HighLife_glider_128", HighLife, glider(), 128u }, Rule_Sample{ "Seeds_blinker_32", Seeds, blinker(), 32u }, Rule_Sample{ "Day_Night_block_64", Day_And_Night, block(), 64u }), [](const ::testing::TestParamInfo< Rule_Sample > &i) { return std::string(i.param.name);}) | |
| TEST (CAHashlife, AdvanceReturnsAtLeast2ToTheK) | |
| TEST (CAHashlife, RunAtLeastReachesRequestedGeneration) | |
| TEST (CAHashlife, AdvanceTooLargeKThrows) | |
| TEST (CAHashlife, ConstructorRejectsTinyCacheCapacity) | |
| TEST (CAHashlife, RleRoundTripPreservesGlider) | |
| TEST (CAHashlife, RleRoundTripPreservesGosperGun) | |
| TEST (CAHashlife, RleHeaderEncodesRule) | |
| TEST (CAHashlife, RleParseAcceptsStandardConwayDialect) | |
| TEST (CAHashlife, FormatRuleIsRoundTripStable) | |
| TEST (CAHashlife, StatsTrackCanonicalNodes) | |
| TEST (CAHashlife, ChangingRuleInvalidatesResultCache) | |
| TEST (CAHashlife, SmallCacheCapacityForcesPeriodicClears) | |
| TEST (CAHashlife, GosperGunMatchesReferenceAt256Steps) | |
| TEST (CAHashlife, GosperGunPopulationGrowsLinearly) | |
| TEST (CAHashlife, RunZeroIsNoOp) | |
| TEST (CAHashlife, LargeCoordinatesAreSupported) | |
| TEST (CAHashlife, RepeatedSetAliveOnSameCellIsIdempotent) | |
| TEST (CAHashlife, DeepRunHashlifeStaysExactAgainstBruteForce) | |
Phase 10 tests for the Hashlife engine (tpl_ca_hashlife.H).
Coverage:
Definition in file tpl_ca_hashlife_test.cc.
| INSTANTIATE_TEST_SUITE_P | ( | CAHashlifeBruteForce | , |
| CAHashlifeBruteForceMatch | , | ||
| ::testing::Values(Rule_Sample{ "Conway_blinker_128", Conway_Life, blinker(), 128u }, Rule_Sample{ "Conway_block_128", Conway_Life, block(), 128u }, Rule_Sample{ "Conway_glider_256", Conway_Life, glider(), 256u }, Rule_Sample{ "HighLife_glider_128", HighLife, glider(), 128u }, Rule_Sample{ "Seeds_blinker_32", Seeds, blinker(), 32u }, Rule_Sample{ "Day_Night_block_64", Day_And_Night, block(), 64u }) | , | ||
| [] (const ::testing::TestParamInfo< Rule_Sample > &i) { return std::string(i.param.name);} | |||
| ) |
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Conway_Life.
| TEST | ( | CAHashlife | , |
| AdvanceReturnsAtLeast2ToTheK | |||
| ) |
Definition at line 365 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::generation(), and k.
| TEST | ( | CAHashlife | , |
| AdvanceTooLargeKThrows | |||
| ) |
Definition at line 388 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), and Aleph::blossom_maximum_cardinality_matching().
| TEST | ( | CAHashlife | , |
| BlinkerIsPeriod2 | |||
| ) |
Definition at line 267 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Hashlife_Engine::population().
| TEST | ( | CAHashlife | , |
| BlockIsAStillLife | |||
| ) |
Definition at line 254 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), and k.
| TEST | ( | CAHashlife | , |
| ChangingRuleInvalidatesResultCache | |||
| ) |
Definition at line 499 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, Aleph::CA::HighLife, Aleph::CA::Hashlife_Engine::Stats::result_cache_clears, Aleph::CA::Hashlife_Engine::set_rule(), and Aleph::CA::Hashlife_Engine::stats().
| TEST | ( | CAHashlife | , |
| ClearResetsUniverse | |||
| ) |
Definition at line 227 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::CA::Hashlife_Engine::bbox(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::clear(), Aleph::CA::Hashlife_Engine::generation(), Aleph::CA::Hashlife_Engine::BBox::is_empty(), and Aleph::CA::Hashlife_Engine::population().
| TEST | ( | CAHashlife | , |
| ConstructorRejectsTinyCacheCapacity | |||
| ) |
Definition at line 395 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Conway_Life.
| TEST | ( | CAHashlife | , |
| DeepRunHashlifeStaysExactAgainstBruteForce | |||
| ) |
Definition at line 590 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, Aleph::CA::Hashlife_Engine::population(), Aleph::CA::Hashlife_Engine::run(), and seed.
| TEST | ( | CAHashlife | , |
| EmptyUniverseHasZeroPopulation | |||
| ) |
| TEST | ( | CAHashlife | , |
| FormatRuleIsRoundTripStable | |||
| ) |
Definition at line 473 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, Aleph::CA::Day_And_Night, Aleph::CA::format_rule(), Aleph::CA::HighLife, Aleph::CA::parse_rule(), r, and Aleph::CA::Seeds.
| TEST | ( | CAHashlife | , |
| GliderMatchesBruteForceForManySteps | |||
| ) |
Definition at line 303 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, and k.
| TEST | ( | CAHashlife | , |
| GliderTravelsByOneCellEveryFourSteps | |||
| ) |
Definition at line 287 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| GosperGunMatchesReferenceAt256Steps | |||
| ) |
Definition at line 526 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| GosperGunPopulationGrowsLinearly | |||
| ) |
Definition at line 536 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| LargeCoordinatesAreSupported | |||
| ) |
| TEST | ( | CAHashlife | , |
| ReadOutsideRootIsDead | |||
| ) |
Definition at line 241 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::alive_at(), Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Hashlife_Engine::set_alive().
| TEST | ( | CAHashlife | , |
| RepeatedSetAliveOnSameCellIsIdempotent | |||
| ) |
Definition at line 579 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::set_alive().
| TEST | ( | CAHashlife | , |
| RleHeaderEncodesRule | |||
| ) |
Definition at line 449 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::HighLife, and Aleph::CA::Hashlife_Engine::save_rle_string().
| TEST | ( | CAHashlife | , |
| RleParseAcceptsStandardConwayDialect | |||
| ) |
Definition at line 458 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::load_rle_string(), Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| RleRoundTripPreservesGlider | |||
| ) |
Definition at line 405 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::load_rle_string(), out, Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::save_rle_string().
| TEST | ( | CAHashlife | , |
| RleRoundTripPreservesGosperGun | |||
| ) |
Definition at line 436 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::load_rle_string(), Aleph::CA::Hashlife_Engine::population(), Aleph::CA::Hashlife_Engine::save_rle_string(), and Aleph::size().
| TEST | ( | CAHashlife | , |
| RunAtLeastReachesRequestedGeneration | |||
| ) |
Definition at line 379 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::generation(), and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| RunZeroIsNoOp | |||
| ) |
Definition at line 558 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::generation(), and Aleph::CA::Hashlife_Engine::run().
| TEST | ( | CAHashlife | , |
| SetAndGetSingleCell | |||
| ) |
| TEST | ( | CAHashlife | , |
| SetMultipleCellsKeepsExactSet | |||
| ) |
Definition at line 211 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::bbox(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Hashlife_Engine::population(), and Aleph::CA::Hashlife_Engine::set_alive().
| TEST | ( | CAHashlife | , |
| SmallCacheCapacityForcesPeriodicClears | |||
| ) |
Definition at line 511 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Conway_Life, Aleph::CA::Hashlife_Engine::Stats::result_cache_clears, Aleph::CA::Hashlife_Engine::run(), and Aleph::CA::Hashlife_Engine::stats().
| TEST | ( | CAHashlife | , |
| StatsTrackCanonicalNodes | |||
| ) |
Definition at line 489 of file tpl_ca_hashlife_test.cc.
References Aleph::CA::Hashlife_Engine::advance(), Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Hashlife_Engine::stats().
| TEST_P | ( | CAHashlifeBruteForceMatch | , |
| MatchesUnboundedReference | |||
| ) |
Definition at line 335 of file tpl_ca_hashlife_test.cc.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Hashlife_Engine::run().