]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
neorados/test: use [[maybe_unused]] instead of GTEST_ATTRIBUTE_UNUSED_
authorKefu Chai <tchaikov@gmail.com>
Sun, 30 Mar 2025 03:14:01 +0000 (11:14 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 30 Mar 2025 03:31:40 +0000 (11:31 +0800)
This change:

- Aligns with GoogleTest's own evolution, which now uses
  `[[maybe_unused]]` internally (via
  `GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED`) as of
  https://github.com/google/googletest/commit/5a37b517
- Leverages C++20 features already available in Ceph
- Removes dependency on GoogleTest internal macros
- Enables updating the GoogleTest submodule to silence CMake warnings

Using the standard C++ attribute provides better compatibility and
future-proofing than relying on GoogleTest's internal implementation
details.

This change also allows us to bump up googletest submodule to silence a
CMake warning.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/test/neorados/common_tests.h

index 0aec479ac6821b4a137e4174860ecd36c982228f..81d0ecc57c140231cb7e4415f8246a1c83b43e20 100644 (file)
@@ -404,7 +404,7 @@ private:
                                                                               \
   private:                                                                     \
     boost::asio::awaitable<void> CoTestBody() override;                        \
-    static ::testing::TestInfo *const test_info_ GTEST_ATTRIBUTE_UNUSED_;      \
+    [[maybe_unused]] static ::testing::TestInfo *const test_info_;             \
   };                                                                           \
                                                                               \
   ::testing::TestInfo *const GTEST_TEST_CLASS_NAME_(test_suite_name,           \