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

Side by Side Diff: minidump/minidump_thread_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
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 16 matching lines...) Expand all
27 #include "minidump/minidump_file_writer.h" 27 #include "minidump/minidump_file_writer.h"
28 #include "minidump/minidump_thread_id_map.h" 28 #include "minidump/minidump_thread_id_map.h"
29 #include "minidump/test/minidump_context_test_util.h" 29 #include "minidump/test/minidump_context_test_util.h"
30 #include "minidump/test/minidump_memory_writer_test_util.h" 30 #include "minidump/test/minidump_memory_writer_test_util.h"
31 #include "minidump/test/minidump_file_writer_test_util.h" 31 #include "minidump/test/minidump_file_writer_test_util.h"
32 #include "minidump/test/minidump_writable_test_util.h" 32 #include "minidump/test/minidump_writable_test_util.h"
33 #include "snapshot/test/test_cpu_context.h" 33 #include "snapshot/test/test_cpu_context.h"
34 #include "snapshot/test/test_memory_snapshot.h" 34 #include "snapshot/test/test_memory_snapshot.h"
35 #include "snapshot/test/test_thread_snapshot.h" 35 #include "snapshot/test/test_thread_snapshot.h"
36 #include "util/file/string_file.h" 36 #include "util/file/string_file.h"
37 #include "util/test/gtest_death_check.h"
37 38
38 namespace crashpad { 39 namespace crashpad {
39 namespace test { 40 namespace test {
40 namespace { 41 namespace {
41 42
42 // This returns the MINIDUMP_THREAD_LIST stream in |thread_list|. If 43 // This returns the MINIDUMP_THREAD_LIST stream in |thread_list|. If
43 // |memory_list| is not nullptr, a MINIDUMP_MEMORY_LIST stream is also expected 44 // |memory_list| is not nullptr, a MINIDUMP_MEMORY_LIST stream is also expected
44 // in |file_contents|, and that stream will be returned in |memory_list|. 45 // in |file_contents|, and that stream will be returned in |memory_list|.
45 void GetThreadListStream(const std::string& file_contents, 46 void GetThreadListStream(const std::string& file_contents,
46 const MINIDUMP_THREAD_LIST** thread_list, 47 const MINIDUMP_THREAD_LIST** thread_list,
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 TEST(MinidumpThreadWriterDeathTest, NoContext) { 668 TEST(MinidumpThreadWriterDeathTest, NoContext) {
668 MinidumpFileWriter minidump_file_writer; 669 MinidumpFileWriter minidump_file_writer;
669 auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter()); 670 auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
670 671
671 auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter()); 672 auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter());
672 673
673 thread_list_writer->AddThread(thread_writer.Pass()); 674 thread_list_writer->AddThread(thread_writer.Pass());
674 minidump_file_writer.AddStream(thread_list_writer.Pass()); 675 minidump_file_writer.AddStream(thread_list_writer.Pass());
675 676
676 StringFile string_file; 677 StringFile string_file;
677 ASSERT_DEATH(minidump_file_writer.WriteEverything(&string_file), "context_"); 678 ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file),
679 "context_");
678 } 680 }
679 681
680 TEST(MinidumpThreadWriterDeathTest, InitializeFromSnapshot_NoContext) { 682 TEST(MinidumpThreadWriterDeathTest, InitializeFromSnapshot_NoContext) {
681 ASSERT_DEATH( 683 ASSERT_DEATH_CHECK(
682 RunInitializeFromSnapshotTest<InitializeFromSnapshotNoContextTraits>( 684 RunInitializeFromSnapshotTest<InitializeFromSnapshotNoContextTraits>(
683 false), "context_"); 685 false), "context_");
684 } 686 }
685 687
686 } // namespace 688 } // namespace
687 } // namespace test 689 } // namespace test
688 } // namespace crashpad 690 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_system_info_writer_test.cc ('k') | util/mach/composite_mach_message_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698