From 154ed2e1307379ac0677ee19e95c4c334b4fbd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Wed, 1 Mar 2023 00:02:33 +0100 Subject: [PATCH] Add missing tests for EmbeddedDiscreteFunctionOperators --- tests/test_EmbeddedDiscreteFunctionOperators1D.cpp | 8 ++++++++ tests/test_EmbeddedDiscreteFunctionOperators2D.cpp | 8 ++++++++ tests/test_EmbeddedDiscreteFunctionOperators3D.cpp | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/tests/test_EmbeddedDiscreteFunctionOperators1D.cpp b/tests/test_EmbeddedDiscreteFunctionOperators1D.cpp index 5538543de..47ff54931 100644 --- a/tests/test_EmbeddedDiscreteFunctionOperators1D.cpp +++ b/tests/test_EmbeddedDiscreteFunctionOperators1D.cpp @@ -681,6 +681,12 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators1D", "[scheme]") REQUIRE_THROWS_WITH(p_R2x2_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0:R^2x2) and R^3x3"); + REQUIRE_THROWS_WITH(p_R2x2_u * (TinyVector<1>{2}), + "error: incompatible operand types Vh(P0:R^2x2) and R^1"); + + REQUIRE_THROWS_WITH(p_R3x3_u * (TinyVector<2>{2, 1}), + "error: incompatible operand types Vh(P0:R^3x3) and R^2"); + REQUIRE_THROWS_WITH(p_Vector3_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0Vector:R) and R^3x3"); REQUIRE_THROWS_WITH(p_Vector3_u * (double{2}), "error: incompatible operand types Vh(P0Vector:R) and R"); @@ -829,6 +835,8 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators1D", "[scheme]") DiscreteFunctionR, DiscreteFunctionR); CHECK_EMBEDDED_XxVH_TO_VH(double{1.3}, /, p_R_u, // DiscreteFunctionR, DiscreteFunctionR); + + REQUIRE_THROWS_WITH(3.2 / p_R1_v, "error: incompatible operand types R and Vh(P0:R^1)"); } } } diff --git a/tests/test_EmbeddedDiscreteFunctionOperators2D.cpp b/tests/test_EmbeddedDiscreteFunctionOperators2D.cpp index fbf114d08..f68856171 100644 --- a/tests/test_EmbeddedDiscreteFunctionOperators2D.cpp +++ b/tests/test_EmbeddedDiscreteFunctionOperators2D.cpp @@ -681,6 +681,12 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators2D", "[scheme]") REQUIRE_THROWS_WITH(p_R2x2_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0:R^2x2) and R^3x3"); + REQUIRE_THROWS_WITH(p_R2x2_u * (TinyVector<1>{2}), + "error: incompatible operand types Vh(P0:R^2x2) and R^1"); + + REQUIRE_THROWS_WITH(p_R3x3_u * (TinyVector<2>{2, 1}), + "error: incompatible operand types Vh(P0:R^3x3) and R^2"); + REQUIRE_THROWS_WITH(p_Vector3_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0Vector:R) and R^3x3"); REQUIRE_THROWS_WITH(p_Vector3_u * (double{2}), "error: incompatible operand types Vh(P0Vector:R) and R"); @@ -831,6 +837,8 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators2D", "[scheme]") DiscreteFunctionR, DiscreteFunctionR); CHECK_EMBEDDED_XxVH_TO_VH(double{1.3}, /, p_R_u, // DiscreteFunctionR, DiscreteFunctionR); + + REQUIRE_THROWS_WITH(3.2 / p_R1_v, "error: incompatible operand types R and Vh(P0:R^1)"); } } } diff --git a/tests/test_EmbeddedDiscreteFunctionOperators3D.cpp b/tests/test_EmbeddedDiscreteFunctionOperators3D.cpp index 1b24d0a91..60b68b473 100644 --- a/tests/test_EmbeddedDiscreteFunctionOperators3D.cpp +++ b/tests/test_EmbeddedDiscreteFunctionOperators3D.cpp @@ -681,6 +681,12 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators3D", "[scheme]") REQUIRE_THROWS_WITH(p_R2x2_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0:R^2x2) and R^3x3"); + REQUIRE_THROWS_WITH(p_R2x2_u * (TinyVector<1>{2}), + "error: incompatible operand types Vh(P0:R^2x2) and R^1"); + + REQUIRE_THROWS_WITH(p_R3x3_u * (TinyVector<2>{2, 1}), + "error: incompatible operand types Vh(P0:R^3x3) and R^2"); + REQUIRE_THROWS_WITH(p_Vector3_u * (TinyMatrix<3>{1, 3, 6, 4, 7, 2, 5, 9, 8}), "error: incompatible operand types Vh(P0Vector:R) and R^3x3"); REQUIRE_THROWS_WITH(p_Vector3_u * (double{2}), "error: incompatible operand types Vh(P0Vector:R) and R"); @@ -831,6 +837,8 @@ TEST_CASE("EmbeddedDiscreteFunctionOperators3D", "[scheme]") DiscreteFunctionR, DiscreteFunctionR); CHECK_EMBEDDED_XxVH_TO_VH(double{1.3}, /, p_R_u, // DiscreteFunctionR, DiscreteFunctionR); + + REQUIRE_THROWS_WITH(3.2 / p_R1_v, "error: incompatible operand types R and Vh(P0:R^1)"); } } } -- GitLab