From b44ed52b24123d521ffa29bedc073dd7f3695626 Mon Sep 17 00:00:00 2001 From: ctiller <10120821+ctiller@users.noreply.github.com> Date: Fri, 30 May 2025 16:21:43 +0000 Subject: [PATCH] Automated change: Fix sanity tests --- CMakeLists.txt | 13 ++++++++++--- build_autogenerated.yaml | 6 +++--- src/core/util/memory_usage.h | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7df0c904fa169..5d699332812c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21165,9 +21165,18 @@ endif() if(gRPC_BUILD_TESTS) add_executable(memory_usage_test + src/core/util/time.cc test/core/util/memory_usage_test.cc third_party/googletest/googlemock/src/gmock_main.cc ) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(memory_usage_test + PRIVATE + "GPR_DLL_IMPORTS" + ) + endif() +endif() target_compile_features(memory_usage_test PUBLIC cxx_std_17) target_include_directories(memory_usage_test PRIVATE @@ -21191,11 +21200,9 @@ target_include_directories(memory_usage_test target_link_libraries(memory_usage_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest - absl::log - absl::status absl::statusor absl::string_view - absl::time + gpr ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 2058d9e9bbbef..1f253ca4f356c 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -13718,16 +13718,16 @@ targets: language: c++ headers: - src/core/util/memory_usage.h + - src/core/util/time.h src: + - src/core/util/time.cc - test/core/util/memory_usage_test.cc - third_party/googletest/googlemock/src/gmock_main.cc deps: - gtest - - absl/log:log - - absl/status:status - absl/status:statusor - absl/strings:string_view - - absl/time:time + - gpr - name: message_allocator_end2end_test gtest: true build: test diff --git a/src/core/util/memory_usage.h b/src/core/util/memory_usage.h index ac031bad00f63..b6f0e8ad3c945 100644 --- a/src/core/util/memory_usage.h +++ b/src/core/util/memory_usage.h @@ -131,9 +131,9 @@ size_t MemoryUsage(const T& x) { } else if constexpr (std::is_same_v) { // Assume that the string_view is not owning the string. return sizeof(T); - } else if constexpr (std::is_same_v) { + } else if constexpr (std::is_same_v) { return sizeof(T); - } else if constexpr (std::is_same_v) { + } else if constexpr (std::is_same_v) { return sizeof(T); } else if constexpr (category == Category::kSimple) { return sizeof(T);