Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: minidump/minidump_file_writer_test.cc

Issue 992693003: Add ASSERT_DEATH_CHECK() to do ASSERT_DEATH() of CHECK() failures (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « minidump/minidump_exception_writer_test.cc ('k') | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « minidump/minidump_exception_writer_test.cc ('k') | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698