| OLD | NEW |
| 1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void RetrieveIndexTest(const TestMap* range_map, int set); | 191 void RetrieveIndexTest(const TestMap* range_map, int set); |
| 192 | 192 |
| 193 void RunTestCase(int test_case); | 193 void RunTestCase(int test_case); |
| 194 | 194 |
| 195 unsigned int kTestCasesCount_; | 195 unsigned int kTestCasesCount_; |
| 196 RangeMapSerializer<AddressType, EntryType> serializer_; | 196 RangeMapSerializer<AddressType, EntryType> serializer_; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 void TestStaticRangeMap::StoreTest(RMap* range_map, | 199 void TestStaticRangeMap::StoreTest(RMap* range_map, |
| 200 const RangeTest* range_test) { | 200 const RangeTest* range_test) { |
| 201 bool stored = range_map->StoreRange(range_test->address, | 201 bool stored = range_map->StoreRange(range_test->address, 0 /* delta */, |
| 202 range_test->size, | 202 range_test->size, range_test->id); |
| 203 range_test->id); | |
| 204 EXPECT_EQ(stored, range_test->expect_storable) | 203 EXPECT_EQ(stored, range_test->expect_storable) |
| 205 << "StoreRange id " << range_test->id << "FAILED"; | 204 << "StoreRange id " << range_test->id << "FAILED"; |
| 206 } | 205 } |
| 207 | 206 |
| 208 void TestStaticRangeMap::RetrieveTest(TestMap* range_map, | 207 void TestStaticRangeMap::RetrieveTest(TestMap* range_map, |
| 209 const RangeTest* range_test) { | 208 const RangeTest* range_test) { |
| 210 for (unsigned int side = 0; side <= 1; ++side) { | 209 for (unsigned int side = 0; side <= 1; ++side) { |
| 211 // When side == 0, check the low side (base address) of each range. | 210 // When side == 0, check the low side (base address) of each range. |
| 212 // When side == 1, check the high side (base + size) of each range. | 211 // When side == 1, check the high side (base + size) of each range. |
| 213 | 212 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 RunTestCase(test_case); | 411 RunTestCase(test_case); |
| 413 } | 412 } |
| 414 | 413 |
| 415 } // namespace google_breakpad | 414 } // namespace google_breakpad |
| 416 | 415 |
| 417 int main(int argc, char *argv[]) { | 416 int main(int argc, char *argv[]) { |
| 418 ::testing::InitGoogleTest(&argc, argv); | 417 ::testing::InitGoogleTest(&argc, argv); |
| 419 | 418 |
| 420 return RUN_ALL_TESTS(); | 419 return RUN_ALL_TESTS(); |
| 421 } | 420 } |
| OLD | NEW |