Skip to content

Commit

Permalink
[NFC][scudo] Fix warnings in tests after D139430
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Dec 9, 2022
1 parent 23f48f5 commit 0514d3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions compiler-rt/lib/scudo/standalone/tests/common_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ TEST(ScudoCommonTest, Zeros) {

#if SCUDO_LINUX
TEST(ScudoCommonTest, GetRssFromBuffer) {
constexpr size_t AllocSize = 10000000;
constexpr u64 Error = 3000000;
constexpr int64_t AllocSize = 10000000;
constexpr int64_t Error = 3000000;
constexpr size_t Runs = 10;

u64 Rss = scudo::GetRSS();
int64_t Rss = scudo::GetRSS();
EXPECT_GT(Rss, 0);

std::vector<std::unique_ptr<char[]>> Allocs(Runs);
for (auto &Alloc : Allocs) {
Alloc.reset(new char[AllocSize]());
u64 Prev = Rss;
int64_t Prev = Rss;
Rss = scudo::GetRSS();
EXPECT_LE(std::abs(static_cast<int64_t>(Rss - AllocSize - Prev)), Error);
EXPECT_LE(std::abs(Rss - AllocSize - Prev), Error);
}
}
#endif // SCUDO_LINUX
Expand Down

0 comments on commit 0514d3f

Please sign in to comment.