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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 TestCodeModule(string code_file) : code_file_(code_file) {} | 61 TestCodeModule(string code_file) : code_file_(code_file) {} |
62 virtual ~TestCodeModule() {} | 62 virtual ~TestCodeModule() {} |
63 | 63 |
64 virtual uint64_t base_address() const { return 0; } | 64 virtual uint64_t base_address() const { return 0; } |
65 virtual uint64_t size() const { return 0xb000; } | 65 virtual uint64_t size() const { return 0xb000; } |
66 virtual string code_file() const { return code_file_; } | 66 virtual string code_file() const { return code_file_; } |
67 virtual string code_identifier() const { return ""; } | 67 virtual string code_identifier() const { return ""; } |
68 virtual string debug_file() const { return ""; } | 68 virtual string debug_file() const { return ""; } |
69 virtual string debug_identifier() const { return ""; } | 69 virtual string debug_identifier() const { return ""; } |
70 virtual string version() const { return ""; } | 70 virtual string version() const { return ""; } |
71 virtual const CodeModule* Copy() const { | 71 virtual CodeModule* Copy() const { |
72 return new TestCodeModule(code_file_); | 72 return new TestCodeModule(code_file_); |
73 } | 73 } |
| 74 virtual uint64_t shrink_down_delta() const { return 0; } |
| 75 virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {} |
74 | 76 |
75 private: | 77 private: |
76 string code_file_; | 78 string code_file_; |
77 }; | 79 }; |
78 | 80 |
79 // A mock memory region object, for use by the STACK CFI tests. | 81 // A mock memory region object, for use by the STACK CFI tests. |
80 class MockMemoryRegion: public MemoryRegion { | 82 class MockMemoryRegion: public MemoryRegion { |
81 uint64_t GetBase() const { return 0x10000; } | 83 uint64_t GetBase() const { return 0x10000; } |
82 uint32_t GetSize() const { return 0x01000; } | 84 uint32_t GetSize() const { return 0x01000; } |
83 bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { | 85 bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine5, &address, | 673 ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine5, &address, |
672 &stack_param_size, &name)); | 674 &stack_param_size, &name)); |
673 } | 675 } |
674 | 676 |
675 } // namespace | 677 } // namespace |
676 | 678 |
677 int main(int argc, char *argv[]) { | 679 int main(int argc, char *argv[]) { |
678 ::testing::InitGoogleTest(&argc, argv); | 680 ::testing::InitGoogleTest(&argc, argv); |
679 return RUN_ALL_TESTS(); | 681 return RUN_ALL_TESTS(); |
680 } | 682 } |
OLD | NEW |