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
This commit is contained in:
Sameer Agarwal
2017-01-05 11:21:00 -08:00
parent 3fa415bd0c
commit ba891a1025
@@ -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);