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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 using std::map; | 50 using std::map; |
51 using google_breakpad::MemoryRegion; | 51 using google_breakpad::MemoryRegion; |
52 using google_breakpad::PostfixEvaluator; | 52 using google_breakpad::PostfixEvaluator; |
53 | 53 |
54 | 54 |
55 // FakeMemoryRegion is used to test PostfixEvaluator's dereference (^) | 55 // FakeMemoryRegion is used to test PostfixEvaluator's dereference (^) |
56 // operator. The result of dereferencing a value is one greater than | 56 // operator. The result of dereferencing a value is one greater than |
57 // the value. | 57 // the value. |
58 class FakeMemoryRegion : public MemoryRegion { | 58 class FakeMemoryRegion : public MemoryRegion { |
59 public: | 59 public: |
60 virtual u_int64_t GetBase() const { return 0; } | 60 virtual uint64_t GetBase() const { return 0; } |
61 virtual u_int32_t GetSize() const { return 0; } | 61 virtual uint32_t GetSize() const { return 0; } |
62 virtual bool GetMemoryAtAddress(u_int64_t address, u_int8_t *value) const { | 62 virtual bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { |
63 *value = address + 1; | 63 *value = address + 1; |
64 return true; | 64 return true; |
65 } | 65 } |
66 virtual bool GetMemoryAtAddress(u_int64_t address, u_int16_t *value) const { | 66 virtual bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const { |
67 *value = address + 1; | 67 *value = address + 1; |
68 return true; | 68 return true; |
69 } | 69 } |
70 virtual bool GetMemoryAtAddress(u_int64_t address, u_int32_t *value) const { | 70 virtual bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const { |
71 *value = address + 1; | 71 *value = address + 1; |
72 return true; | 72 return true; |
73 } | 73 } |
74 virtual bool GetMemoryAtAddress(u_int64_t address, u_int64_t *value) const { | 74 virtual bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const { |
75 *value = address + 1; | 75 *value = address + 1; |
76 return true; | 76 return true; |
77 } | 77 } |
78 }; | 78 }; |
79 | 79 |
80 | 80 |
81 struct EvaluateTest { | 81 struct EvaluateTest { |
82 // Expression passed to PostfixEvaluator::Evaluate. | 82 // Expression passed to PostfixEvaluator::Evaluate. |
83 const string expression; | 83 const string expression; |
84 | 84 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 | 391 |
392 } // namespace | 392 } // namespace |
393 | 393 |
394 | 394 |
395 int main(int argc, char **argv) { | 395 int main(int argc, char **argv) { |
396 BPLOG_INIT(&argc, &argv); | 396 BPLOG_INIT(&argc, &argv); |
397 | 397 |
398 return RunTests() ? 0 : 1; | 398 return RunTests() ? 0 : 1; |
399 } | 399 } |
OLD | NEW |