mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user