diff --git a/src/braft/util.cpp b/src/braft/util.cpp index 053d7384..9770b753 100644 --- a/src/braft/util.cpp +++ b/src/braft/util.cpp @@ -35,11 +35,11 @@ static bool valid_percentile(const char*, int32_t v) { return v > 0 && v < 100; } -const bool ALLOW_UNUSED dummy_bvar_counter_p1 = ::google::RegisterFlagValidator( +const bool ALLOW_UNUSED dummy_bvar_counter_p1 = GFLAGS_NS::RegisterFlagValidator( &FLAGS_bvar_counter_p1, valid_percentile); -const bool ALLOW_UNUSED dummy_bvar_counter_p2 = ::google::RegisterFlagValidator( +const bool ALLOW_UNUSED dummy_bvar_counter_p2 = GFLAGS_NS::RegisterFlagValidator( &FLAGS_bvar_counter_p2, valid_percentile); -const bool ALLOW_UNUSED dummy_bvar_counter_p3 = ::google::RegisterFlagValidator( +const bool ALLOW_UNUSED dummy_bvar_counter_p3 = GFLAGS_NS::RegisterFlagValidator( &FLAGS_bvar_counter_p3, valid_percentile); namespace detail { diff --git a/test/test_node.cpp b/test/test_node.cpp index a1744ec6..83567445 100644 --- a/test/test_node.cpp +++ b/test/test_node.cpp @@ -505,7 +505,7 @@ class NodeTest : public testing::TestWithParam { void SetUp() { g_dont_print_apply_log = false; //logging::FLAGS_v = 90; - google::SetCommandLineOption("crash_on_fatal_log", "true"); + GFLAGS_NS::SetCommandLineOption("crash_on_fatal_log", "true"); if (GetParam() == std::string("NoReplication")) { braft::FLAGS_raft_max_parallel_append_entries_rpc_num = 1; braft::FLAGS_raft_enable_append_entries_cache = false; @@ -1477,7 +1477,7 @@ TEST_P(NodeTest, PreVote) { } TEST_P(NodeTest, Vote_timedout) { - google::SetCommandLineOption("raft_step_down_when_vote_timedout", "true"); + GFLAGS_NS::SetCommandLineOption("raft_step_down_when_vote_timedout", "true"); std::vector peers; for (int i = 0; i < 2; i++) { braft::PeerId peer; @@ -1525,7 +1525,7 @@ TEST_P(NodeTest, Vote_timedout) { LOG(WARNING) << "cluster stop"; cluster.stop_all(); - google::SetCommandLineOption("raft_step_down_when_vote_timedout", "false"); + GFLAGS_NS::SetCommandLineOption("raft_step_down_when_vote_timedout", "false"); } TEST_P(NodeTest, SetPeer1) { @@ -1840,7 +1840,7 @@ TEST_P(NodeTest, InstallSnapshot) { } TEST_P(NodeTest, install_snapshot_exceed_max_task_num) { - google::SetCommandLineOption("raft_max_install_snapshot_tasks_num", "1"); + GFLAGS_NS::SetCommandLineOption("raft_max_install_snapshot_tasks_num", "1"); std::vector peers; for (int i = 0; i < 5; i++) { braft::PeerId peer; @@ -1943,7 +1943,7 @@ TEST_P(NodeTest, install_snapshot_exceed_max_task_num) { LOG(WARNING) << "cluster stop"; cluster.stop_all(); - google::SetCommandLineOption("raft_max_install_snapshot_tasks_num", "1000"); + GFLAGS_NS::SetCommandLineOption("raft_max_install_snapshot_tasks_num", "1000"); } TEST_P(NodeTest, NoSnapshot) { @@ -3762,6 +3762,6 @@ INSTANTIATE_TEST_CASE_P(NodeTestWithPipelineReplication, int main(int argc, char* argv[]) { ::testing::AddGlobalTestEnvironment(new TestEnvironment()); ::testing::InitGoogleTest(&argc, argv); - google::ParseCommandLineFlags(&argc, &argv, true); + GFLAGS_NS::ParseCommandLineFlags(&argc, &argv, true); return RUN_ALL_TESTS(); } diff --git a/test/test_snapshot.cpp b/test/test_snapshot.cpp index 5224640e..3e9bce44 100644 --- a/test/test_snapshot.cpp +++ b/test/test_snapshot.cpp @@ -759,7 +759,7 @@ TEST_F(SnapshotTest, snapshot_throttle_for_writing) { } TEST_F(SnapshotTest, snapshot_throttle_for_reading_without_enable_throttle) { - google::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "false"); + GFLAGS_NS::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "false"); braft::FileSystemAdaptor* fs; FOR_EACH_FILE_SYSTEM_ADAPTOR_BEGIN(fs); @@ -839,11 +839,11 @@ TEST_F(SnapshotTest, snapshot_throttle_for_reading_without_enable_throttle) { delete storage1; FOR_EACH_FILE_SYSTEM_ADAPTOR_END; - google::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "true"); + GFLAGS_NS::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "true"); } TEST_F(SnapshotTest, snapshot_throttle_for_writing_without_enable_throttle) { - google::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "false"); + GFLAGS_NS::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "false"); braft::FileSystemAdaptor* fs; FOR_EACH_FILE_SYSTEM_ADAPTOR_BEGIN(fs); @@ -922,11 +922,11 @@ TEST_F(SnapshotTest, snapshot_throttle_for_writing_without_enable_throttle) { delete storage1; FOR_EACH_FILE_SYSTEM_ADAPTOR_END; - google::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "true"); + GFLAGS_NS::SetCommandLineOption("raft_enable_throttle_when_install_snapshot", "true"); } TEST_F(SnapshotTest, dynamically_change_throttle_threshold) { - google::SetCommandLineOption("raft_minimal_throttle_threshold_mb", "1"); + GFLAGS_NS::SetCommandLineOption("raft_minimal_throttle_threshold_mb", "1"); braft::FileSystemAdaptor* fs; FOR_EACH_FILE_SYSTEM_ADAPTOR_BEGIN(fs); @@ -1005,5 +1005,5 @@ TEST_F(SnapshotTest, dynamically_change_throttle_threshold) { delete storage1; FOR_EACH_FILE_SYSTEM_ADAPTOR_END; - google::SetCommandLineOption("raft_minimal_throttle_threshold_mb", "0"); + GFLAGS_NS::SetCommandLineOption("raft_minimal_throttle_threshold_mb", "0"); }