mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Don’t use using directives (“using namespace”) in tests.
The contents of tests are moved into the namespace crashpad::test::(anonymous namespace). https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Namespaces R=rsesek@chromium.org Review URL: https://codereview.chromium.org/635883002
This commit is contained in:
parent
e74a272ab5
commit
6d1af6922f
@ -22,10 +22,10 @@
|
|||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// If the context structure has fields that tell whether it’s valid, such as
|
// If the context structure has fields that tell whether it’s valid, such as
|
||||||
// magic numbers or size fields, sanity-checks those fields for validity with
|
// magic numbers or size fields, sanity-checks those fields for validity with
|
||||||
// fatal gtest assertions. For other fields, where it’s possible to reason about
|
// fatal gtest assertions. For other fields, where it’s possible to reason about
|
||||||
@ -152,3 +152,5 @@ TEST(CaptureContextMac, CaptureContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(SimpleStringDictionary, Entry) {
|
TEST(SimpleStringDictionary, Entry) {
|
||||||
typedef TSimpleStringDictionary<5, 9, 15> TestMap;
|
typedef TSimpleStringDictionary<5, 9, 15> TestMap;
|
||||||
TestMap map;
|
TestMap map;
|
||||||
@ -293,3 +293,5 @@ TEST(SimpleStringDictionaryDeathTest, NullKey) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -26,11 +26,10 @@
|
|||||||
#include "util/file/file_writer.h"
|
#include "util/file/file_writer.h"
|
||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
TEST(MinidumpFileWriter, Empty) {
|
TEST(MinidumpFileWriter, Empty) {
|
||||||
MinidumpFileWriter minidump_file;
|
MinidumpFileWriter minidump_file;
|
||||||
StringFileWriter file_writer;
|
StringFileWriter file_writer;
|
||||||
@ -262,3 +261,5 @@ TEST(MinidumpFileWriterDeathTest, SameStreamType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -25,11 +25,10 @@
|
|||||||
#include "minidump/minidump_test_util.h"
|
#include "minidump/minidump_test_util.h"
|
||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
const MinidumpStreamType kBogusStreamType =
|
const MinidumpStreamType kBogusStreamType =
|
||||||
static_cast<MinidumpStreamType>(1234);
|
static_cast<MinidumpStreamType>(1234);
|
||||||
|
|
||||||
@ -389,3 +388,5 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -28,11 +28,10 @@
|
|||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
#include "util/stdlib/strlcpy.h"
|
#include "util/stdlib/strlcpy.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void GetMiscInfoStream(const std::string& file_contents, const T** misc_info) {
|
void GetMiscInfoStream(const std::string& file_contents, const T** misc_info) {
|
||||||
const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER);
|
const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER);
|
||||||
@ -656,3 +655,5 @@ TEST(MinidumpMiscInfoWriter, Everything) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -26,11 +26,10 @@
|
|||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
#include "util/misc/uuid.h"
|
#include "util/misc/uuid.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
void GetModuleListStream(const std::string& file_contents,
|
void GetModuleListStream(const std::string& file_contents,
|
||||||
const MINIDUMP_MODULE_LIST** module_list) {
|
const MINIDUMP_MODULE_LIST** module_list) {
|
||||||
const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER);
|
const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER);
|
||||||
@ -672,3 +671,5 @@ TEST(MinidumpSystemInfoWriterDeathTest, NoModuleName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
const MINIDUMP_STRING* MinidumpStringCast(const StringFileWriter& file_writer) {
|
const MINIDUMP_STRING* MinidumpStringCast(const StringFileWriter& file_writer) {
|
||||||
return reinterpret_cast<const MINIDUMP_STRING*>(&file_writer.string()[0]);
|
return reinterpret_cast<const MINIDUMP_STRING*>(&file_writer.string()[0]);
|
||||||
}
|
}
|
||||||
@ -199,3 +199,5 @@ TEST(MinidumpStringWriter, MinidumpUTF8StringWriter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -24,11 +24,10 @@
|
|||||||
#include "minidump/minidump_test_util.h"
|
#include "minidump/minidump_test_util.h"
|
||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
void GetSystemInfoStream(const std::string& file_contents,
|
void GetSystemInfoStream(const std::string& file_contents,
|
||||||
size_t csd_version_length,
|
size_t csd_version_length,
|
||||||
const MINIDUMP_SYSTEM_INFO** system_info,
|
const MINIDUMP_SYSTEM_INFO** system_info,
|
||||||
@ -295,3 +294,5 @@ TEST(MinidumpSystemInfoWriterDeathTest, NoCSDVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/file/string_file_writer.h"
|
#include "util/file/string_file_writer.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable {
|
class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
BaseTestMinidumpWritable()
|
BaseTestMinidumpWritable()
|
||||||
@ -833,3 +833,5 @@ TEST(MinidumpWritable, LocationDescriptor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
|
|
||||||
TEST(CPUContextMac, InitializeContextX86) {
|
TEST(CPUContextMac, InitializeContextX86) {
|
||||||
@ -417,3 +417,5 @@ TEST(CPUContextMac, InitializeContextX86_64) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -25,11 +25,10 @@
|
|||||||
#include "util/mac/process_reader.h"
|
#include "util/mac/process_reader.h"
|
||||||
#include "util/test/errors.h"
|
#include "util/test/errors.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
// SystemSnapshotMac objects would be cumbersome to construct in each test that
|
// SystemSnapshotMac objects would be cumbersome to construct in each test that
|
||||||
// requires one, because of the repetitive and mechanical work necessary to set
|
// requires one, because of the repetitive and mechanical work necessary to set
|
||||||
// up a ProcessReader and timeval, along with the checks to verify that these
|
// up a ProcessReader and timeval, along with the checks to verify that these
|
||||||
@ -173,3 +172,5 @@ TEST_F(SystemSnapshotMacTest, TimeZone) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(StringFileWriter, EmptyFile) {
|
TEST(StringFileWriter, EmptyFile) {
|
||||||
StringFileWriter writer;
|
StringFileWriter writer;
|
||||||
EXPECT_TRUE(writer.string().empty());
|
EXPECT_TRUE(writer.string().empty());
|
||||||
@ -376,3 +376,5 @@ TEST(StringFileWriter, SeekInvalid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/mac/process_reader.h"
|
#include "util/mac/process_reader.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
#if defined(ARCH_CPU_64_BITS)
|
#if defined(ARCH_CPU_64_BITS)
|
||||||
const bool kValid64Invalid32 = true;
|
const bool kValid64Invalid32 = true;
|
||||||
#else
|
#else
|
||||||
@ -254,3 +254,5 @@ TEST(CheckedMachAddressRange, ContainsRange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/stdlib/objc.h"
|
#include "util/stdlib/objc.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(Launchd, CFPropertyToLaunchData_Integer) {
|
TEST(Launchd, CFPropertyToLaunchData_Integer) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
base::mac::ScopedLaunchData launch_data;
|
base::mac::ScopedLaunchData launch_data;
|
||||||
@ -301,3 +301,5 @@ TEST(Launchd, CFPropertyToLaunchData_RealWorldJobDictionary) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -34,10 +34,10 @@
|
|||||||
#undef catch
|
#undef catch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// Runs /usr/bin/sw_vers with a single argument, |argument|, and places the
|
// Runs /usr/bin/sw_vers with a single argument, |argument|, and places the
|
||||||
// command’s standard output into |output| after stripping the trailing newline.
|
// command’s standard output into |output| after stripping the trailing newline.
|
||||||
// Fatal gtest assertions report tool failures, which the caller should check
|
// Fatal gtest assertions report tool failures, which the caller should check
|
||||||
@ -147,3 +147,5 @@ TEST(MacUtil, MacModelAndBoard) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -36,10 +36,10 @@
|
|||||||
// This file is responsible for testing MachOImageReader,
|
// This file is responsible for testing MachOImageReader,
|
||||||
// MachOImageSegmentReader, and MachOImageSymbolTableReader.
|
// MachOImageSegmentReader, and MachOImageSymbolTableReader.
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// Native types and constants, in cases where the 32-bit and 64-bit versions
|
// Native types and constants, in cases where the 32-bit and 64-bit versions
|
||||||
// are different.
|
// are different.
|
||||||
#if defined(ARCH_CPU_64_BITS)
|
#if defined(ARCH_CPU_64_BITS)
|
||||||
@ -659,3 +659,5 @@ TEST(MachOImageReader, Self_DyldImages) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// Most of MachOImageSegmentReader is tested as part of MachOImageReader, which
|
// Most of MachOImageSegmentReader is tested as part of MachOImageReader, which
|
||||||
// depends on MachOImageSegmentReader to provide major portions of its
|
// depends on MachOImageSegmentReader to provide major portions of its
|
||||||
// functionality. Because MachOImageSegmentReader is difficult to use except by
|
// functionality. Because MachOImageSegmentReader is difficult to use except by
|
||||||
@ -184,3 +184,5 @@ TEST(MachOImageSegmentReader, SegmentAndSectionNameString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -40,11 +40,10 @@
|
|||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
#include "util/test/mac/mach_multiprocess.h"
|
#include "util/test/mac/mach_multiprocess.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
TEST(ProcessReader, SelfBasic) {
|
TEST(ProcessReader, SelfBasic) {
|
||||||
ProcessReader process_reader;
|
ProcessReader process_reader;
|
||||||
ASSERT_TRUE(process_reader.Initialize(mach_task_self()));
|
ASSERT_TRUE(process_reader.Initialize(mach_task_self()));
|
||||||
@ -695,3 +694,5 @@ TEST(ProcessReader, ChildModules) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
#include "util/mac/mac_util.h"
|
#include "util/mac/mac_util.h"
|
||||||
#include "util/test/mac/dyld.h"
|
#include "util/test/mac/dyld.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
#define TEST_STRING(process_reader, self_view, proctype_view, field) \
|
#define TEST_STRING(process_reader, self_view, proctype_view, field) \
|
||||||
do { \
|
do { \
|
||||||
if (self_view->field) { \
|
if (self_view->field) { \
|
||||||
@ -259,3 +259,5 @@ TEST(ProcessTypes, DyldImagesSelf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -30,10 +30,10 @@
|
|||||||
#include "util/posix/process_util.h"
|
#include "util/posix/process_util.h"
|
||||||
#include "util/stdlib/objc.h"
|
#include "util/stdlib/objc.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// Ensures that the process with the specified PID is running, identifying it by
|
// Ensures that the process with the specified PID is running, identifying it by
|
||||||
// requiring that its argv[argc - 1] compare equal to last_arg.
|
// requiring that its argv[argc - 1] compare equal to last_arg.
|
||||||
void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
|
void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
|
||||||
@ -156,3 +156,5 @@ TEST(ServiceManagement, SubmitRemoveJob) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -27,11 +27,10 @@
|
|||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
#include "util/test/mac/mach_multiprocess.h"
|
#include "util/test/mac/mach_multiprocess.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
class TestExcClientVariants : public UniversalMachExcServer,
|
class TestExcClientVariants : public UniversalMachExcServer,
|
||||||
public MachMultiprocess {
|
public MachMultiprocess {
|
||||||
public:
|
public:
|
||||||
@ -287,3 +286,5 @@ TEST(ExcClientVariants, UniversalExceptionRaise) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -27,11 +27,14 @@
|
|||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
#include "util/test/mac/mach_multiprocess.h"
|
#include "util/test/mac/mach_multiprocess.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
using testing::DefaultValue;
|
||||||
using namespace crashpad::test;
|
using testing::Eq;
|
||||||
using namespace testing;
|
using testing::Pointee;
|
||||||
|
using testing::Return;
|
||||||
|
|
||||||
// Fake Mach ports. These aren’t used as ports in these tests, they’re just used
|
// Fake Mach ports. These aren’t used as ports in these tests, they’re just used
|
||||||
// as cookies to make sure that the correct values get passed to the correct
|
// as cookies to make sure that the correct values get passed to the correct
|
||||||
@ -1169,3 +1172,5 @@ TEST(ExcServerVariants, ExcServerSuccessfulReturnValue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/mach/mach_extensions.h"
|
#include "util/mach/mach_extensions.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(ExceptionBehaviors, ExceptionBehaviors) {
|
TEST(ExceptionBehaviors, ExceptionBehaviors) {
|
||||||
struct TestData {
|
struct TestData {
|
||||||
exception_behavior_t behavior;
|
exception_behavior_t behavior;
|
||||||
@ -68,3 +68,5 @@ TEST(ExceptionBehaviors, ExceptionBehaviors) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -33,11 +33,10 @@
|
|||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
#include "util/test/mac/mach_multiprocess.h"
|
#include "util/test/mac/mach_multiprocess.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
// Calls GetExceptionPorts() on its |exception_ports| argument to look up the
|
// Calls GetExceptionPorts() on its |exception_ports| argument to look up the
|
||||||
// EXC_MASK_CRASH handler. If |expect_port| is not MACH_PORT_NULL, it expects to
|
// EXC_MASK_CRASH handler. If |expect_port| is not MACH_PORT_NULL, it expects to
|
||||||
// find a handler for this mask whose port matches |expect_port| and whose
|
// find a handler for this mask whose port matches |expect_port| and whose
|
||||||
@ -574,3 +573,5 @@ TEST(ExceptionPorts, HostExceptionPorts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -17,13 +17,15 @@
|
|||||||
#include "base/mac/scoped_mach_port.h"
|
#include "base/mac/scoped_mach_port.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(MachExtensions, MachThreadSelf) {
|
TEST(MachExtensions, MachThreadSelf) {
|
||||||
base::mac::ScopedMachSendRight thread_self(mach_thread_self());
|
base::mac::ScopedMachSendRight thread_self(mach_thread_self());
|
||||||
EXPECT_EQ(thread_self, MachThreadSelf());
|
EXPECT_EQ(thread_self, MachThreadSelf());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -25,11 +25,10 @@
|
|||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
#include "util/test/mac/mach_multiprocess.h"
|
#include "util/test/mac/mach_multiprocess.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
class TestMachMessageServer : public MachMessageServer::Interface,
|
class TestMachMessageServer : public MachMessageServer::Interface,
|
||||||
public MachMultiprocess {
|
public MachMultiprocess {
|
||||||
public:
|
public:
|
||||||
@ -845,3 +844,5 @@ TEST(MachMessageServer, LargeExpected) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
#define NUL_TEST_DATA(string) { string, arraysize(string) - 1 }
|
#define NUL_TEST_DATA(string) { string, arraysize(string) - 1 }
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
// Options to use for normal tests, those that don’t require kAllowOr.
|
// Options to use for normal tests, those that don’t require kAllowOr.
|
||||||
const StringToSymbolicConstantOptions kNormalOptions[] = {
|
const StringToSymbolicConstantOptions kNormalOptions[] = {
|
||||||
0,
|
0,
|
||||||
@ -1062,3 +1062,5 @@ TEST(SymbolicConstantsMach, StringToThreadStateFlavor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -26,11 +26,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/test/mac/mach_errors.h"
|
#include "util/test/mac/mach_errors.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
TEST(TaskMemory, ReadSelf) {
|
TEST(TaskMemory, ReadSelf) {
|
||||||
vm_address_t address = 0;
|
vm_address_t address = 0;
|
||||||
const vm_size_t kSize = 4 * PAGE_SIZE;
|
const vm_size_t kSize = 4 * PAGE_SIZE;
|
||||||
@ -552,3 +551,5 @@ TEST(TaskMemory, MappedMemoryReadCString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(Clock, ClockMonotonicNanoseconds) {
|
TEST(Clock, ClockMonotonicNanoseconds) {
|
||||||
uint64_t start = ClockMonotonicNanoseconds();
|
uint64_t start = ClockMonotonicNanoseconds();
|
||||||
EXPECT_GT(start, 0u);
|
EXPECT_GT(start, 0u);
|
||||||
@ -92,3 +92,5 @@ TEST(Clock, SleepNanoseconds) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(InitializationStateDcheck, InitializationStateDcheck) {
|
TEST(InitializationStateDcheck, InitializationStateDcheck) {
|
||||||
InitializationStateDcheck initialization_state_dcheck;
|
InitializationStateDcheck initialization_state_dcheck;
|
||||||
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
|
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
|
||||||
@ -126,3 +126,5 @@ TEST(InitializationStateDcheckDeathTest, Destroyed_NotValid) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(InitializationState, InitializationState) {
|
TEST(InitializationState, InitializationState) {
|
||||||
InitializationState* initialization_state_pointer;
|
InitializationState* initialization_state_pointer;
|
||||||
{
|
{
|
||||||
@ -54,3 +54,5 @@ TEST(InitializationState, InitializationState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
enum ForbidReturnType {
|
enum ForbidReturnType {
|
||||||
kForbidReturnDefault = 0,
|
kForbidReturnDefault = 0,
|
||||||
kForbidReturnArmed,
|
kForbidReturnArmed,
|
||||||
@ -57,3 +57,5 @@ TEST(ScopedForbidReturn, Disarmed) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(UUID, UUID) {
|
TEST(UUID, UUID) {
|
||||||
UUID uuid_zero;
|
UUID uuid_zero;
|
||||||
EXPECT_EQ(0u, uuid_zero.data_1);
|
EXPECT_EQ(0u, uuid_zero.data_1);
|
||||||
@ -153,3 +153,5 @@ TEST(UUID, UUID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(CheckedRange, IsValid) {
|
TEST(CheckedRange, IsValid) {
|
||||||
const struct UnsignedTestData {
|
const struct UnsignedTestData {
|
||||||
uint32_t base;
|
uint32_t base;
|
||||||
@ -244,3 +244,5 @@ TEST(CheckedRange, ContainsRange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
const int32_t kInt32Min = std::numeric_limits<int32_t>::min();
|
const int32_t kInt32Min = std::numeric_limits<int32_t>::min();
|
||||||
const int64_t kInt64Min = std::numeric_limits<int64_t>::min();
|
const int64_t kInt64Min = std::numeric_limits<int64_t>::min();
|
||||||
|
|
||||||
@ -115,3 +115,5 @@ TEST(InRangeCast, Int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(Int128, UInt128) {
|
TEST(Int128, UInt128) {
|
||||||
#if defined(ARCH_CPU_LITTLE_ENDIAN)
|
#if defined(ARCH_CPU_LITTLE_ENDIAN)
|
||||||
const uint8_t kBytes[] =
|
const uint8_t kBytes[] =
|
||||||
@ -40,3 +40,5 @@ TEST(Int128, UInt128) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(ProcessUtil, ProcessArgumentsForPID) {
|
TEST(ProcessUtil, ProcessArgumentsForPID) {
|
||||||
std::vector<std::string> argv;
|
std::vector<std::string> argv;
|
||||||
ASSERT_TRUE(ProcessArgumentsForPID(getpid(), &argv));
|
ASSERT_TRUE(ProcessArgumentsForPID(getpid(), &argv));
|
||||||
@ -45,3 +45,5 @@ TEST(ProcessUtil, ProcessArgumentsForPID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
#define NUL_TEST_DATA(string) { string, arraysize(string) - 1 }
|
#define NUL_TEST_DATA(string) { string, arraysize(string) - 1 }
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
const struct {
|
const struct {
|
||||||
int signal;
|
int signal;
|
||||||
const char* full_name;
|
const char* full_name;
|
||||||
@ -252,3 +252,5 @@ TEST(SymbolicConstantsPOSIX, StringToSignal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(StringNumberConversion, StringToInt) {
|
TEST(StringNumberConversion, StringToInt) {
|
||||||
const struct {
|
const struct {
|
||||||
const char* string;
|
const char* string;
|
||||||
@ -216,3 +216,5 @@ TEST(StringNumberConversion, StringToUnsignedInt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(strlcpy, c16lcpy) {
|
TEST(strlcpy, c16lcpy) {
|
||||||
// Use a destination buffer that’s larger than the length passed to c16lcpy.
|
// Use a destination buffer that’s larger than the length passed to c16lcpy.
|
||||||
// The unused portion is a guard area that must not be written to.
|
// The unused portion is a guard area that must not be written to.
|
||||||
@ -89,3 +89,5 @@ TEST(strlcpy, c16lcpy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
TEST(strnlen, strnlen) {
|
TEST(strnlen, strnlen) {
|
||||||
@ -39,3 +41,5 @@ TEST(strnlen, strnlen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
|
|
||||||
TEST(Semaphore, Simple) {
|
TEST(Semaphore, Simple) {
|
||||||
Semaphore semaphore(1);
|
Semaphore semaphore(1);
|
||||||
semaphore.Wait();
|
semaphore.Wait();
|
||||||
@ -86,3 +86,5 @@ TEST(Semaphore, TenThreaded) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
TEST(ExecutablePath, ExecutablePath) {
|
TEST(ExecutablePath, ExecutablePath) {
|
||||||
base::FilePath executable_path = ExecutablePath();
|
base::FilePath executable_path = ExecutablePath();
|
||||||
base::FilePath executable_name = executable_path.BaseName();
|
base::FilePath executable_name = executable_path.BaseName();
|
||||||
@ -28,3 +28,5 @@ TEST(ExecutablePath, ExecutablePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -48,8 +48,6 @@ struct ReceiveHelloMessage : public SendHelloMessage {
|
|||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
using namespace testing;
|
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
struct MachMultiprocessInfo {
|
struct MachMultiprocessInfo {
|
||||||
@ -271,7 +269,7 @@ void MachMultiprocess::MultiprocessChild() {
|
|||||||
// verify it using the task port it has access to via ChildTask().
|
// verify it using the task port it has access to via ChildTask().
|
||||||
CheckedReadFDAtEOF(ReadPipeFD());
|
CheckedReadFDAtEOF(ReadPipeFD());
|
||||||
|
|
||||||
if (Test::HasFailure()) {
|
if (testing::Test::HasFailure()) {
|
||||||
// Trigger the ScopedForbidReturn destructor.
|
// Trigger the ScopedForbidReturn destructor.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
class TestMachMultiprocess final : public MachMultiprocess {
|
class TestMachMultiprocess final : public MachMultiprocess {
|
||||||
public:
|
public:
|
||||||
TestMachMultiprocess() : MachMultiprocess() {}
|
TestMachMultiprocess() : MachMultiprocess() {}
|
||||||
@ -46,3 +45,5 @@ TEST(MachMultiprocess, MachMultiprocess) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
using namespace testing;
|
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
struct MultiprocessInfo {
|
struct MultiprocessInfo {
|
||||||
@ -211,7 +209,7 @@ void Multiprocess::RunChild() {
|
|||||||
info_->pipe_c2p_write.reset();
|
info_->pipe_c2p_write.reset();
|
||||||
info_->pipe_p2c_read.reset();
|
info_->pipe_p2c_read.reset();
|
||||||
|
|
||||||
if (Test::HasFailure()) {
|
if (testing::Test::HasFailure()) {
|
||||||
// Trigger the ScopedForbidReturn destructor.
|
// Trigger the ScopedForbidReturn destructor.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
using namespace testing;
|
|
||||||
|
|
||||||
MultiprocessExec::MultiprocessExec()
|
MultiprocessExec::MultiprocessExec()
|
||||||
: Multiprocess(),
|
: Multiprocess(),
|
||||||
command_(),
|
command_(),
|
||||||
|
@ -21,11 +21,10 @@
|
|||||||
#include "util/file/fd_io.h"
|
#include "util/file/fd_io.h"
|
||||||
#include "util/test/executable_path.h"
|
#include "util/test/executable_path.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
class TestMultiprocessExec final : public MultiprocessExec {
|
class TestMultiprocessExec final : public MultiprocessExec {
|
||||||
public:
|
public:
|
||||||
TestMultiprocessExec() : MultiprocessExec() {}
|
TestMultiprocessExec() : MultiprocessExec() {}
|
||||||
@ -54,3 +53,5 @@ TEST(MultiprocessExec, MultiprocessExec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
@ -22,11 +22,10 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/file/fd_io.h"
|
#include "util/file/fd_io.h"
|
||||||
|
|
||||||
|
namespace crashpad {
|
||||||
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace crashpad;
|
|
||||||
using namespace crashpad::test;
|
|
||||||
|
|
||||||
class TestMultiprocess final : public Multiprocess {
|
class TestMultiprocess final : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
TestMultiprocess() : Multiprocess() {}
|
TestMultiprocess() : Multiprocess() {}
|
||||||
@ -292,3 +291,5 @@ TEST(MultiprocessDeathTest, ChildClosesReadAndWritePipe) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
} // namespace test
|
||||||
|
} // namespace crashpad
|
||||||
|
Loading…
x
Reference in New Issue
Block a user