diff options
author | Derek Mauro <dmauro@google.com> | 2023-10-30 09:48:26 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-10-30 09:49:20 -0700 |
commit | e7d9317bf5d65d98d9fa4bbbc9750613fc4cdf8a (patch) | |
tree | 6e081e7caf19888c79db17183ae46fc8cb2937ac | |
parent | f4106724bf9cc54ed055e8d6364ae91e0d7c1547 (diff) |
Fix an unreachable code warning on some platforms
#1558
PiperOrigin-RevId: 577874842
Change-Id: I1d56f3f4b445f6c4a9df2fe06fec542cb00e0e92
-rw-r--r-- | absl/strings/internal/str_format/convert_test.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/absl/strings/internal/str_format/convert_test.cc b/absl/strings/internal/str_format/convert_test.cc index 0d534651..d14ecb24 100644 --- a/absl/strings/internal/str_format/convert_test.cc +++ b/absl/strings/internal/str_format/convert_test.cc @@ -1245,9 +1245,16 @@ TEST_F(FormatConvertTest, ExpectedFailures) { // Sanity check to make sure that we are testing what we think we're testing on // e.g. the x86_64+glibc platform. TEST_F(FormatConvertTest, GlibcHasCorrectTraits) { -#if !defined(__GLIBC__) || !defined(__x86_64__) - return; +#if defined(__GLIBC__) && defined(__x86_64__) + constexpr bool kIsSupportedGlibc = true; +#else + constexpr bool kIsSupportedGlibc = false; #endif + + if (!kIsSupportedGlibc) { + GTEST_SKIP() << "Test does not support this platform"; + } + const NativePrintfTraits &native_traits = VerifyNativeImplementation(); // If one of the following tests break then it is either because the above PP // macro guards failed to exclude a new platform (likely) or because something |