Skip to content

Commit

Permalink
test: format/fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acgetchell committed Apr 14, 2024
1 parent 805d5ed commit e00cc47
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 40 deletions.
2 changes: 1 addition & 1 deletion tests/Ergodic_moves_3_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ SCENARIO("Perform ergodic moves on the minimal manifold necessary (4,4) moves" *
};
vector<size_t> timevalues{0, 1, 1, 1, 1, 2};
auto causal_vertices = make_causal_vertices<3>(vertices, timevalues);
Manifold_3 manifold(causal_vertices, 0, 1);
Manifold_3 manifold(causal_vertices, 0, 1);
// Verify we have 4 vertices, 4 edges, 4 faces, and 4 simplices
REQUIRE_EQ(manifold.vertices(), 6);
REQUIRE_EQ(manifold.edges(), 13);
Expand Down
8 changes: 4 additions & 4 deletions tests/Foliated_triangulation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ SCENARIO("FoliatedTriangulation free functions" *

GIVEN("A vector of points and timevalues.")
{
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
Point_t<3>(0, 0, 1),
Point_t<3>(RADIUS_2, RADIUS_2, RADIUS_2)};
vector<size_t> const Timevalues{1, 1, 1, 2};
vector<size_t> const Timevalues{1, 1, 1, 2};
WHEN("Causal vertices are created.")
{
auto causal_vertices = make_causal_vertices<3>(Vertices, Timevalues);
Expand All @@ -152,10 +152,10 @@ SCENARIO("FoliatedTriangulation free functions" *
}
GIVEN("A mismatched set of points and timevalues.")
{
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
Point_t<3>(0, 0, 1),
Point_t<3>(RADIUS_2, RADIUS_2, RADIUS_2)};
vector<size_t> const Timevalues{1, 1, 1};
vector<size_t> const Timevalues{1, 1, 1};
WHEN("Causal vertices are created.")
{
THEN("An exception is thrown.")
Expand Down
10 changes: 5 additions & 5 deletions tests/Manifold_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ SCENARIO("Manifold free functions" * doctest::test_suite("manifold"))

GIVEN("A vector of points and timevalues.")
{
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
Point_t<3>(0, 0, 1),
Point_t<3>(RADIUS_2, RADIUS_2, RADIUS_2)};
vector<size_t> const Timevalues{1, 1, 1, 2};
vector<size_t> const Timevalues{1, 1, 1, 2};
WHEN("Causal vertices are created.")
{
auto causal_vertices =
Expand All @@ -143,10 +143,10 @@ SCENARIO("Manifold free functions" * doctest::test_suite("manifold"))
}
GIVEN("A mismatched set of points and timevalues.")
{
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
vector const Vertices{Point_t<3>(1, 0, 0), Point_t<3>(0, 1, 0),
Point_t<3>(0, 0, 1),
Point_t<3>(RADIUS_2, RADIUS_2, RADIUS_2)};
vector<size_t> const Timevalues{1, 1, 1};
vector<size_t> const Timevalues{1, 1, 1};
WHEN("Causal vertices are created.")
{
THEN("An exception is thrown.")
Expand Down Expand Up @@ -468,7 +468,7 @@ SCENARIO("3-Manifold function checks" * doctest::test_suite("manifold"))
THEN("There is only one vertex, the infinite vertex.")
{
Manifold_3 const manifold;
auto&& vertices =
auto&& vertices =
manifold.get_triangulation().get_delaunay().tds().vertices();
auto&& vertex = vertices.begin();

Expand Down
2 changes: 1 addition & 1 deletion tests/Tetrahedron_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static inline auto constexpr RADIUS_2 = 2.0 * std::numbers::inv_sqrt3_v<double>;
SCENARIO("Construct a tetrahedron in a Delaunay triangulation" *
doctest::test_suite("tetrahedron"))
{
using Point = Point_t<3>;
using Point = Point_t<3>;
GIVEN("A vector of 4 vertices.")
{
vector vertices{
Expand Down
55 changes: 26 additions & 29 deletions tests/Utilities_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
using namespace std;
using namespace utilities;

// static inline auto constexpr NUMBER_OF_VALUES = 6;

SCENARIO("Various string/stream/time utilities" *
doctest::test_suite("utilities"))
{
Expand Down Expand Up @@ -57,7 +55,7 @@ SCENARIO("Various string/stream/time utilities" *
{
// Update test yearly
auto const result = current_date_time();
auto const year = result.find("2023");
auto const year = result.find("2024");
CHECK_NE(year, std::string::npos);
// Human verification
fmt::print("Current date and time is: {}\n", current_date_time());
Expand Down Expand Up @@ -165,8 +163,7 @@ SCENARIO("Reading and writing Delaunay triangulations to files" *
}
}

SCENARIO("Randomizing functions" * doctest::test_suite("utilities") *
doctest::may_fail())
SCENARIO("Randomizing functions" * doctest::test_suite("utilities"))
{
spdlog::debug("Randomizing functions.\n");
GIVEN("A PCG die roller")
Expand Down Expand Up @@ -199,15 +196,15 @@ SCENARIO("Randomizing functions" * doctest::test_suite("utilities") *
{
WHEN("We generate six different random integers within the range.")
{
auto constexpr min = 64;
auto constexpr max = 6400;
auto const value1 = generate_random_int(min, max);
auto const value2 = generate_random_int(min, max);
auto const value3 = generate_random_int(min, max);
auto const value4 = generate_random_int(min, max);
auto const value5 = generate_random_int(min, max);
auto const value6 = generate_random_int(min, max);
array container = {value1, value2, value3, value4, value5, value6};
auto constexpr min = 64;
auto constexpr max = 6400;
auto const value1 = generate_random_int(min, max);
auto const value2 = generate_random_int(min, max);
auto const value3 = generate_random_int(min, max);
auto const value4 = generate_random_int(min, max);
auto const value5 = generate_random_int(min, max);
auto const value6 = generate_random_int(min, max);
array container = {value1, value2, value3, value4, value5, value6};
THEN("They should all fall within the range and all be different.")
{
// All elements are >= min
Expand All @@ -230,14 +227,14 @@ SCENARIO("Randomizing functions" * doctest::test_suite("utilities") *
{
WHEN("We generate six different timeslices within the range.")
{
auto constexpr max = 256;
auto const value1 = generate_random_timeslice(max);
auto const value2 = generate_random_timeslice(max);
auto const value3 = generate_random_timeslice(max);
auto const value4 = generate_random_timeslice(max);
auto const value5 = generate_random_timeslice(max);
auto const value6 = generate_random_timeslice(max);
array container = {value1, value2, value3, value4, value5, value6};
auto constexpr max = 256;
auto const value1 = generate_random_timeslice(max);
auto const value2 = generate_random_timeslice(max);
auto const value3 = generate_random_timeslice(max);
auto const value4 = generate_random_timeslice(max);
auto const value5 = generate_random_timeslice(max);
auto const value6 = generate_random_timeslice(max);
array container = {value1, value2, value3, value4, value5, value6};
THEN("They should all fall within the range and be different.")
{
auto constexpr min = 1;
Expand Down Expand Up @@ -275,13 +272,13 @@ SCENARIO("Randomizing functions" * doctest::test_suite("utilities") *
{
WHEN("We generate six probabilities.")
{
auto const value1 = generate_probability();
auto const value2 = generate_probability();
auto const value3 = generate_probability();
auto const value4 = generate_probability();
auto const value5 = generate_probability();
auto const value6 = generate_probability();
array container = {value1, value2, value3, value4, value5, value6};
auto const value1 = generate_probability();
auto const value2 = generate_probability();
auto const value3 = generate_probability();
auto const value4 = generate_probability();
auto const value5 = generate_probability();
auto const value6 = generate_probability();
array container = {value1, value2, value3, value4, value5, value6};

THEN("They should all be different.")
{
Expand Down

0 comments on commit e00cc47

Please sign in to comment.