| 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 24 matching lines...) Expand all Loading... |
| 35 uint64_t TestMinidumpMemoryWriter::MemoryRangeBaseAddress() const { | 35 uint64_t TestMinidumpMemoryWriter::MemoryRangeBaseAddress() const { |
| 36 EXPECT_EQ(state(), kStateFrozen); | 36 EXPECT_EQ(state(), kStateFrozen); |
| 37 return base_address_; | 37 return base_address_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 size_t TestMinidumpMemoryWriter::MemoryRangeSize() const { | 40 size_t TestMinidumpMemoryWriter::MemoryRangeSize() const { |
| 41 EXPECT_GE(state(), kStateFrozen); | 41 EXPECT_GE(state(), kStateFrozen); |
| 42 return size_; | 42 return size_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool TestMinidumpMemoryWriter::WillWriteAtOffsetImpl(off_t offset) { | 45 bool TestMinidumpMemoryWriter::WillWriteAtOffsetImpl(FileOffset offset) { |
| 46 EXPECT_EQ(state(), kStateFrozen); | 46 EXPECT_EQ(state(), kStateFrozen); |
| 47 expected_offset_ = offset; | 47 expected_offset_ = offset; |
| 48 bool rv = MinidumpMemoryWriter::WillWriteAtOffsetImpl(offset); | 48 bool rv = MinidumpMemoryWriter::WillWriteAtOffsetImpl(offset); |
| 49 EXPECT_TRUE(rv); | 49 EXPECT_TRUE(rv); |
| 50 return rv; | 50 return rv; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool TestMinidumpMemoryWriter::WriteObject(FileWriterInterface* file_writer) { | 53 bool TestMinidumpMemoryWriter::WriteObject(FileWriterInterface* file_writer) { |
| 54 EXPECT_EQ(state(), kStateWritable); | 54 EXPECT_EQ(state(), kStateWritable); |
| 55 EXPECT_EQ(expected_offset_, file_writer->Seek(0, SEEK_CUR)); | 55 EXPECT_EQ(expected_offset_, file_writer->Seek(0, SEEK_CUR)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 std::string expected_data(expected->Memory.DataSize, value); | 96 std::string expected_data(expected->Memory.DataSize, value); |
| 97 std::string observed_data(&file_contents[observed->Memory.Rva], | 97 std::string observed_data(&file_contents[observed->Memory.Rva], |
| 98 observed->Memory.DataSize); | 98 observed->Memory.DataSize); |
| 99 EXPECT_EQ(expected_data, observed_data); | 99 EXPECT_EQ(expected_data, observed_data); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace test | 102 } // namespace test |
| 103 } // namespace crashpad | 103 } // namespace crashpad |
| OLD | NEW |