From 28b9380b5e59a7f4413b74e03c1c0e598fa5e103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Fri, 10 Sep 2021 19:17:52 +0200
Subject: [PATCH] Add tests for TinyVector::Dimension value

---
 src/algebra/TinyVector.hpp | 3 ++-
 tests/test_TinyVector.cpp  | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/algebra/TinyVector.hpp b/src/algebra/TinyVector.hpp
index 382741093..029b259f5 100644
--- a/src/algebra/TinyVector.hpp
+++ b/src/algebra/TinyVector.hpp
@@ -15,7 +15,8 @@ class [[nodiscard]] TinyVector
 {
  public:
   inline static constexpr size_t Dimension = N;
-  using data_type                          = T;
+
+  using data_type = T;
 
  private:
   T m_values[N];
diff --git a/tests/test_TinyVector.cpp b/tests/test_TinyVector.cpp
index cf77a2232..0613e721c 100644
--- a/tests/test_TinyVector.cpp
+++ b/tests/test_TinyVector.cpp
@@ -15,6 +15,11 @@ template class TinyVector<3, int>;
 
 TEST_CASE("TinyVector", "[algebra]")
 {
+  REQUIRE(TinyVector<1, int>::Dimension == 1);
+  REQUIRE(TinyVector<2, int>::Dimension == 2);
+  REQUIRE(TinyVector<3, int>::Dimension == 3);
+  REQUIRE(TinyVector<4, int>::Dimension == 4);
+
   TinyVector<3, int> v(1, 2, 3);
   REQUIRE(((v[0] == 1) and (v[1] == 2) and (v[2] == 3)));
   REQUIRE(-v == TinyVector<3, int>(-1, -2, -3));
-- 
GitLab