From 5f2bc816e7d149e6d8da882ccb1a34031ba5c0a0 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Fri, 8 Jun 2018 19:19:06 +0200
Subject: [PATCH] Added assertion error tests for TinyVectors

---
 tests/test_TinyVector.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test_TinyVector.cpp b/tests/test_TinyVector.cpp
index 5b9612d34..e61942a7f 100644
--- a/tests/test_TinyVector.cpp
+++ b/tests/test_TinyVector.cpp
@@ -47,6 +47,9 @@ TEST_CASE("TinyVector", "[algebra]") {
 
   REQUIRE(Catch::Detail::stringify(x) == "(3,2,4)");
 
-  // REQUIRE_THROWS(x[4]);
-  // REQUIRE_THROWS(x[-1]);
+#ifndef NDEBUG
+  REQUIRE_THROWS_AS(x[4]=0, AssertError);
+  const TinyVector<3,int>& const_x = x;
+  REQUIRE_THROWS_AS(const_x[-1], AssertError);
+#endif // NDEBUG
 }
-- 
GitLab