diff options
Diffstat (limited to 'lib/scudo/standalone/tests/combined_test.cpp')
-rw-r--r-- | lib/scudo/standalone/tests/combined_test.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/scudo/standalone/tests/combined_test.cpp b/lib/scudo/standalone/tests/combined_test.cpp index 3f971a304..d74c07e84 100644 --- a/lib/scudo/standalone/tests/combined_test.cpp +++ b/lib/scudo/standalone/tests/combined_test.cpp @@ -136,7 +136,21 @@ template <class Config> static void testAllocator() { } Allocator->releaseToOS(); - Allocator->printStats(); + + scudo::uptr BufferSize = 8192; + std::vector<char> Buffer(BufferSize); + scudo::uptr ActualSize = Allocator->getStats(Buffer.data(), BufferSize); + while (ActualSize > BufferSize) { + BufferSize = ActualSize + 1024; + Buffer.resize(BufferSize); + ActualSize = Allocator->getStats(Buffer.data(), BufferSize); + } + std::string Stats(Buffer.begin(), Buffer.end()); + // Basic checks on the contents of the statistics output, which also allows us + // to verify that we got it all. + EXPECT_NE(Stats.find("Stats: SizeClassAllocator"), std::string::npos); + EXPECT_NE(Stats.find("Stats: MapAllocator"), std::string::npos); + EXPECT_NE(Stats.find("Stats: Quarantine"), std::string::npos); } TEST(ScudoCombinedTest, BasicCombined) { |