Fix server_builder_plugin_test

pull/22813/head
Mehrdad Afshari 5 years ago
parent 99367a7f98
commit d9e3a49fe1
  1. 13
      test/cpp/end2end/server_builder_plugin_test.cc

@ -121,17 +121,12 @@ std::unique_ptr<ServerBuilderPlugin> CreateTestServerBuilderPlugin() {
return std::unique_ptr<ServerBuilderPlugin>(new TestServerBuilderPlugin());
}
void AddTestServerBuilderPlugin() {
static bool already_here = false;
if (already_here) return;
already_here = true;
::grpc::ServerBuilder::InternalAddPluginFactory(
&CreateTestServerBuilderPlugin);
}
// Force AddServerBuilderPlugin() to be called at static initialization time.
struct StaticTestPluginInitializer {
StaticTestPluginInitializer() { AddTestServerBuilderPlugin(); }
StaticTestPluginInitializer() {
::grpc::ServerBuilder::InternalAddPluginFactory(
&CreateTestServerBuilderPlugin);
}
} static_plugin_initializer_test_;
// When the param boolean is true, the ServerBuilder plugin will be added at the

Loading…
Cancel
Save