mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix compiler warnings in tests.
This commit is contained in:
@@ -251,9 +251,9 @@ void mixed_pow_test() {
|
||||
unary_pow_test<double, long long>();
|
||||
|
||||
// The following cases will test promoting a wider exponent type
|
||||
// to a narrower base type. This should compile but generate a
|
||||
// to a narrower base type. This should compile but would generate a
|
||||
// deprecation warning:
|
||||
unary_pow_test<float, double>();
|
||||
// unary_pow_test<float, double>();
|
||||
}
|
||||
|
||||
void int_pow_test() {
|
||||
|
||||
@@ -43,11 +43,11 @@ void check_inf_nan(bool dryrun) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !(numext::isfinite)(m(3)) ); g_test_level=0;
|
||||
if( (std::isinf) (m(3))) g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0;
|
||||
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( (numext::isnan)(m(3)) ); g_test_level=0;
|
||||
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0;
|
||||
if( (std::isfinite)(m(3))) { g_test_level=1; VERIFY( !(numext::isfinite)(m(3)) ); g_test_level=0; }
|
||||
if( (std::isinf) (m(3))) { g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0; }
|
||||
if(!(std::isnan) (m(3))) { g_test_level=1; VERIFY( (numext::isnan)(m(3)) ); g_test_level=0; }
|
||||
if( (std::isfinite)(m(3))) { g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0; }
|
||||
if(!(std::isnan) (m(3))) { g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0; }
|
||||
}
|
||||
T hidden_zero = (std::numeric_limits<T>::min)()*(std::numeric_limits<T>::min)();
|
||||
m(4) /= hidden_zero;
|
||||
@@ -62,11 +62,11 @@ void check_inf_nan(bool dryrun) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !(numext::isfinite)(m(4)) ); g_test_level=0;
|
||||
if(!(std::isinf) (m(3))) g_test_level=1; VERIFY( (numext::isinf)(m(4)) ); g_test_level=0;
|
||||
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !(numext::isnan)(m(4)) ); g_test_level=0;
|
||||
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0;
|
||||
if( (std::isfinite)(m(3))) { g_test_level=1; VERIFY( !(numext::isfinite)(m(4)) ); g_test_level=0; }
|
||||
if(!(std::isinf) (m(3))) { g_test_level=1; VERIFY( (numext::isinf)(m(4)) ); g_test_level=0; }
|
||||
if( (std::isnan) (m(3))) { g_test_level=1; VERIFY( !(numext::isnan)(m(4)) ); g_test_level=0; }
|
||||
if( (std::isfinite)(m(3))) { g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0; }
|
||||
if(!(std::isnan) (m(3))) { g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0; }
|
||||
}
|
||||
m(3) = 0;
|
||||
if(dryrun)
|
||||
@@ -80,11 +80,11 @@ void check_inf_nan(bool dryrun) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(std::isfinite)(m(3))) g_test_level=1; VERIFY( (numext::isfinite)(m(3)) ); g_test_level=0;
|
||||
if( (std::isinf) (m(3))) g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0;
|
||||
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !(numext::isnan)(m(3)) ); g_test_level=0;
|
||||
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !m.hasNaN() ); g_test_level=0;
|
||||
if(!(std::isfinite)(m(3))) { g_test_level=1; VERIFY( (numext::isfinite)(m(3)) ); g_test_level=0; }
|
||||
if( (std::isinf) (m(3))) { g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0; }
|
||||
if( (std::isnan) (m(3))) { g_test_level=1; VERIFY( !(numext::isnan)(m(3)) ); g_test_level=0; }
|
||||
if( (std::isfinite)(m(3))) { g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0; }
|
||||
if( (std::isnan) (m(3))) { g_test_level=1; VERIFY( !m.hasNaN() ); g_test_level=0; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
|
||||
// test sort
|
||||
if (inner > 1) {
|
||||
bool StorageOrdersMatch = DenseMatrix::IsRowMajor == SparseMatrixType::IsRowMajor;
|
||||
bool StorageOrdersMatch = int(DenseMatrix::IsRowMajor) == int(SparseMatrixType::IsRowMajor);
|
||||
DenseMatrix m1(rows, cols);
|
||||
m1.setZero();
|
||||
SparseMatrixType m2(rows, cols);
|
||||
|
||||
Reference in New Issue
Block a user