PM: Various fixes to Random Provider
* Remove mention of uint64; use uint64_t instead.
* Simpler reading of bytes from /dev/urandom into a uint64_t.
* Replace string concatenation with StringPrintf.
BUG=None
TEST=Builds and passes unit tests.
Change-Id: Ic0760ae4c2b21e4ffc823a676a9439e867bf9f64
Reviewed-on: https://chromium-review.googlesource.com/184326
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/policy_manager/random_provider_unittest.cc b/policy_manager/random_provider_unittest.cc
index af11b6e..265050e 100644
--- a/policy_manager/random_provider_unittest.cc
+++ b/policy_manager/random_provider_unittest.cc
@@ -40,7 +40,7 @@
TEST_F(PmRandomProviderTest, GetRandomValues) {
string errmsg;
- scoped_ptr<const uint64> value(
+ scoped_ptr<const uint64_t> value(
var_random_seed->GetValue(TimeDelta::FromSeconds(1.), &errmsg));
ASSERT_TRUE(value != NULL);
@@ -48,7 +48,7 @@
// Test that at least the returned values are different. This test fails,
// by design, once every 2^320 runs.
for (int i = 0; i < 5; i++) {
- scoped_ptr<const uint64> other_value(
+ scoped_ptr<const uint64_t> other_value(
var_random_seed->GetValue(TimeDelta::FromSeconds(1.), &errmsg));
ASSERT_TRUE(other_value != NULL);
always_returns_the_same_value = always_returns_the_same_value &&