Index: base/sys_info_unittest.cc |
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc |
index 3793ff33192f9f331e8f20cac9649af28a25378b..e80884b9b20ffb3b050cab7cfef093500a7cadb9 100644 |
--- a/base/sys_info_unittest.cc |
+++ b/base/sys_info_unittest.cc |
@@ -43,8 +43,8 @@ TEST_F(SysInfoTest, AmountOfAvailablePhysicalMemory) { |
EXPECT_LT(info.available, info.total); |
const int64_t amount = SysInfo::AmountOfAvailablePhysicalMemory(info); |
// We aren't actually testing that it's correct, just that it's sane. |
- EXPECT_GT(amount, info.free * 1024); |
- EXPECT_LT(amount, info.available * 1024); |
+ EXPECT_GT(amount, static_cast<int64_t>(info.free) * 1024); |
+ EXPECT_LT(amount / 1024, info.available); |
// Simulate as if there is no MemAvailable. |
info.available = 0; |
} |
@@ -52,8 +52,8 @@ TEST_F(SysInfoTest, AmountOfAvailablePhysicalMemory) { |
// There is no MemAvailable. Check the fallback logic. |
const int64_t amount = SysInfo::AmountOfAvailablePhysicalMemory(info); |
// We aren't actually testing that it's correct, just that it's sane. |
- EXPECT_GT(amount, info.free * 1024); |
- EXPECT_LT(amount, info.total * 1024); |
+ EXPECT_GT(amount, static_cast<int64_t>(info.free) * 1024); |
+ EXPECT_LT(amount / 1024, info.total); |
} |
#endif // defined(OS_LINUX) || defined(OS_ANDROID) |