OpenKalman
tests.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2017-2025 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
17 #ifndef OPENKALMAN_TESTS_HPP
18 #define OPENKALMAN_TESTS_HPP
19 
20 #include <gtest/gtest.h>
21 
22 namespace OpenKalman::test
23 {
31 #ifdef __cpp_concepts
32  template<typename Arg1, typename Arg2, typename Err>
33 #else
34  template<typename Arg1, typename Arg2, typename Err, typename = void>
35 #endif
37 
38 
43  template<typename Arg1, typename Arg2, typename Err>
44  TestComparison(const Arg1&, const Arg2&, const Err&) -> TestComparison<Arg1, Arg2, Err>;
45 
46 
47  namespace detail
48  {
49  struct is_near_t
50  {
51  template<typename Arg1, typename Arg2, typename Err = double>
52  inline ::testing::AssertionResult
53  operator()(const Arg1& arg1, const Arg2& arg2, const Err& err = 1e-6) const
54  {
55  return TestComparison {arg1, arg2, err};
56  }
57  };
58  }
59 
60 
67  inline constexpr detail::is_near_t is_near;
68 
69 
70 }
71 
72 
73 #endif
Definition: tests.hpp:36
Definition: tests.hpp:22
Definition: tests.hpp:49
constexpr detail::is_near_t is_near
Determine if two objects are "near" each other, within a margin of error.
Definition: tests.hpp:67