diff --git a/internal/ceres/levenberg_marquardt_strategy_test.cc b/internal/ceres/levenberg_marquardt_strategy_test.cc index 950ca23b0..86054fde8 100644 --- a/internal/ceres/levenberg_marquardt_strategy_test.cc +++ b/internal/ceres/levenberg_marquardt_strategy_test.cc @@ -145,10 +145,19 @@ TEST(LevenbergMarquardtStrategy, CorrectDiagonalToLinearSolver) { { ScopedMockLog log; EXPECT_CALL(log, Log(_, _, _)).Times(AnyNumber()); + // This using directive is needed get around the fact that there + // are versions of glog which are not in the google namespace. + using namespace google; + +#if defined(_MSC_VER) // Use GLOG_WARNING to support MSVC if GLOG_NO_ABBREVIATED_SEVERITIES // is defined. - EXPECT_CALL(log, Log(google::GLOG_WARNING, _, + EXPECT_CALL(log, Log(GLOG_WARNING, _, HasSubstr("Failed to compute a step"))); +#else + EXPECT_CALL(log, Log(WARNING, _, + HasSubstr("Failed to compute a step"))); +#endif TrustRegionStrategy::Summary summary = lms.ComputeStep(pso, &dsm, &residual, x);