nestbyvalue test: fix uninitialized matrix

- Doing computation with uninitialized (zero-ed ? but thanks Linux) matrix, or
worse NaN on other non-linux systems.
- This commit fixes it by initializing to Random().
This commit is contained in:
Minh Quan HO 2021-10-04 18:30:26 +02:00 committed by Minh Quan Ho
parent 478a1bdda6
commit 4284c68fbb

View File

@ -26,7 +26,7 @@ EIGEN_DECLARE_TEST(nestbyvalue)
for(int i = 0; i < g_repeat; i++) {
Index rows = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
Index cols = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
MatrixXd a = MatrixXd(rows,cols);
MatrixXd a = MatrixXd::Random(rows,cols);
nb_temporaries = 0;
XprType x = get_xpr_with_temps(a);
VERIFY_IS_EQUAL(nb_temporaries,6);