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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 const char* expected_debug_name, | 151 const char* expected_debug_name, |
152 uint32_t expected_debug_type, | 152 uint32_t expected_debug_type, |
153 bool expected_debug_utf16) { | 153 bool expected_debug_utf16) { |
154 if (expected_debug_name) { | 154 if (expected_debug_name) { |
155 EXPECT_NE(0u, misc_record->Rva); | 155 EXPECT_NE(0u, misc_record->Rva); |
156 const IMAGE_DEBUG_MISC* misc_debug_record = | 156 const IMAGE_DEBUG_MISC* misc_debug_record = |
157 MinidumpWritableAtLocationDescriptor<IMAGE_DEBUG_MISC>(file_contents, | 157 MinidumpWritableAtLocationDescriptor<IMAGE_DEBUG_MISC>(file_contents, |
158 *misc_record); | 158 *misc_record); |
159 ASSERT_TRUE(misc_debug_record); | 159 ASSERT_TRUE(misc_debug_record); |
160 EXPECT_EQ(expected_debug_type, misc_debug_record->DataType); | 160 EXPECT_EQ(expected_debug_type, misc_debug_record->DataType); |
161 EXPECT_EQ(expected_debug_utf16, | 161 EXPECT_EQ(expected_debug_utf16, misc_debug_record->Unicode != 0); |
162 static_cast<bool>(misc_debug_record->Unicode)); | |
163 EXPECT_EQ(0u, misc_debug_record->Reserved[0]); | 162 EXPECT_EQ(0u, misc_debug_record->Reserved[0]); |
164 EXPECT_EQ(0u, misc_debug_record->Reserved[1]); | 163 EXPECT_EQ(0u, misc_debug_record->Reserved[1]); |
165 EXPECT_EQ(0u, misc_debug_record->Reserved[2]); | 164 EXPECT_EQ(0u, misc_debug_record->Reserved[2]); |
166 | 165 |
167 // Check for the NUL terminator. | 166 // Check for the NUL terminator. |
168 size_t bytes_available = | 167 size_t bytes_available = |
169 misc_debug_record->Length - offsetof(IMAGE_DEBUG_MISC, Data); | 168 misc_debug_record->Length - offsetof(IMAGE_DEBUG_MISC, Data); |
170 EXPECT_EQ('\0', misc_debug_record->Data[bytes_available - 1]); | 169 EXPECT_EQ('\0', misc_debug_record->Data[bytes_available - 1]); |
171 std::string observed_data( | 170 std::string observed_data( |
172 reinterpret_cast<const char*>(misc_debug_record->Data)); | 171 reinterpret_cast<const char*>(misc_debug_record->Data)); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 minidump_file_writer.AddStream(module_list_writer.Pass()); | 750 minidump_file_writer.AddStream(module_list_writer.Pass()); |
752 | 751 |
753 StringFile string_file; | 752 StringFile string_file; |
754 ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file), | 753 ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file), |
755 "name_"); | 754 "name_"); |
756 } | 755 } |
757 | 756 |
758 } // namespace | 757 } // namespace |
759 } // namespace test | 758 } // namespace test |
760 } // namespace crashpad | 759 } // namespace crashpad |
OLD | NEW |