aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-05-06 13:21:36 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-05-06 13:21:36 -0700
commit7d099a5c907d9ab164416ea875ae07a3074adedb (patch)
tree6fee66eb6ce9a86c937027458cc8593700d549da /test
parent3b8f3354de5af07ea595713623bcc19cd19d6dfe (diff)
Fix naming and comment problems
Diffstat (limited to 'test')
-rw-r--r--test/cpp/end2end/server_builder_plugin_test.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/cpp/end2end/server_builder_plugin_test.cc b/test/cpp/end2end/server_builder_plugin_test.cc
index 0d44999a08..87e3709d7d 100644
--- a/test/cpp/end2end/server_builder_plugin_test.cc
+++ b/test/cpp/end2end/server_builder_plugin_test.cc
@@ -115,10 +115,7 @@ class InsertPluginServerBuilderOption : public ServerBuilderOption {
void UpdatePlugins(
std::map<grpc::string, std::unique_ptr<ServerBuilderPlugin>>* plugins)
GRPC_OVERRIDE {
- auto it = plugins->begin();
- while (it != plugins->end()) {
- plugins->erase(it++);
- }
+ plugins->clear();
std::unique_ptr<TestServerBuilderPlugin> plugin(
new TestServerBuilderPlugin());
@@ -136,7 +133,7 @@ std::unique_ptr<ServerBuilderPlugin> CreateTestServerBuilderPlugin() {
return std::unique_ptr<ServerBuilderPlugin>(new TestServerBuilderPlugin());
}
-void grpc_AddServerBuilderPlugin_reflection() {
+void AddTestServerBuilderPlugin() {
static bool already_here = false;
if (already_here) return;
already_here = true;
@@ -145,12 +142,13 @@ void grpc_AddServerBuilderPlugin_reflection() {
}
// Force AddServerBuilderPlugin() to be called at static initialization time.
-struct StaticPluginInitializer_reflection {
- StaticPluginInitializer_reflection() {
- grpc_AddServerBuilderPlugin_reflection();
- }
-} static_plugin_initializer_reflection_;
+struct StaticTestPluginInitializer {
+ StaticTestPluginInitializer() { AddTestServerBuilderPlugin(); }
+} static_plugin_initializer_test_;
+// When the param boolean is true, the ServerBuilder plugin will be added at the
+// time of static initialization. When it's false, the ServerBuilder plugin will
+// be added using ServerBuilder::SetOption().
class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> {
public:
ServerBuilderPluginTest() {}