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 15 matching lines...) Expand all Loading... |
26 #include "gtest/gtest.h" | 26 #include "gtest/gtest.h" |
27 #include "minidump/minidump_extensions.h" | 27 #include "minidump/minidump_extensions.h" |
28 #include "minidump/minidump_file_writer.h" | 28 #include "minidump/minidump_file_writer.h" |
29 #include "minidump/test/minidump_file_writer_test_util.h" | 29 #include "minidump/test/minidump_file_writer_test_util.h" |
30 #include "minidump/test/minidump_string_writer_test_util.h" | 30 #include "minidump/test/minidump_string_writer_test_util.h" |
31 #include "minidump/test/minidump_writable_test_util.h" | 31 #include "minidump/test/minidump_writable_test_util.h" |
32 #include "snapshot/test/test_module_snapshot.h" | 32 #include "snapshot/test/test_module_snapshot.h" |
33 #include "util/file/string_file.h" | 33 #include "util/file/string_file.h" |
34 #include "util/misc/uuid.h" | 34 #include "util/misc/uuid.h" |
35 #include "util/stdlib/pointer_container.h" | 35 #include "util/stdlib/pointer_container.h" |
| 36 #include "util/test/gtest_death_check.h" |
36 | 37 |
37 namespace crashpad { | 38 namespace crashpad { |
38 namespace test { | 39 namespace test { |
39 namespace { | 40 namespace { |
40 | 41 |
41 void GetModuleListStream(const std::string& file_contents, | 42 void GetModuleListStream(const std::string& file_contents, |
42 const MINIDUMP_MODULE_LIST** module_list) { | 43 const MINIDUMP_MODULE_LIST** module_list) { |
43 const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER); | 44 const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER); |
44 const size_t kModuleListStreamOffset = | 45 const size_t kModuleListStreamOffset = |
45 kDirectoryOffset + sizeof(MINIDUMP_DIRECTORY); | 46 kDirectoryOffset + sizeof(MINIDUMP_DIRECTORY); |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 } | 747 } |
747 | 748 |
748 TEST(MinidumpModuleWriterDeathTest, NoModuleName) { | 749 TEST(MinidumpModuleWriterDeathTest, NoModuleName) { |
749 MinidumpFileWriter minidump_file_writer; | 750 MinidumpFileWriter minidump_file_writer; |
750 auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter()); | 751 auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter()); |
751 auto module_writer = make_scoped_ptr(new MinidumpModuleWriter()); | 752 auto module_writer = make_scoped_ptr(new MinidumpModuleWriter()); |
752 module_list_writer->AddModule(module_writer.Pass()); | 753 module_list_writer->AddModule(module_writer.Pass()); |
753 minidump_file_writer.AddStream(module_list_writer.Pass()); | 754 minidump_file_writer.AddStream(module_list_writer.Pass()); |
754 | 755 |
755 StringFile string_file; | 756 StringFile string_file; |
756 ASSERT_DEATH(minidump_file_writer.WriteEverything(&string_file), "name_"); | 757 ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file), |
| 758 "name_"); |
757 } | 759 } |
758 | 760 |
759 } // namespace | 761 } // namespace |
760 } // namespace test | 762 } // namespace test |
761 } // namespace crashpad | 763 } // namespace crashpad |
OLD | NEW |