Index: webrtc/base/helpers_unittest.cc |
diff --git a/webrtc/base/helpers_unittest.cc b/webrtc/base/helpers_unittest.cc |
index 83cc68591995b5dfdcb2331e84ac0f3d006ce693..565384c5a469443bdf39591e0ed58c6b1db7d45f 100644 |
--- a/webrtc/base/helpers_unittest.cc |
+++ b/webrtc/base/helpers_unittest.cc |
@@ -20,6 +20,8 @@ class RandomTest : public testing::Test {}; |
TEST_F(RandomTest, TestCreateRandomId) { |
CreateRandomId(); |
+ uint32_t id; |
+ EXPECT_TRUE(CreateRandomId(&id)); |
} |
TEST_F(RandomTest, TestCreateRandomDouble) { |
@@ -27,11 +29,17 @@ TEST_F(RandomTest, TestCreateRandomDouble) { |
double r = CreateRandomDouble(); |
EXPECT_GE(r, 0.0); |
EXPECT_LT(r, 1.0); |
+ EXPECT_TRUE(CreateRandomDouble(&r)); |
+ EXPECT_GE(r, 0.0); |
+ EXPECT_LT(r, 1.0); |
} |
} |
TEST_F(RandomTest, TestCreateNonZeroRandomId) { |
EXPECT_NE(0U, CreateRandomNonZeroId()); |
+ uint32_t id; |
+ EXPECT_TRUE(CreateRandomNonZeroId(&id)); |
+ EXPECT_NE(0U, id); |
} |
TEST_F(RandomTest, TestCreateRandomString) { |
@@ -46,6 +54,9 @@ TEST_F(RandomTest, TestCreateRandomString) { |
TEST_F(RandomTest, TestCreateRandomUuid) { |
std::string random = CreateRandomUuid(); |
EXPECT_EQ(36U, random.size()); |
+ random.clear(); |
+ EXPECT_TRUE(CreateRandomUuid(&random)); |
+ EXPECT_EQ(36U, random.size()); |
} |
TEST_F(RandomTest, TestCreateRandomForTest) { |