CDT++
Causal Dynamical Triangulations in C++
Loading...
Searching...
No Matches
Settings_test.cpp
Go to the documentation of this file.
1/*******************************************************************************
2 Causal Dynamical Triangulations in C++ using CGAL
3
4 Copyright © 2020 Adam Getchell
5 ******************************************************************************/
6
11
12#include "Settings.hpp"
13
14#include <doctest/doctest.h>
15#include <fmt/core.h>
16
17using namespace std;
18
19SCENARIO("Check settings" * doctest::test_suite("settings"))
20{
21 GIVEN("Settings are retrieved.")
22 {
23 WHEN("The integer type is queried.")
24 {
25 auto const& int_precision = typeid(Int_precision).name();
26 THEN("The value is std::int_fast32_t.")
27 {
28 fmt::print("TypeID of Int_precision is {}.\n", int_precision);
29 CHECK_EQ(int_precision, typeid(std::int_fast32_t).name());
30 }
31 }
32 WHEN("MPFR precision is queried.")
33 {
34 auto precision = PRECISION;
35 THEN("The value is 256 bits.")
36 {
37 fmt::print("MPFR precision set to {}.\n", precision);
38 REQUIRE_EQ(precision, 256);
39 }
40 }
41 WHEN("Memory alignment is queried.")
42 {
43 auto constexpr align_64 = ALIGNMENT_64_BIT;
44 THEN("The value is 64 bits.")
45 {
46 fmt::print("Memory alignment is set to {}.\n", align_64);
47 REQUIRE_EQ(align_64, 64);
48 }
49 auto constexpr align_32 = ALIGNMENT_32_BIT;
50 THEN("The value is 32 bits.")
51 {
52 fmt::print("Memory alignment is set to {}.\n", align_32);
53 REQUIRE_EQ(align_32, 32);
54 }
55 }
56 }
57}
Global integer and precision settings.
static int constexpr ALIGNMENT_32_BIT
Except when we only need 32 bits.
Definition: Settings.hpp:61
std::int_fast32_t Int_precision
Definition: Settings.hpp:31
static int constexpr ALIGNMENT_64_BIT
Aligns data for ease of access on 64-bit CPUs at the expense of padding.
Definition: Settings.hpp:58
static Int_precision constexpr PRECISION
Sets the precision for MPFR.
Definition: Settings.hpp:44
SCENARIO("Perform bistellar flip on Delaunay triangulation" *doctest::test_suite("bistellar"))