Commit 0b9d7cdc authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

Add a test that quantizes MemoryInfo's largest bucket

Bug: 939100
Change-Id: Ia8b7bd430ece375a14569d86482b38c9ad461fb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506877Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638680}
parent 7943dd68
......@@ -54,6 +54,12 @@ TEST(MemoryInfo, quantizeMemorySize) {
EXPECT_EQ(10000000u, QuantizeMemorySize(3));
EXPECT_EQ(10000000u, QuantizeMemorySize(1));
EXPECT_EQ(10000000u, QuantizeMemorySize(0));
// Rounding differences between OS's may affect the precise value of the last
// bucket.
EXPECT_LE(3760000000u,
QuantizeMemorySize(std::numeric_limits<size_t>::max()));
EXPECT_GT(4000000000u,
QuantizeMemorySize(std::numeric_limits<size_t>::max()));
}
static constexpr int kModForBucketizationCheck = 100000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment