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 13 matching lines...) Expand all Loading... |
24 #include "util/file/string_file.h" | 24 #include "util/file/string_file.h" |
25 | 25 |
26 namespace crashpad { | 26 namespace crashpad { |
27 namespace test { | 27 namespace test { |
28 namespace { | 28 namespace { |
29 | 29 |
30 const MinidumpSimpleStringDictionary* MinidumpSimpleStringDictionaryAtStart( | 30 const MinidumpSimpleStringDictionary* MinidumpSimpleStringDictionaryAtStart( |
31 const std::string& file_contents, | 31 const std::string& file_contents, |
32 size_t count) { | 32 size_t count) { |
33 MINIDUMP_LOCATION_DESCRIPTOR location_descriptor; | 33 MINIDUMP_LOCATION_DESCRIPTOR location_descriptor; |
34 location_descriptor.DataSize = | 34 location_descriptor.DataSize = static_cast<uint32_t>( |
35 sizeof(MinidumpSimpleStringDictionary) + | 35 sizeof(MinidumpSimpleStringDictionary) + |
36 count * sizeof(MinidumpSimpleStringDictionaryEntry); | 36 count * sizeof(MinidumpSimpleStringDictionaryEntry)); |
37 location_descriptor.Rva = 0; | 37 location_descriptor.Rva = 0; |
38 return MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( | 38 return MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( |
39 file_contents, location_descriptor); | 39 file_contents, location_descriptor); |
40 } | 40 } |
41 | 41 |
42 TEST(MinidumpSimpleStringDictionaryWriter, EmptySimpleStringDictionary) { | 42 TEST(MinidumpSimpleStringDictionaryWriter, EmptySimpleStringDictionary) { |
43 StringFile string_file; | 43 StringFile string_file; |
44 | 44 |
45 MinidumpSimpleStringDictionaryWriter dictionary_writer; | 45 MinidumpSimpleStringDictionaryWriter dictionary_writer; |
46 | 46 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 MinidumpUTF8StringAtRVAAsString(string_file.string(), | 278 MinidumpUTF8StringAtRVAAsString(string_file.string(), |
279 dictionary->entries[2].key)); | 279 dictionary->entries[2].key)); |
280 EXPECT_EQ(kValue2, | 280 EXPECT_EQ(kValue2, |
281 MinidumpUTF8StringAtRVAAsString(string_file.string(), | 281 MinidumpUTF8StringAtRVAAsString(string_file.string(), |
282 dictionary->entries[2].value)); | 282 dictionary->entries[2].value)); |
283 } | 283 } |
284 | 284 |
285 } // namespace | 285 } // namespace |
286 } // namespace test | 286 } // namespace test |
287 } // namespace crashpad | 287 } // namespace crashpad |
OLD | NEW |