| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 explicit TestCodeModule(string code_file) : code_file_(code_file) {} | 72 explicit TestCodeModule(string code_file) : code_file_(code_file) {} |
| 73 virtual ~TestCodeModule() {} | 73 virtual ~TestCodeModule() {} |
| 74 | 74 |
| 75 virtual uint64_t base_address() const { return 0; } | 75 virtual uint64_t base_address() const { return 0; } |
| 76 virtual uint64_t size() const { return 0xb000; } | 76 virtual uint64_t size() const { return 0xb000; } |
| 77 virtual string code_file() const { return code_file_; } | 77 virtual string code_file() const { return code_file_; } |
| 78 virtual string code_identifier() const { return ""; } | 78 virtual string code_identifier() const { return ""; } |
| 79 virtual string debug_file() const { return ""; } | 79 virtual string debug_file() const { return ""; } |
| 80 virtual string debug_identifier() const { return ""; } | 80 virtual string debug_identifier() const { return ""; } |
| 81 virtual string version() const { return ""; } | 81 virtual string version() const { return ""; } |
| 82 virtual const CodeModule* Copy() const { | 82 virtual CodeModule* Copy() const { |
| 83 return new TestCodeModule(code_file_); | 83 return new TestCodeModule(code_file_); |
| 84 } | 84 } |
| 85 virtual uint64_t shrink_down_delta() const { return 0; } |
| 86 virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {} |
| 85 | 87 |
| 86 private: | 88 private: |
| 87 string code_file_; | 89 string code_file_; |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 // A mock memory region object, for use by the STACK CFI tests. | 92 // A mock memory region object, for use by the STACK CFI tests. |
| 91 class MockMemoryRegion: public MemoryRegion { | 93 class MockMemoryRegion: public MemoryRegion { |
| 92 uint64_t GetBase() const { return 0x10000; } | 94 uint64_t GetBase() const { return 0x10000; } |
| 93 uint32_t GetSize() const { return 0x01000; } | 95 uint32_t GetSize() const { return 0x01000; } |
| 94 bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { | 96 bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 ASSERT_TRUE(module_comparer.Compare(symbol_data_string)); | 482 ASSERT_TRUE(module_comparer.Compare(symbol_data_string)); |
| 481 } | 483 } |
| 482 } | 484 } |
| 483 | 485 |
| 484 } // namespace | 486 } // namespace |
| 485 | 487 |
| 486 int main(int argc, char *argv[]) { | 488 int main(int argc, char *argv[]) { |
| 487 ::testing::InitGoogleTest(&argc, argv); | 489 ::testing::InitGoogleTest(&argc, argv); |
| 488 return RUN_ALL_TESTS(); | 490 return RUN_ALL_TESTS(); |
| 489 } | 491 } |
| OLD | NEW |