Files
grpc/test/cpp/microbenchmarks/helpers.cc
Tanvi Jagtap 3e0eeed4fa [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS… (#36267)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

Will not be replacing CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only a few - which fit into single - line regex will be changed. This would be small in number just to reduce the load later.

Replacing CHECK with CHECK_EQ , CHECK_NE etc could be done using Cider-V once these changes are submitted if we want to clean up later. Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36267

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36267 from tanvi-jagtap:tjagtap_grpc_assert_02 3aed62610192ef9e46b2b25f215e694a4a6f6862
PiperOrigin-RevId: 623469007
2024-04-10 06:02:54 -07:00

38 lines
1.0 KiB
C++

//
//
// Copyright 2017 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include "test/cpp/microbenchmarks/helpers.h"
#include <string.h>
#include "absl/log/check.h"
static LibraryInitializer* g_libraryInitializer;
LibraryInitializer::LibraryInitializer() {
CHECK_EQ(g_libraryInitializer, nullptr);
g_libraryInitializer = this;
}
LibraryInitializer::~LibraryInitializer() { g_libraryInitializer = nullptr; }
LibraryInitializer& LibraryInitializer::get() {
CHECK_NE(g_libraryInitializer, nullptr);
return *g_libraryInitializer;
}