google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

Building tests fails due to google::S2_DEBUG_MODE unknown #358

Closed benstadin closed 5 months ago

benstadin commented 5 months ago

https://github.com/google/s2geometry/blob/7940c9f791819211782bd7df51632657172c17c2/src/s2/s2polygon_test.cc#L1735

The build fails due to google::S2_DEBUG_MODE unknown when building the test:

/root/s2geometry/src/s2/s2polygon_test.cc:1735:38: error: 'S2_DEBUG_MODE' is not a member of 'google'; did you mean 'DEBUG_MODE'? 1735 | for (int iter = 0; iter < (google::S2_DEBUG_MODE ? 3 : 10); ++iter) { | ^~~~~ | DEBUG_MODE /root/s2geometry/src/s2/s2polygon_test.cc:1743:60: error: 'S2_DEBUG_MODE' is not a member of 'google'; did you mean 'DEBUG_MODE'? 1743 | int level = min_level + S2Testing::rnd.Uniform(google::S2_DEBUG_MODE ? 4 : 6); | ^~~~~ | DEBUG_MODE /root/s2geometry/src/s2/s2polygon_test.cc: In member function 'virtual void IsValidTest_UnitLength_Test::TestBody()': /root/s2geometry/src/s2/s2polygon_test.cc:2319:15: error: 'S2_DEBUG_MODE' is not a member of 'google'; did you mean 'DEBUG_MODE'? 2319 | if (google::S2_DEBUG_MODE) return; | ^~~~~ | DEBUG_MODE /root/s2geometry/src/s2/s2polygon_test.cc: In member function 'virtual void IsValidTest_FuzzTest_Test::TestBody()': /root/s2geometry/src/s2/s2polygon_test.cc:2482:15: error: 'S2_DEBUG_MODE' is not a member of 'google'; did you mean 'DEBUG_MODE'? 2482 | if (google::S2_DEBUG_MODE) | ^~~~~ | DEBUG_MODE In file included from /root/s2geometry/src/s2/r1interval.h:29, from /root/s2geometry/src/s2/mutable_s2shape_index.h:39, from /root/s2geometry/src/s2/s2polygon.h:34, from /root/s2geometry/src/s2/s2polygon_test.cc:19:

jmr commented 5 months ago

What version of the code are you looking at? Your error message has google::S2_DEBUG_MODE, but your link has google::DEBUG_MODE.

benstadin commented 5 months ago

Sorry once again. I've changed the code base to use glog instead of absl log due to integration issues, but forgot about the renamed macros.

jmr commented 5 months ago

A PR coming very soon will use ABSL_LOG directly. Are you relying on being able to change the S2_LOG definition?