Add an ifdef around the use of google::GLOG_WARNING MSVC requires using google::GLOG_WARNING, but this breaks the build inside google. So add a MSVC specific ifdef to guard against it. Change-Id: I3509bb3fd2c01722a1c76545b57d2bf0224f6d6e
diff --git a/internal/ceres/levenberg_marquardt_strategy_test.cc b/internal/ceres/levenberg_marquardt_strategy_test.cc index 950ca23..86054fd 100644 --- a/internal/ceres/levenberg_marquardt_strategy_test.cc +++ b/internal/ceres/levenberg_marquardt_strategy_test.cc
@@ -145,10 +145,19 @@ { 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);