aboutsummaryrefslogtreecommitdiff
path: root/test/selfadjoint.cpp
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2022-02-25 16:17:02 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-25 16:17:02 +0000
commit7cb50013986f04dce5fac87bebf319bb8db37a36 (patch)
treefb979fb4cf4f8052c8cc66b1ec9516d91fcd859b /test/selfadjoint.cpp
parent26a30e76965432e5088c271df90759e49d9636a2 (diff)
parent10f298fc4175c1b8537c674f654a070c871960e5 (diff)
downloadeigen-7cb50013986f04dce5fac87bebf319bb8db37a36.tar.gz
Merge changes Iee153445,Iee274471 am: 79df15ea88 am: 10f298fc41
Original change: https://android-review.googlesource.com/c/platform/external/eigen/+/1999079 Change-Id: I3dd349f9a45d37f37441ff7a7742ebe953b70516
Diffstat (limited to 'test/selfadjoint.cpp')
-rw-r--r--test/selfadjoint.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp
index 92401e506..9ca9cef9e 100644
--- a/test/selfadjoint.cpp
+++ b/test/selfadjoint.cpp
@@ -7,6 +7,7 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#define TEST_CHECK_STATIC_ASSERTIONS
#include "main.h"
// This file tests the basic selfadjointView API,
@@ -14,7 +15,6 @@
template<typename MatrixType> void selfadjoint(const MatrixType& m)
{
- typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
Index rows = m.rows();
@@ -45,6 +45,9 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m)
m4 = m2;
m4 -= m1.template selfadjointView<Lower>();
VERIFY_IS_APPROX(m4, m2-m3);
+
+ VERIFY_RAISES_STATIC_ASSERT(m2.template selfadjointView<StrictlyUpper>());
+ VERIFY_RAISES_STATIC_ASSERT(m2.template selfadjointView<UnitLower>());
}
void bug_159()
@@ -53,7 +56,7 @@ void bug_159()
EIGEN_UNUSED_VARIABLE(m)
}
-void test_selfadjoint()
+EIGEN_DECLARE_TEST(selfadjoint)
{
for(int i = 0; i < g_repeat ; i++)
{