| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void SetData(const std::string& string) { data_ = string; } | 126 void SetData(const std::string& string) { data_ = string; } |
| 127 | 127 |
| 128 protected: | 128 protected: |
| 129 virtual size_t SizeOfObject() override { | 129 virtual size_t SizeOfObject() override { |
| 130 EXPECT_GE(state(), kStateFrozen); | 130 EXPECT_GE(state(), kStateFrozen); |
| 131 return data_.size(); | 131 return data_.size(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 virtual bool WriteObject(FileWriterInterface* file_writer) override { | 134 virtual bool WriteObject(FileWriterInterface* file_writer) override { |
| 135 BaseTestMinidumpWritable::WriteObject(file_writer); | 135 BaseTestMinidumpWritable::WriteObject(file_writer); |
| 136 EXPECT_TRUE(file_writer->Write(&data_[0], data_.size())); | 136 bool rv = file_writer->Write(&data_[0], data_.size()); |
| 137 return true; | 137 EXPECT_TRUE(rv); |
| 138 return rv; |
| 138 } | 139 } |
| 139 | 140 |
| 140 private: | 141 private: |
| 141 std::string data_; | 142 std::string data_; |
| 142 | 143 |
| 143 DISALLOW_COPY_AND_ASSIGN(TestStringMinidumpWritable); | 144 DISALLOW_COPY_AND_ASSIGN(TestStringMinidumpWritable); |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 TEST(MinidumpWritable, MinidumpWritable) { | 147 TEST(MinidumpWritable, MinidumpWritable) { |
| 147 StringFileWriter writer; | 148 StringFileWriter writer; |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 EXPECT_STREQ("p", ldd->string); | 826 EXPECT_STREQ("p", ldd->string); |
| 826 ldd = LDDAtIndex(writer.string(), 48); | 827 ldd = LDDAtIndex(writer.string(), 48); |
| 827 EXPECT_EQ(10u, ldd->location_descriptor.DataSize); | 828 EXPECT_EQ(10u, ldd->location_descriptor.DataSize); |
| 828 EXPECT_EQ(12u, ldd->location_descriptor.Rva); | 829 EXPECT_EQ(12u, ldd->location_descriptor.Rva); |
| 829 EXPECT_STREQ("o", ldd->string); | 830 EXPECT_STREQ("o", ldd->string); |
| 830 parent.Verify(); | 831 parent.Verify(); |
| 831 } | 832 } |
| 832 } | 833 } |
| 833 | 834 |
| 834 } // namespace | 835 } // namespace |
| OLD | NEW |