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

Side by Side Diff: minidump/minidump_system_info_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_module_writer_test.cc ('k') | minidump/minidump_thread_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 12 matching lines...) Expand all
23 #include <string> 23 #include <string>
24 24
25 #include "base/compiler_specific.h" 25 #include "base/compiler_specific.h"
26 #include "gtest/gtest.h" 26 #include "gtest/gtest.h"
27 #include "minidump/minidump_file_writer.h" 27 #include "minidump/minidump_file_writer.h"
28 #include "minidump/test/minidump_file_writer_test_util.h" 28 #include "minidump/test/minidump_file_writer_test_util.h"
29 #include "minidump/test/minidump_string_writer_test_util.h" 29 #include "minidump/test/minidump_string_writer_test_util.h"
30 #include "minidump/test/minidump_writable_test_util.h" 30 #include "minidump/test/minidump_writable_test_util.h"
31 #include "snapshot/test/test_system_snapshot.h" 31 #include "snapshot/test/test_system_snapshot.h"
32 #include "util/file/string_file.h" 32 #include "util/file/string_file.h"
33 #include "util/test/gtest_death_check.h"
33 34
34 namespace crashpad { 35 namespace crashpad {
35 namespace test { 36 namespace test {
36 namespace { 37 namespace {
37 38
38 void GetSystemInfoStream(const std::string& file_contents, 39 void GetSystemInfoStream(const std::string& file_contents,
39 size_t csd_version_length, 40 size_t csd_version_length,
40 const MINIDUMP_SYSTEM_INFO** system_info, 41 const MINIDUMP_SYSTEM_INFO** system_info,
41 const MINIDUMP_STRING** csd_version) { 42 const MINIDUMP_STRING** csd_version) {
42 // The expected number of bytes for the CSD version’s MINIDUMP_STRING::Buffer. 43 // The expected number of bytes for the CSD version’s MINIDUMP_STRING::Buffer.
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 EXPECT_EQ(kOSVersionBuild[index], csd_version->Buffer[index]) << index; 465 EXPECT_EQ(kOSVersionBuild[index], csd_version->Buffer[index]) << index;
465 } 466 }
466 } 467 }
467 468
468 TEST(MinidumpSystemInfoWriterDeathTest, NoCSDVersion) { 469 TEST(MinidumpSystemInfoWriterDeathTest, NoCSDVersion) {
469 MinidumpFileWriter minidump_file_writer; 470 MinidumpFileWriter minidump_file_writer;
470 auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter()); 471 auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
471 minidump_file_writer.AddStream(system_info_writer.Pass()); 472 minidump_file_writer.AddStream(system_info_writer.Pass());
472 473
473 StringFile string_file; 474 StringFile string_file;
474 ASSERT_DEATH(minidump_file_writer.WriteEverything(&string_file), 475 ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file),
475 "csd_version_"); 476 "csd_version_");
476 } 477 }
477 478
478 } // namespace 479 } // namespace
479 } // namespace test 480 } // namespace test
480 } // namespace crashpad 481 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_module_writer_test.cc ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698