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