Index: third_party/crashpad/crashpad/util/win/capture_context_test.cc |
diff --git a/third_party/crashpad/crashpad/util/win/capture_context_test.cc b/third_party/crashpad/crashpad/util/win/capture_context_test.cc |
index 72b25874a4b44986e081ad9890002d2076709dcb..59bef2ff916e9be7cef11ec0589447744ae82cf0 100644 |
--- a/third_party/crashpad/crashpad/util/win/capture_context_test.cc |
+++ b/third_party/crashpad/crashpad/util/win/capture_context_test.cc |
@@ -39,16 +39,13 @@ void SanityCheckContext(const CONTEXT& context) { |
CONTEXT_INTEGER | |
CONTEXT_SEGMENTS | |
CONTEXT_FLOATING_POINT; |
- ASSERT_EQ(must_have, context.ContextFlags & must_have); |
+ ASSERT_EQ(context.ContextFlags & must_have, must_have); |
const uint32_t may_have = CONTEXT_EXTENDED_REGISTERS; |
- ASSERT_EQ(0, context.ContextFlags & ~(must_have | may_have)); |
+ ASSERT_EQ(context.ContextFlags & ~(must_have | may_have), 0); |
#elif defined(ARCH_CPU_X86_64) |
- ASSERT_EQ(CONTEXT_AMD64 | |
- CONTEXT_CONTROL | |
- CONTEXT_INTEGER | |
- CONTEXT_SEGMENTS | |
- CONTEXT_FLOATING_POINT, |
- context.ContextFlags); |
+ ASSERT_EQ(context.ContextFlags, |
+ CONTEXT_AMD64 | CONTEXT_CONTROL | CONTEXT_INTEGER | |
+ CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT); |
#endif |
#if defined(ARCH_CPU_X86_FAMILY) |
@@ -61,52 +58,52 @@ void SanityCheckContext(const CONTEXT& context) { |
// Software Developer’s Manual, Volume 1: Basic Architecture (253665-055), |
// 3.4.3 “EFLAGS Register”, and AMD Architecture Programmer’s Manual, Volume |
// 2: System Programming (24593-3.25), 3.1.6 “RFLAGS Register”. |
- EXPECT_EQ(2u, context.EFlags & 0xffc0802a); |
+ EXPECT_EQ(context.EFlags & 0xffc0802a, 2u); |
// CaptureContext() doesn’t capture debug registers, so make sure they read 0. |
- EXPECT_EQ(0, context.Dr0); |
- EXPECT_EQ(0, context.Dr1); |
- EXPECT_EQ(0, context.Dr2); |
- EXPECT_EQ(0, context.Dr3); |
- EXPECT_EQ(0, context.Dr6); |
- EXPECT_EQ(0, context.Dr7); |
+ EXPECT_EQ(context.Dr0, 0); |
+ EXPECT_EQ(context.Dr1, 0); |
+ EXPECT_EQ(context.Dr2, 0); |
+ EXPECT_EQ(context.Dr3, 0); |
+ EXPECT_EQ(context.Dr6, 0); |
+ EXPECT_EQ(context.Dr7, 0); |
#endif |
#if defined(ARCH_CPU_X86) |
// fxsave doesn’t write these bytes. |
for (size_t i = 464; i < arraysize(context.ExtendedRegisters); ++i) { |
SCOPED_TRACE(i); |
- EXPECT_EQ(0, context.ExtendedRegisters[i]); |
+ EXPECT_EQ(context.ExtendedRegisters[i], 0); |
} |
#elif defined(ARCH_CPU_X86_64) |
// mxcsr shows up twice in the context structure. Make sure the values are |
// identical. |
- EXPECT_EQ(context.MxCsr, context.FltSave.MxCsr); |
+ EXPECT_EQ(context.FltSave.MxCsr, context.MxCsr); |
// fxsave doesn’t write these bytes. |
for (size_t i = 0; i < arraysize(context.FltSave.Reserved4); ++i) { |
SCOPED_TRACE(i); |
- EXPECT_EQ(0, context.FltSave.Reserved4[i]); |
+ EXPECT_EQ(context.FltSave.Reserved4[i], 0); |
} |
// CaptureContext() doesn’t use these fields. |
- EXPECT_EQ(0, context.P1Home); |
- EXPECT_EQ(0, context.P2Home); |
- EXPECT_EQ(0, context.P3Home); |
- EXPECT_EQ(0, context.P4Home); |
- EXPECT_EQ(0, context.P5Home); |
- EXPECT_EQ(0, context.P6Home); |
+ EXPECT_EQ(context.P1Home, 0); |
+ EXPECT_EQ(context.P2Home, 0); |
+ EXPECT_EQ(context.P3Home, 0); |
+ EXPECT_EQ(context.P4Home, 0); |
+ EXPECT_EQ(context.P5Home, 0); |
+ EXPECT_EQ(context.P6Home, 0); |
for (size_t i = 0; i < arraysize(context.VectorRegister); ++i) { |
SCOPED_TRACE(i); |
- EXPECT_EQ(0, context.VectorRegister[i].Low); |
- EXPECT_EQ(0, context.VectorRegister[i].High); |
+ EXPECT_EQ(context.VectorRegister[i].Low, 0); |
+ EXPECT_EQ(context.VectorRegister[i].High, 0); |
} |
- EXPECT_EQ(0, context.VectorControl); |
- EXPECT_EQ(0, context.DebugControl); |
- EXPECT_EQ(0, context.LastBranchToRip); |
- EXPECT_EQ(0, context.LastBranchFromRip); |
- EXPECT_EQ(0, context.LastExceptionToRip); |
- EXPECT_EQ(0, context.LastExceptionFromRip); |
+ EXPECT_EQ(context.VectorControl, 0); |
+ EXPECT_EQ(context.DebugControl, 0); |
+ EXPECT_EQ(context.LastBranchToRip, 0); |
+ EXPECT_EQ(context.LastBranchFromRip, 0); |
+ EXPECT_EQ(context.LastExceptionToRip, 0); |
+ EXPECT_EQ(context.LastExceptionFromRip, 0); |
#endif |
} |
@@ -170,7 +167,7 @@ void TestCaptureContext() { |
ASSERT_NO_FATAL_FAILURE(SanityCheckContext(context_2)); |
} |
- EXPECT_EQ(sp, StackPointerFromContext(context_2)); |
+ EXPECT_EQ(StackPointerFromContext(context_2), sp); |
EXPECT_GT(ProgramCounterFromContext(context_2), pc); |
} |