From aeffe1056f9ff6526d87a16ef55222899f5528f7 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Wed, 6 Mar 2013 14:04:42 +0000 Subject: Use stdint types everywhere R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e --- .../linux/handler/exception_handler_unittest.cc | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/client/linux/handler/exception_handler_unittest.cc') diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index d7176916..27a7a777 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -423,7 +423,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) { // These are defined here so the parent can use them to check the // data from the minidump afterwards. - const u_int32_t kMemorySize = 256; // bytes + const uint32_t kMemorySize = 256; // bytes const int kOffset = kMemorySize / 2; // This crashes with SIGILL on x86/x86-64/arm. const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff }; @@ -483,7 +483,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) { MinidumpContext* context = exception->GetContext(); ASSERT_TRUE(context); - u_int64_t instruction_pointer; + uint64_t instruction_pointer; ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer)); MinidumpMemoryRegion* region = @@ -491,11 +491,11 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) { ASSERT_TRUE(region); EXPECT_EQ(kMemorySize, region->GetSize()); - const u_int8_t* bytes = region->GetMemory(); + const uint8_t* bytes = region->GetMemory(); ASSERT_TRUE(bytes); - u_int8_t prefix_bytes[kOffset]; - u_int8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)]; + uint8_t prefix_bytes[kOffset]; + uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)]; memset(prefix_bytes, 0, sizeof(prefix_bytes)); memset(suffix_bytes, 0, sizeof(suffix_bytes)); EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0); @@ -515,7 +515,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) { // These are defined here so the parent can use them to check the // data from the minidump afterwards. - const u_int32_t kMemorySize = 256; // bytes + const uint32_t kMemorySize = 256; // bytes const int kOffset = 0; // This crashes with SIGILL on x86/x86-64/arm. const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff }; @@ -575,7 +575,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) { MinidumpContext* context = exception->GetContext(); ASSERT_TRUE(context); - u_int64_t instruction_pointer; + uint64_t instruction_pointer; ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer)); MinidumpMemoryRegion* region = @@ -583,10 +583,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) { ASSERT_TRUE(region); EXPECT_EQ(kMemorySize / 2, region->GetSize()); - const u_int8_t* bytes = region->GetMemory(); + const uint8_t* bytes = region->GetMemory(); ASSERT_TRUE(bytes); - u_int8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)]; + uint8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)]; memset(suffix_bytes, 0, sizeof(suffix_bytes)); EXPECT_TRUE(memcmp(bytes + kOffset, instructions, sizeof(instructions)) == 0); EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(instructions), @@ -606,7 +606,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) { // Use 4k here because the OS will hand out a single page even // if a smaller size is requested, and this test wants to // test the upper bound of the memory range. - const u_int32_t kMemorySize = 4096; // bytes + const uint32_t kMemorySize = 4096; // bytes // This crashes with SIGILL on x86/x86-64/arm. const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff }; const int kOffset = kMemorySize - sizeof(instructions); @@ -665,7 +665,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) { MinidumpContext* context = exception->GetContext(); ASSERT_TRUE(context); - u_int64_t instruction_pointer; + uint64_t instruction_pointer; ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer)); MinidumpMemoryRegion* region = @@ -674,10 +674,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) { const size_t kPrefixSize = 128; // bytes EXPECT_EQ(kPrefixSize + sizeof(instructions), region->GetSize()); - const u_int8_t* bytes = region->GetMemory(); + const uint8_t* bytes = region->GetMemory(); ASSERT_TRUE(bytes); - u_int8_t prefix_bytes[kPrefixSize]; + uint8_t prefix_bytes[kPrefixSize]; memset(prefix_bytes, 0, sizeof(prefix_bytes)); EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0); EXPECT_TRUE(memcmp(bytes + kPrefixSize, @@ -742,9 +742,9 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) { TEST(ExceptionHandlerTest, ModuleInfo) { // These are defined here so the parent can use them to check the // data from the minidump afterwards. - const u_int32_t kMemorySize = sysconf(_SC_PAGESIZE); + const uint32_t kMemorySize = sysconf(_SC_PAGESIZE); const char* kMemoryName = "a fake module"; - const u_int8_t kModuleGUID[sizeof(MDGUID)] = { + const uint8_t kModuleGUID[sizeof(MDGUID)] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; @@ -998,15 +998,15 @@ TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) { // Test that an additional memory region can be added to the minidump. TEST(ExceptionHandlerTest, AdditionalMemory) { - const u_int32_t kMemorySize = sysconf(_SC_PAGESIZE); + const uint32_t kMemorySize = sysconf(_SC_PAGESIZE); // Get some heap memory. - u_int8_t* memory = new u_int8_t[kMemorySize]; + uint8_t* memory = new uint8_t[kMemorySize]; const uintptr_t kMemoryAddress = reinterpret_cast(memory); ASSERT_TRUE(memory); // Stick some data into the memory so the contents can be verified. - for (u_int32_t i = 0; i < kMemorySize; ++i) { + for (uint32_t i = 0; i < kMemorySize; ++i) { memory[i] = i % 255; } @@ -1042,10 +1042,10 @@ TEST(ExceptionHandlerTest, AdditionalMemory) { // Test that a memory region that was previously registered // can be unregistered. TEST(ExceptionHandlerTest, AdditionalMemoryRemove) { - const u_int32_t kMemorySize = sysconf(_SC_PAGESIZE); + const uint32_t kMemorySize = sysconf(_SC_PAGESIZE); // Get some heap memory. - u_int8_t* memory = new u_int8_t[kMemorySize]; + uint8_t* memory = new uint8_t[kMemorySize]; const uintptr_t kMemoryAddress = reinterpret_cast(memory); ASSERT_TRUE(memory); @@ -1109,7 +1109,7 @@ TEST(ExceptionHandlerTest, WriteMinidumpForChild) { // Check that the crashing thread is the main thread of |child| MinidumpException* exception = minidump.GetException(); ASSERT_TRUE(exception); - u_int32_t thread_id; + uint32_t thread_id; ASSERT_TRUE(exception->GetThreadID(&thread_id)); EXPECT_EQ(child, static_cast(thread_id)); -- cgit v1.2.1