Centipede 0.0.1
Centipede program
Loading...
Searching...
No Matches
test_entry.cpp
1#include "centipede/centipede.hpp"
2#include <array>
3#include <format>
4#include <gtest/gtest.h>
5#include <utility>
6
7TEST(entrypoint, constructor) { auto entry = centipede::EntryPoint<1, 1>{}; }
8
9TEST(entrypoint, clear)
10{
11 auto entry = centipede::EntryPoint{ .local_derivs = std::array{ 1.F },
12 .global_derivs = std::array{ std::pair{ 1U, 1.F } },
13 .measurement = 1.F,
14 .sigma = 1.F };
15 auto old_entry = entry;
16
17 entry.reset();
18
19 auto default_entry = decltype(entry){};
20 EXPECT_EQ(entry, default_entry);
21 EXPECT_NE(entry, old_entry);
22}
23
24TEST(entrypoint, format)
25{
26 auto entry = centipede::EntryPoint{ .local_derivs = std::array{ 1.F },
27 .global_derivs = std::array{ std::pair{ 1U, 1.F } },
28 .measurement = 1.F,
29 .sigma = 1.F };
30
31 auto format_str = std::format("{}", entry);
32 EXPECT_STREQ(format_str.data(), "local derivatives: [1], global derivatives: [(1, 1)], measurement: 1, sigma: 1");
33}
Structure of a entrypoint.
Definition entry.hpp:20
constexpr void reset()
Reset all values to the default values.
Definition entry.hpp:37