Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_hex_lattice_test.cc File Reference

Tests for Aleph::CA::Hex_Lattice and the hex coord helpers. More...

#include <array>
#include <cstdint>
#include <set>
#include <string>
#include <gtest/gtest.h>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_engine.H>
#include <tpl_ca_hex_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_storage.H>
Include dependency graph for tpl_ca_hex_lattice_test.cc:

Go to the source code of this file.

Typedefs

using Hex_2D = Hex_Lattice< Dense_Cell_Storage< int, 2 >, OpenBoundary >
 

Functions

 TEST (CAHexCoord, AxialToCubeSatisfiesXYZZeroSum)
 
 TEST (CAHexCoord, AxialOffsetEvenRRoundTrip)
 
 TEST (CAHexCoord, AxialOffsetOddRRoundTrip)
 
 TEST (CAHexCoord, HexDistanceMatchesNeighbourhoodRadius)
 
 TEST (CAHexCoord, PixelCentresAreUniquePerCell)
 
 TEST (CAHexLattice, AxialAccessorsReadAndWrite)
 
 TEST (CAHexLattice, OffsetAccessorsRoundTripEvenR)
 
 TEST (CAHexLattice, BoundaryAwareAtSafeOnOpenBoundary)
 
 TEST (CAHexLatticeEngine, OneIsolatedCellDiesByB2S34)
 
 TEST (CAHexLatticeEngine, PairOfAdjacentCellsBirthsThirdCell)
 
 TEST (CAHexLatticeTikz, ProducesTikzPictureWithExpectedFragments)
 

Detailed Description

Tests for Aleph::CA::Hex_Lattice and the hex coord helpers.

Scope:

  • Round-trip for axial <-> offset (even-r and odd-r).
  • Round-trip for axial <-> cube.
  • Hex distance against ground-truth small cases.
  • Concept conformance (Hex_Lattice satisfies LatticeLike).
  • Hex_Neighborhood radial invariants.
  • Hex Game-of-Life style B2/S34 rule by Bays: blinker pattern period-2 oscillation.
  • Pixel mapping is finite and unique per coord.
  • TikZ export contains expected fragments.

Definition in file tpl_ca_hex_lattice_test.cc.

Typedef Documentation

◆ Hex_2D

Definition at line 69 of file tpl_ca_hex_lattice_test.cc.

Function Documentation

◆ TEST() [1/11]

TEST ( CAHexCoord  ,
AxialOffsetEvenRRoundTrip   
)

◆ TEST() [2/11]

TEST ( CAHexCoord  ,
AxialOffsetOddRRoundTrip   
)

◆ TEST() [3/11]

TEST ( CAHexCoord  ,
AxialToCubeSatisfiesXYZZeroSum   
)

◆ TEST() [4/11]

TEST ( CAHexCoord  ,
HexDistanceMatchesNeighbourhoodRadius   
)

◆ TEST() [5/11]

TEST ( CAHexCoord  ,
PixelCentresAreUniquePerCell   
)

◆ TEST() [6/11]

TEST ( CAHexLattice  ,
AxialAccessorsReadAndWrite   
)

◆ TEST() [7/11]

TEST ( CAHexLattice  ,
BoundaryAwareAtSafeOnOpenBoundary   
)

◆ TEST() [8/11]

TEST ( CAHexLattice  ,
OffsetAccessorsRoundTripEvenR   
)

◆ TEST() [9/11]

TEST ( CAHexLatticeEngine  ,
OneIsolatedCellDiesByB2S34   
)

◆ TEST() [10/11]

TEST ( CAHexLatticeEngine  ,
PairOfAdjacentCellsBirthsThirdCell   
)

◆ TEST() [11/11]

TEST ( CAHexLatticeTikz  ,
ProducesTikzPictureWithExpectedFragments   
)