@@ -88,6 +88,7 @@ namespace firebase_test_framework {
8888// SKIP_TEST_ON_MACOS
8989// SKIP_TEST_ON_SIMULATOR / SKIP_TEST_ON_EMULATOR (identical)
9090// SKIP_TEST_ON_IOS_SIMULATOR / SKIP_TEST_ON_ANDROID_EMULATOR
91+ // SKIP_TEST_ON_ANDROID_IF_GOOGLE_PLAY_SERVICES_IS_OLDER_THAN(version_code)
9192//
9293// Also includes a special macro SKIP_TEST_IF_USING_STLPORT if compiling for
9394// Android STLPort, which does not fully support C++11.
@@ -206,7 +207,7 @@ namespace firebase_test_framework {
206207#endif
207208
208209#if defined(ANDROID)
209- #define SKIP_TEST_ON_ANDROID_GOOGLE_PLAY_SERVICES_BELOW (x ) \
210+ #define SKIP_TEST_ON_ANDROID_IF_GOOGLE_PLAY_SERVICES_IS_OLDER_THAN (x ) \
210211 { \
211212 int _required_ver_ = (x); \
212213 /* Example: 23.1.2 has version code 230102???. */ \
@@ -215,7 +216,7 @@ namespace firebase_test_framework {
215216 _required_ver_ *= 1000 ; \
216217 } \
217218 int _actual_ver_ = GetGooglePlayServicesVersion (); \
218- if (_actual_ver_ < _required_ver_) { \
219+ if (_actual_ver_ > 0 && _actual_ver_ < _required_ver_) { \
219220 app_framework::LogInfo ( \
220221 " Skipping %s, as Google Play services %d is below required %d" , \
221222 test_info_->name (), _actual_ver_, _required_ver_); \
@@ -224,7 +225,7 @@ namespace firebase_test_framework {
224225 } \
225226 }
226227#else
227- #define SKIP_TEST_ON_ANDROID_GOOGLE_PLAY_SERVICES_BELOW (x ) ((void )0 )
228+ #define SKIP_TEST_ON_ANDROID_IF_GOOGLE_PLAY_SERVICES_IS_OLDER_THAN (x ) ((void )0 )
228229#endif // defined(ANDROID)
229230
230231#if defined(STLPORT)
@@ -354,7 +355,8 @@ class FirebaseTest : public testing::Test {
354355 // on a real device (or on desktop).
355356 static bool IsRunningOnEmulator ();
356357
357- // Return Google Play services version on Android, 0 elsewhere.
358+ // If on Android and Google Play services is available, returns the
359+ // Google Play services version. Otherwise, returns 0.
358360 static int GetGooglePlayServicesVersion ();
359361
360362 // Returns true if the future completed as expected, fails the test and
0 commit comments