diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc index 53d08e26..3dc0ba8d 100644 --- a/client/capture_context_mac_test.cc +++ b/client/capture_context_mac_test.cc @@ -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 diff --git a/client/simple_string_dictionary_test.cc b/client/simple_string_dictionary_test.cc index df963ca5..a55b5a31 100644 --- a/client/simple_string_dictionary_test.cc +++ b/client/simple_string_dictionary_test.cc @@ -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 diff --git a/minidump/minidump_file_writer_test.cc b/minidump/minidump_file_writer_test.cc index 0ccc0f8e..611dce82 100644 --- a/minidump/minidump_file_writer_test.cc +++ b/minidump/minidump_file_writer_test.cc @@ -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 diff --git a/minidump/minidump_memory_writer_test.cc b/minidump/minidump_memory_writer_test.cc index 3e469874..d81107db 100644 --- a/minidump/minidump_memory_writer_test.cc +++ b/minidump/minidump_memory_writer_test.cc @@ -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(1234); @@ -389,3 +388,5 @@ TEST(MinidumpMemoryWriter, ExtraMemory) { } } // namespace +} // namespace test +} // namespace crashpad diff --git a/minidump/minidump_misc_info_writer_test.cc b/minidump/minidump_misc_info_writer_test.cc index ca22b592..ea22b59e 100644 --- a/minidump/minidump_misc_info_writer_test.cc +++ b/minidump/minidump_misc_info_writer_test.cc @@ -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 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 diff --git a/minidump/minidump_module_writer_test.cc b/minidump/minidump_module_writer_test.cc index 296de793..53bf9d78 100644 --- a/minidump/minidump_module_writer_test.cc +++ b/minidump/minidump_module_writer_test.cc @@ -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 diff --git a/minidump/minidump_string_writer_test.cc b/minidump/minidump_string_writer_test.cc index 682da831..9e684cef 100644 --- a/minidump/minidump_string_writer_test.cc +++ b/minidump/minidump_string_writer_test.cc @@ -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(&file_writer.string()[0]); } @@ -199,3 +199,5 @@ TEST(MinidumpStringWriter, MinidumpUTF8StringWriter) { } } // namespace +} // namespace test +} // namespace crashpad diff --git a/minidump/minidump_system_info_writer_test.cc b/minidump/minidump_system_info_writer_test.cc index 98b95d68..48fd9d26 100644 --- a/minidump/minidump_system_info_writer_test.cc +++ b/minidump/minidump_system_info_writer_test.cc @@ -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 diff --git a/minidump/minidump_writable_test.cc b/minidump/minidump_writable_test.cc index fb52334d..6e345afe 100644 --- a/minidump/minidump_writable_test.cc +++ b/minidump/minidump_writable_test.cc @@ -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 diff --git a/snapshot/cpu_context_mac_test.cc b/snapshot/cpu_context_mac_test.cc index 16aab4a6..a214a31e 100644 --- a/snapshot/cpu_context_mac_test.cc +++ b/snapshot/cpu_context_mac_test.cc @@ -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 diff --git a/snapshot/system_snapshot_mac_test.cc b/snapshot/system_snapshot_mac_test.cc index 1f9d1017..bce1137d 100644 --- a/snapshot/system_snapshot_mac_test.cc +++ b/snapshot/system_snapshot_mac_test.cc @@ -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 diff --git a/util/file/string_file_writer_test.cc b/util/file/string_file_writer_test.cc index b55c778e..d6ea2e49 100644 --- a/util/file/string_file_writer_test.cc +++ b/util/file/string_file_writer_test.cc @@ -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 diff --git a/util/mac/checked_mach_address_range_test.cc b/util/mac/checked_mach_address_range_test.cc index 392121dc..b0f36c3d 100644 --- a/util/mac/checked_mach_address_range_test.cc +++ b/util/mac/checked_mach_address_range_test.cc @@ -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 diff --git a/util/mac/launchd_test.mm b/util/mac/launchd_test.mm index b4c8f34a..03953cdf 100644 --- a/util/mac/launchd_test.mm +++ b/util/mac/launchd_test.mm @@ -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 diff --git a/util/mac/mac_util_test.mm b/util/mac/mac_util_test.mm index 5c1366fb..7bbba484 100644 --- a/util/mac/mac_util_test.mm +++ b/util/mac/mac_util_test.mm @@ -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 diff --git a/util/mac/mach_o_image_reader_test.cc b/util/mac/mach_o_image_reader_test.cc index 2991cc5f..f174a4ea 100644 --- a/util/mac/mach_o_image_reader_test.cc +++ b/util/mac/mach_o_image_reader_test.cc @@ -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 diff --git a/util/mac/mach_o_image_segment_reader_test.cc b/util/mac/mach_o_image_segment_reader_test.cc index 226eaa07..d0e706f8 100644 --- a/util/mac/mach_o_image_segment_reader_test.cc +++ b/util/mac/mach_o_image_segment_reader_test.cc @@ -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 diff --git a/util/mac/process_reader_test.cc b/util/mac/process_reader_test.cc index 795468f5..e67c98e8 100644 --- a/util/mac/process_reader_test.cc +++ b/util/mac/process_reader_test.cc @@ -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 diff --git a/util/mac/process_types_test.cc b/util/mac/process_types_test.cc index 80abe751..93ecc2aa 100644 --- a/util/mac/process_types_test.cc +++ b/util/mac/process_types_test.cc @@ -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 diff --git a/util/mac/service_management_test.mm b/util/mac/service_management_test.mm index 9ca2e15a..27827216 100644 --- a/util/mac/service_management_test.mm +++ b/util/mac/service_management_test.mm @@ -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 diff --git a/util/mach/exc_client_variants_test.cc b/util/mach/exc_client_variants_test.cc index 3f292690..0070880a 100644 --- a/util/mach/exc_client_variants_test.cc +++ b/util/mach/exc_client_variants_test.cc @@ -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 diff --git a/util/mach/exc_server_variants_test.cc b/util/mach/exc_server_variants_test.cc index 5daa81ba..eea6dce6 100644 --- a/util/mach/exc_server_variants_test.cc +++ b/util/mach/exc_server_variants_test.cc @@ -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 diff --git a/util/mach/exception_behaviors_test.cc b/util/mach/exception_behaviors_test.cc index c4497d61..cbde600a 100644 --- a/util/mach/exception_behaviors_test.cc +++ b/util/mach/exception_behaviors_test.cc @@ -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 diff --git a/util/mach/exception_ports_test.cc b/util/mach/exception_ports_test.cc index a5424a58..56cda3c2 100644 --- a/util/mach/exception_ports_test.cc +++ b/util/mach/exception_ports_test.cc @@ -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 diff --git a/util/mach/mach_extensions_test.cc b/util/mach/mach_extensions_test.cc index 511c8900..9334d30a 100644 --- a/util/mach/mach_extensions_test.cc +++ b/util/mach/mach_extensions_test.cc @@ -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 diff --git a/util/mach/mach_message_server_test.cc b/util/mach/mach_message_server_test.cc index 3d0d8bd7..f732bbc2 100644 --- a/util/mach/mach_message_server_test.cc +++ b/util/mach/mach_message_server_test.cc @@ -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 diff --git a/util/mach/symbolic_constants_mach_test.cc b/util/mach/symbolic_constants_mach_test.cc index 4bc17c81..0410f2e3 100644 --- a/util/mach/symbolic_constants_mach_test.cc +++ b/util/mach/symbolic_constants_mach_test.cc @@ -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 diff --git a/util/mach/task_memory_test.cc b/util/mach/task_memory_test.cc index 3ee813ab..523e95a5 100644 --- a/util/mach/task_memory_test.cc +++ b/util/mach/task_memory_test.cc @@ -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 diff --git a/util/misc/clock_test.cc b/util/misc/clock_test.cc index 35ec1ac1..8082e951 100644 --- a/util/misc/clock_test.cc +++ b/util/misc/clock_test.cc @@ -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 diff --git a/util/misc/initialization_state_dcheck_test.cc b/util/misc/initialization_state_dcheck_test.cc index 57a4e54a..c9b595ac 100644 --- a/util/misc/initialization_state_dcheck_test.cc +++ b/util/misc/initialization_state_dcheck_test.cc @@ -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 diff --git a/util/misc/initialization_state_test.cc b/util/misc/initialization_state_test.cc index 8330f301..d427a140 100644 --- a/util/misc/initialization_state_test.cc +++ b/util/misc/initialization_state_test.cc @@ -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 diff --git a/util/misc/scoped_forbid_return_test.cc b/util/misc/scoped_forbid_return_test.cc index 0349fc15..9a1b6d90 100644 --- a/util/misc/scoped_forbid_return_test.cc +++ b/util/misc/scoped_forbid_return_test.cc @@ -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 diff --git a/util/misc/uuid_test.cc b/util/misc/uuid_test.cc index 5d515cc6..2bd4ceb0 100644 --- a/util/misc/uuid_test.cc +++ b/util/misc/uuid_test.cc @@ -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 diff --git a/util/numeric/checked_range_test.cc b/util/numeric/checked_range_test.cc index baa843a5..37d482c7 100644 --- a/util/numeric/checked_range_test.cc +++ b/util/numeric/checked_range_test.cc @@ -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 diff --git a/util/numeric/in_range_cast_test.cc b/util/numeric/in_range_cast_test.cc index 340c862c..52eeedf5 100644 --- a/util/numeric/in_range_cast_test.cc +++ b/util/numeric/in_range_cast_test.cc @@ -20,10 +20,10 @@ #include "gtest/gtest.h" +namespace crashpad { +namespace test { namespace { -using namespace crashpad; - const int32_t kInt32Min = std::numeric_limits::min(); const int64_t kInt64Min = std::numeric_limits::min(); @@ -115,3 +115,5 @@ TEST(InRangeCast, Int64) { } } // namespace +} // namespace test +} // namespace crashpad diff --git a/util/numeric/int128_test.cc b/util/numeric/int128_test.cc index 0fbf2c22..e2f02a43 100644 --- a/util/numeric/int128_test.cc +++ b/util/numeric/int128_test.cc @@ -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 diff --git a/util/posix/process_util_test.cc b/util/posix/process_util_test.cc index 2fb6841e..47b0dd5f 100644 --- a/util/posix/process_util_test.cc +++ b/util/posix/process_util_test.cc @@ -22,10 +22,10 @@ #include "gtest/gtest.h" +namespace crashpad { +namespace test { namespace { -using namespace crashpad; - TEST(ProcessUtil, ProcessArgumentsForPID) { std::vector argv; ASSERT_TRUE(ProcessArgumentsForPID(getpid(), &argv)); @@ -45,3 +45,5 @@ TEST(ProcessUtil, ProcessArgumentsForPID) { } } // namespace +} // namespace test +} // namespace crashpad diff --git a/util/posix/symbolic_constants_posix_test.cc b/util/posix/symbolic_constants_posix_test.cc index a03e8beb..c80d00d9 100644 --- a/util/posix/symbolic_constants_posix_test.cc +++ b/util/posix/symbolic_constants_posix_test.cc @@ -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 diff --git a/util/stdlib/string_number_conversion_test.cc b/util/stdlib/string_number_conversion_test.cc index ef1376c7..ec0d44ae 100644 --- a/util/stdlib/string_number_conversion_test.cc +++ b/util/stdlib/string_number_conversion_test.cc @@ -19,10 +19,10 @@ #include +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 diff --git a/util/stdlib/strlcpy_test.cc b/util/stdlib/strlcpy_test.cc index 1cf187c2..8eb656da 100644 --- a/util/stdlib/strlcpy_test.cc +++ b/util/stdlib/strlcpy_test.cc @@ -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 diff --git a/util/stdlib/strnlen_test.cc b/util/stdlib/strnlen_test.cc index f5b6845b..35ca7f1a 100644 --- a/util/stdlib/strnlen_test.cc +++ b/util/stdlib/strnlen_test.cc @@ -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 diff --git a/util/synchronization/semaphore_test.cc b/util/synchronization/semaphore_test.cc index 3eb53da7..07cc45b7 100644 --- a/util/synchronization/semaphore_test.cc +++ b/util/synchronization/semaphore_test.cc @@ -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 diff --git a/util/test/executable_path_test.cc b/util/test/executable_path_test.cc index b99d3d91..3682a4b3 100644 --- a/util/test/executable_path_test.cc +++ b/util/test/executable_path_test.cc @@ -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 diff --git a/util/test/mac/mach_multiprocess.cc b/util/test/mac/mach_multiprocess.cc index f8603afa..568e3147 100644 --- a/util/test/mac/mach_multiprocess.cc +++ b/util/test/mac/mach_multiprocess.cc @@ -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; } diff --git a/util/test/mac/mach_multiprocess_test.cc b/util/test/mac/mach_multiprocess_test.cc index 39295f65..388831fd 100644 --- a/util/test/mac/mach_multiprocess_test.cc +++ b/util/test/mac/mach_multiprocess_test.cc @@ -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 diff --git a/util/test/multiprocess.cc b/util/test/multiprocess.cc index df8212d4..79568374 100644 --- a/util/test/multiprocess.cc +++ b/util/test/multiprocess.cc @@ -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; } diff --git a/util/test/multiprocess_exec.cc b/util/test/multiprocess_exec.cc index 4888a809..fdf98eaf 100644 --- a/util/test/multiprocess_exec.cc +++ b/util/test/multiprocess_exec.cc @@ -27,8 +27,6 @@ namespace crashpad { namespace test { -using namespace testing; - MultiprocessExec::MultiprocessExec() : Multiprocess(), command_(), diff --git a/util/test/multiprocess_exec_test.cc b/util/test/multiprocess_exec_test.cc index 2f30b9b0..d70f0d06 100644 --- a/util/test/multiprocess_exec_test.cc +++ b/util/test/multiprocess_exec_test.cc @@ -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 diff --git a/util/test/multiprocess_test.cc b/util/test/multiprocess_test.cc index b1a96856..ec4394e0 100644 --- a/util/test/multiprocess_test.cc +++ b/util/test/multiprocess_test.cc @@ -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