Skip to content
Snippets Groups Projects
Commit 28b9380b authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add tests for TinyVector::Dimension value

parent de2959c8
No related branches found
No related tags found
1 merge request!116Add tests for EmbeddedIDiscreteFunctionUtils
......@@ -15,6 +15,7 @@ class [[nodiscard]] TinyVector
{
public:
inline static constexpr size_t Dimension = N;
using data_type = T;
private:
......
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment