OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 return children; | 83 return children; |
84 } | 84 } |
85 return MinidumpWritable::Children(); | 85 return MinidumpWritable::Children(); |
86 } | 86 } |
87 | 87 |
88 Phase WritePhase() override { | 88 Phase WritePhase() override { |
89 return has_phase_ ? phase_ : MinidumpWritable::Phase(); | 89 return has_phase_ ? phase_ : MinidumpWritable::Phase(); |
90 } | 90 } |
91 | 91 |
92 bool WillWriteAtOffsetImpl(off_t offset) override { | 92 bool WillWriteAtOffsetImpl(FileOffset offset) override { |
93 EXPECT_EQ(state(), kStateFrozen); | 93 EXPECT_EQ(state(), kStateFrozen); |
94 expected_offset_ = offset; | 94 expected_offset_ = offset; |
95 bool rv = MinidumpWritable::WillWriteAtOffsetImpl(offset); | 95 bool rv = MinidumpWritable::WillWriteAtOffsetImpl(offset); |
96 EXPECT_TRUE(rv); | 96 EXPECT_TRUE(rv); |
97 return rv; | 97 return rv; |
98 } | 98 } |
99 | 99 |
100 bool WriteObject(FileWriterInterface* file_writer) override { | 100 bool WriteObject(FileWriterInterface* file_writer) override { |
101 EXPECT_EQ(state(), kStateWritable); | 101 EXPECT_EQ(state(), kStateWritable); |
102 EXPECT_EQ(expected_offset_, file_writer->Seek(0, SEEK_CUR)); | 102 EXPECT_EQ(expected_offset_, file_writer->Seek(0, SEEK_CUR)); |
103 | 103 |
104 // Subclasses must override this. | 104 // Subclasses must override this. |
105 return false; | 105 return false; |
106 } | 106 } |
107 | 107 |
108 private: | 108 private: |
109 std::vector<BaseTestMinidumpWritable*> children_; | 109 std::vector<BaseTestMinidumpWritable*> children_; |
110 off_t expected_offset_; | 110 FileOffset expected_offset_; |
111 size_t alignment_; | 111 size_t alignment_; |
112 Phase phase_; | 112 Phase phase_; |
113 bool has_alignment_; | 113 bool has_alignment_; |
114 bool has_phase_; | 114 bool has_phase_; |
115 bool verified_; | 115 bool verified_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(BaseTestMinidumpWritable); | 117 DISALLOW_COPY_AND_ASSIGN(BaseTestMinidumpWritable); |
118 }; | 118 }; |
119 | 119 |
120 class TestStringMinidumpWritable final : public BaseTestMinidumpWritable { | 120 class TestStringMinidumpWritable final : public BaseTestMinidumpWritable { |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 EXPECT_EQ(10u, ldd->location_descriptor.DataSize); | 828 EXPECT_EQ(10u, ldd->location_descriptor.DataSize); |
829 EXPECT_EQ(12u, ldd->location_descriptor.Rva); | 829 EXPECT_EQ(12u, ldd->location_descriptor.Rva); |
830 EXPECT_STREQ("o", ldd->string); | 830 EXPECT_STREQ("o", ldd->string); |
831 parent.Verify(); | 831 parent.Verify(); |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
835 } // namespace | 835 } // namespace |
836 } // namespace test | 836 } // namespace test |
837 } // namespace crashpad | 837 } // namespace crashpad |
OLD | NEW |