Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: src/processor/range_map_unittest.cc

Issue 2029953003: Adding support for overlapping ranges to RangeMap. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Last patch set after git pull. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/processor/range_map_shrink_down_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/processor/range_map_unittest.cc
diff --git a/src/processor/range_map_unittest.cc b/src/processor/range_map_unittest.cc
index bf9b7279ad264f18d193958815704900a41c93cf..31b89e5de30f6dd4406eecb913aa14aa21c7812f 100644
--- a/src/processor/range_map_unittest.cc
+++ b/src/processor/range_map_unittest.cc
@@ -166,8 +166,10 @@ static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
linked_ptr<CountedObject> object;
AddressType retrieved_base = AddressType();
AddressType retrieved_size = AddressType();
+ AddressType retrieved_delta = AddressType();
bool retrieved = range_map->RetrieveRange(address, &object,
&retrieved_base,
+ &retrieved_delta,
&retrieved_size);
bool observed_result = retrieved && object->id() == range_test->id;
@@ -209,10 +211,12 @@ static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
linked_ptr<CountedObject> nearest_object;
AddressType nearest_base = AddressType();
+ AddressType nearest_delta = AddressType();
AddressType nearest_size = AddressType();
bool retrieved_nearest = range_map->RetrieveNearestRange(address,
&nearest_object,
&nearest_base,
+ &nearest_delta,
&nearest_size);
// When checking one greater than the high side, RetrieveNearestRange
@@ -274,7 +278,8 @@ static bool RetrieveIndexTest(TestMap *range_map, int set) {
int object_count = range_map->GetCount();
for (int object_index = 0; object_index < object_count; ++object_index) {
AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base, NULL)) {
+ if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
"expected success, observed failure\n",
set, object_index);
@@ -314,7 +319,8 @@ static bool RetrieveIndexTest(TestMap *range_map, int set) {
// Make sure that RetrieveRangeAtIndex doesn't allow lookups at indices that
// are too high.
- if (range_map->RetrieveRangeAtIndex(object_count, &object, NULL, NULL)) {
+ if (range_map->RetrieveRangeAtIndex(object_count, &object, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d (too large), "
"expected failure, observed success\n",
set, object_count);
@@ -343,7 +349,8 @@ static bool RetriveAtIndexTest2() {
int object_count = range_map->GetCount();
for (int object_index = 0; object_index < object_count; ++object_index) {
AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base, NULL)) {
+ if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveAtIndexTest2 index %d, "
"expected success, observed failure\n", object_index);
return false;
« no previous file with comments | « src/processor/range_map_shrink_down_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698