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 "minidump/minidump_writable.h" | 26 #include "minidump/minidump_writable.h" |
27 #include "minidump/test/minidump_file_writer_test_util.h" | 27 #include "minidump/test/minidump_file_writer_test_util.h" |
28 #include "minidump/test/minidump_writable_test_util.h" | 28 #include "minidump/test/minidump_writable_test_util.h" |
29 #include "snapshot/test/test_cpu_context.h" | 29 #include "snapshot/test/test_cpu_context.h" |
30 #include "snapshot/test/test_exception_snapshot.h" | 30 #include "snapshot/test/test_exception_snapshot.h" |
31 #include "snapshot/test/test_module_snapshot.h" | 31 #include "snapshot/test/test_module_snapshot.h" |
32 #include "snapshot/test/test_process_snapshot.h" | 32 #include "snapshot/test/test_process_snapshot.h" |
33 #include "snapshot/test/test_system_snapshot.h" | 33 #include "snapshot/test/test_system_snapshot.h" |
34 #include "snapshot/test/test_thread_snapshot.h" | 34 #include "snapshot/test/test_thread_snapshot.h" |
35 #include "util/file/string_file.h" | 35 #include "util/file/string_file.h" |
36 #include "util/file/string_file.h" | 36 #include "util/test/gtest_death_check.h" |
37 | 37 |
38 namespace crashpad { | 38 namespace crashpad { |
39 namespace test { | 39 namespace test { |
40 namespace { | 40 namespace { |
41 | 41 |
42 TEST(MinidumpFileWriter, Empty) { | 42 TEST(MinidumpFileWriter, Empty) { |
43 MinidumpFileWriter minidump_file; | 43 MinidumpFileWriter minidump_file; |
44 StringFile string_file; | 44 StringFile string_file; |
45 ASSERT_TRUE(minidump_file.WriteEverything(&string_file)); | 45 ASSERT_TRUE(minidump_file.WriteEverything(&string_file)); |
46 ASSERT_EQ(sizeof(MINIDUMP_HEADER), string_file.string().size()); | 46 ASSERT_EQ(sizeof(MINIDUMP_HEADER), string_file.string().size()); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 auto stream0 = make_scoped_ptr( | 429 auto stream0 = make_scoped_ptr( |
430 new TestStream(kStream0Type, kStream0Size, kStream0Value)); | 430 new TestStream(kStream0Type, kStream0Size, kStream0Value)); |
431 minidump_file.AddStream(stream0.Pass()); | 431 minidump_file.AddStream(stream0.Pass()); |
432 | 432 |
433 // It is an error to add a second stream of the same type. | 433 // It is an error to add a second stream of the same type. |
434 const size_t kStream1Size = 3; | 434 const size_t kStream1Size = 3; |
435 const MinidumpStreamType kStream1Type = static_cast<MinidumpStreamType>(0x4d); | 435 const MinidumpStreamType kStream1Type = static_cast<MinidumpStreamType>(0x4d); |
436 const uint8_t kStream1Value = 0xa5; | 436 const uint8_t kStream1Value = 0xa5; |
437 auto stream1 = make_scoped_ptr( | 437 auto stream1 = make_scoped_ptr( |
438 new TestStream(kStream1Type, kStream1Size, kStream1Value)); | 438 new TestStream(kStream1Type, kStream1Size, kStream1Value)); |
439 ASSERT_DEATH(minidump_file.AddStream(stream1.Pass()), "already present"); | 439 ASSERT_DEATH_CHECK(minidump_file.AddStream(stream1.Pass()), |
| 440 "already present"); |
440 } | 441 } |
441 | 442 |
442 } // namespace | 443 } // namespace |
443 } // namespace test | 444 } // namespace test |
444 } // namespace crashpad | 445 } // namespace crashpad |
OLD | NEW |