diff options
author | Brian Silverman <bsilver16384@gmail.com> | 2016-03-01 17:55:59 -0500 |
---|---|---|
committer | Brian Silverman <bsilver16384@gmail.com> | 2016-03-01 17:59:39 -0500 |
commit | a1c764d2632cc0090f31d8d56effb94a8d049b54 (patch) | |
tree | f7c0e025bc13d580e7813b9781e7f7f70bf7b6c7 | |
parent | 22123a37c236e26535d3f3fff7f31a5b6515d7d6 (diff) | |
download | gperftools-a1c764d2632cc0090f31d8d56effb94a8d049b54.tar.gz |
Initialize counters in test
-rw-r--r-- | src/tests/profile-handler_unittest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/profile-handler_unittest.cc b/src/tests/profile-handler_unittest.cc index 606fba9..a8afbca 100644 --- a/src/tests/profile-handler_unittest.cc +++ b/src/tests/profile-handler_unittest.cc @@ -318,14 +318,14 @@ TEST_F(ProfileHandlerTest, RegisterUnregisterCallback) { // Verifies that multiple callbacks can be registered. TEST_F(ProfileHandlerTest, MultipleCallbacks) { // Register first callback. - int first_tick_count; + int first_tick_count = 0; ProfileHandlerToken* token1 = RegisterCallback(&first_tick_count); // Check that callback was registered correctly. VerifyRegistration(first_tick_count); EXPECT_EQ(1, GetCallbackCount()); // Register second callback. - int second_tick_count; + int second_tick_count = 0; ProfileHandlerToken* token2 = RegisterCallback(&second_tick_count); // Check that callback was registered correctly. VerifyRegistration(second_tick_count); @@ -351,13 +351,13 @@ TEST_F(ProfileHandlerTest, MultipleCallbacks) { TEST_F(ProfileHandlerTest, Reset) { // Verify that the profile timer interrupt is disabled. if (!linux_per_thread_timers_mode_) VerifyDisabled(); - int first_tick_count; + int first_tick_count = 0; RegisterCallback(&first_tick_count); VerifyRegistration(first_tick_count); EXPECT_EQ(1, GetCallbackCount()); // Register second callback. - int second_tick_count; + int second_tick_count = 0; RegisterCallback(&second_tick_count); VerifyRegistration(second_tick_count); EXPECT_EQ(2, GetCallbackCount()); @@ -384,7 +384,7 @@ TEST_F(ProfileHandlerTest, RegisterCallbackBeforeThread) { StartWorker(); // Register a callback and check that profile ticks are being delivered and // the timer is enabled. - int tick_count; + int tick_count = 0; RegisterCallback(&tick_count); EXPECT_EQ(1, GetCallbackCount()); VerifyRegistration(tick_count); |