Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(339)

Unified Diff: syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc

Issue 135210045: Add GetAllocationSize support to ZebraBlockHeap. (Closed) Base URL: http://sawbuck.googlecode.com/svn/trunk
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « syzygy/agent/asan/heaps/zebra_block_heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
diff --git a/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc b/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
index caf90cb69f181040870a51863cbe10cda43a1086..6203b44ceb108179e753849a04664a652e341906 100644
--- a/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
+++ b/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
@@ -74,7 +74,8 @@ class TestZebraBlockHeap : public ZebraBlockHeap {
TEST(ZebraBlockHeapTest, FeaturesAreValid) {
TestZebraBlockHeap h;
EXPECT_EQ(HeapInterface::kHeapSupportsIsAllocated |
- HeapInterface::kHeapReportsReservations,
+ HeapInterface::kHeapReportsReservations |
+ HeapInterface::kHeapSupportsGetAllocationSize,
h.GetHeapFeatures());
}
@@ -388,6 +389,14 @@ TEST(ZebraBlockHeapTest, IsAllocated) {
EXPECT_FALSE(h.IsAllocated(a));
}
+TEST(ZebraBlockHeapTest, GetAllocationSize) {
+ TestZebraBlockHeap h;
+
+ void* alloc = h.Allocate(67);
+ ASSERT_TRUE(alloc != NULL);
+ EXPECT_EQ(67u, h.GetAllocationSize(alloc));
+}
+
TEST(ZebraBlockHeapTest, PushPopInvariant) {
TestZebraBlockHeap h;
BlockLayout layout = {};
« no previous file with comments | « syzygy/agent/asan/heaps/zebra_block_heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b