Fix use of conditional preprocessor checks within a macro in tests
- These are non-standard C++, and whilst they are accepted by GCC and
Clang on *NIX and macOS, they are rejected by MSVC.
Change-Id: Ie627d74bb02ebdce3dc5e13c2010616c26cb5dea
diff --git a/internal/ceres/sparse_cholesky_test.cc b/internal/ceres/sparse_cholesky_test.cc
index 147711e..0bd5ad7 100644
--- a/internal/ceres/sparse_cholesky_test.cc
+++ b/internal/ceres/sparse_cholesky_test.cc
@@ -230,9 +230,6 @@
SparseCholeskyTest,
::testing::Combine(::testing::Values(EIGEN_SPARSE),
::testing::Values(OrderingType::AMD,
-#ifndef CERES_NO_EIGEN_METIS
- OrderingType::NESDIS,
-#endif // CERES_NO_EIGEN_METIS
OrderingType::NATURAL),
::testing::Values(true, false)),
ParamInfoToString);
@@ -242,13 +239,28 @@
SparseCholeskyTest,
::testing::Combine(::testing::Values(EIGEN_SPARSE),
::testing::Values(OrderingType::AMD,
-#ifndef CERES_NO_EIGEN_METIS
- OrderingType::NESDIS,
-#endif // CERES_NO_EIGEN_METIS
OrderingType::NATURAL),
::testing::Values(true, false)),
ParamInfoToString);
-#endif
+#endif // CERES_USE_EIGEN_SPARSE
+
+#if defined(CERES_USE_EIGEN_SPARSE) && !defined(CERES_NO_EIGEN_METIS)
+INSTANTIATE_TEST_SUITE_P(
+ EigenSparseCholeskyMETIS,
+ SparseCholeskyTest,
+ ::testing::Combine(::testing::Values(EIGEN_SPARSE),
+ ::testing::Values(OrderingType::NESDIS),
+ ::testing::Values(true, false)),
+ ParamInfoToString);
+
+INSTANTIATE_TEST_SUITE_P(
+ EigenSparseCholeskySingleMETIS,
+ SparseCholeskyTest,
+ ::testing::Combine(::testing::Values(EIGEN_SPARSE),
+ ::testing::Values(OrderingType::NESDIS),
+ ::testing::Values(true, false)),
+ ParamInfoToString);
+#endif // defined(CERES_USE_EIGEN_SPARSE) && !defined(CERES_NO_EIGEN_METIS)
class MockSparseCholesky : public SparseCholesky {
public: