diff --git a/test/cholesky.cpp b/test/cholesky.cpp index ca7ecb1f4..a3b16bfc2 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -268,10 +268,18 @@ template void cholesky_indefinite(const MatrixType& m) { eigen_assert(m.rows() == 2 && m.cols() == 2); MatrixType mat; - mat << 1, 0, 0, -1; - LDLT ldlt(mat); - VERIFY(!ldlt.isNegative()); - VERIFY(!ldlt.isPositive()); + { + mat << 1, 0, 0, -1; + LDLT ldlt(mat); + VERIFY(!ldlt.isNegative()); + VERIFY(!ldlt.isPositive()); + } + { + mat << 1, 2, 2, 1; + LDLT ldlt(mat); + VERIFY(!ldlt.isNegative()); + VERIFY(!ldlt.isPositive()); + } } template void cholesky_verify_assert()