Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc

Issue 2804713002: Update Crashpad to b4095401639ebe2ad33169e5c1d994065cbff1b8 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc
diff --git a/third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc b/third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc
index 8999abe0661979655e1980a97f2aed01c4aa932e..cd8e5227a20f2ef42ef343620c15eee7e9254c37 100644
--- a/third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc
+++ b/third_party/crashpad/crashpad/minidump/test/minidump_context_test_util.cc
@@ -149,48 +149,48 @@ namespace {
template <typename FxsaveType>
void ExpectMinidumpContextFxsave(const FxsaveType* expected,
const FxsaveType* observed) {
- EXPECT_EQ(expected->fcw, observed->fcw);
- EXPECT_EQ(expected->fsw, observed->fsw);
- EXPECT_EQ(expected->ftw, observed->ftw);
- EXPECT_EQ(expected->reserved_1, observed->reserved_1);
- EXPECT_EQ(expected->fop, observed->fop);
- EXPECT_EQ(expected->fpu_ip, observed->fpu_ip);
- EXPECT_EQ(expected->fpu_cs, observed->fpu_cs);
- EXPECT_EQ(expected->reserved_2, observed->reserved_2);
- EXPECT_EQ(expected->fpu_dp, observed->fpu_dp);
- EXPECT_EQ(expected->fpu_ds, observed->fpu_ds);
- EXPECT_EQ(expected->reserved_3, observed->reserved_3);
- EXPECT_EQ(expected->mxcsr, observed->mxcsr);
- EXPECT_EQ(expected->mxcsr_mask, observed->mxcsr_mask);
+ EXPECT_EQ(observed->fcw, expected->fcw);
+ EXPECT_EQ(observed->fsw, expected->fsw);
+ EXPECT_EQ(observed->ftw, expected->ftw);
+ EXPECT_EQ(observed->reserved_1, expected->reserved_1);
+ EXPECT_EQ(observed->fop, expected->fop);
+ EXPECT_EQ(observed->fpu_ip, expected->fpu_ip);
+ EXPECT_EQ(observed->fpu_cs, expected->fpu_cs);
+ EXPECT_EQ(observed->reserved_2, expected->reserved_2);
+ EXPECT_EQ(observed->fpu_dp, expected->fpu_dp);
+ EXPECT_EQ(observed->fpu_ds, expected->fpu_ds);
+ EXPECT_EQ(observed->reserved_3, expected->reserved_3);
+ EXPECT_EQ(observed->mxcsr, expected->mxcsr);
+ EXPECT_EQ(observed->mxcsr_mask, expected->mxcsr_mask);
for (size_t st_mm_index = 0;
st_mm_index < arraysize(expected->st_mm);
++st_mm_index) {
SCOPED_TRACE(base::StringPrintf("st_mm_index %" PRIuS, st_mm_index));
- EXPECT_EQ(BytesToHexString(expected->st_mm[st_mm_index].st,
- arraysize(expected->st_mm[st_mm_index].st)),
- BytesToHexString(observed->st_mm[st_mm_index].st,
- arraysize(observed->st_mm[st_mm_index].st)));
+ EXPECT_EQ(BytesToHexString(observed->st_mm[st_mm_index].st,
+ arraysize(observed->st_mm[st_mm_index].st)),
+ BytesToHexString(expected->st_mm[st_mm_index].st,
+ arraysize(expected->st_mm[st_mm_index].st)));
EXPECT_EQ(
- BytesToHexString(expected->st_mm[st_mm_index].st_reserved,
- arraysize(expected->st_mm[st_mm_index].st_reserved)),
BytesToHexString(observed->st_mm[st_mm_index].st_reserved,
- arraysize(observed->st_mm[st_mm_index].st_reserved)));
+ arraysize(observed->st_mm[st_mm_index].st_reserved)),
+ BytesToHexString(expected->st_mm[st_mm_index].st_reserved,
+ arraysize(expected->st_mm[st_mm_index].st_reserved)));
}
for (size_t xmm_index = 0;
xmm_index < arraysize(expected->xmm);
++xmm_index) {
- EXPECT_EQ(BytesToHexString(expected->xmm[xmm_index],
- arraysize(expected->xmm[xmm_index])),
- BytesToHexString(observed->xmm[xmm_index],
- arraysize(observed->xmm[xmm_index])))
+ EXPECT_EQ(BytesToHexString(observed->xmm[xmm_index],
+ arraysize(observed->xmm[xmm_index])),
+ BytesToHexString(expected->xmm[xmm_index],
+ arraysize(expected->xmm[xmm_index])))
<< "xmm_index " << xmm_index;
}
EXPECT_EQ(
- BytesToHexString(expected->reserved_4, arraysize(expected->reserved_4)),
- BytesToHexString(observed->reserved_4, arraysize(observed->reserved_4)));
+ BytesToHexString(observed->reserved_4, arraysize(observed->reserved_4)),
+ BytesToHexString(expected->reserved_4, arraysize(expected->reserved_4)));
EXPECT_EQ(
- BytesToHexString(expected->available, arraysize(expected->available)),
- BytesToHexString(observed->available, arraysize(observed->available)));
+ BytesToHexString(observed->available, arraysize(observed->available)),
+ BytesToHexString(expected->available, arraysize(expected->available)));
}
} // namespace
@@ -200,50 +200,50 @@ void ExpectMinidumpContextX86(
MinidumpContextX86 expected;
InitializeMinidumpContextX86(&expected, expect_seed);
- EXPECT_EQ(expected.context_flags, observed->context_flags);
- EXPECT_EQ(expected.dr0, observed->dr0);
- EXPECT_EQ(expected.dr1, observed->dr1);
- EXPECT_EQ(expected.dr2, observed->dr2);
- EXPECT_EQ(expected.dr3, observed->dr3);
- EXPECT_EQ(expected.dr6, observed->dr6);
- EXPECT_EQ(expected.dr7, observed->dr7);
-
- EXPECT_EQ(expected.fsave.fcw, observed->fsave.fcw);
- EXPECT_EQ(expected.fsave.fsw, observed->fsave.fsw);
- EXPECT_EQ(expected.fsave.ftw, observed->fsave.ftw);
- EXPECT_EQ(expected.fsave.fpu_ip, observed->fsave.fpu_ip);
- EXPECT_EQ(expected.fsave.fpu_cs, observed->fsave.fpu_cs);
- EXPECT_EQ(expected.fsave.fpu_dp, observed->fsave.fpu_dp);
- EXPECT_EQ(expected.fsave.fpu_ds, observed->fsave.fpu_ds);
+ EXPECT_EQ(observed->context_flags, expected.context_flags);
+ EXPECT_EQ(observed->dr0, expected.dr0);
+ EXPECT_EQ(observed->dr1, expected.dr1);
+ EXPECT_EQ(observed->dr2, expected.dr2);
+ EXPECT_EQ(observed->dr3, expected.dr3);
+ EXPECT_EQ(observed->dr6, expected.dr6);
+ EXPECT_EQ(observed->dr7, expected.dr7);
+
+ EXPECT_EQ(observed->fsave.fcw, expected.fsave.fcw);
+ EXPECT_EQ(observed->fsave.fsw, expected.fsave.fsw);
+ EXPECT_EQ(observed->fsave.ftw, expected.fsave.ftw);
+ EXPECT_EQ(observed->fsave.fpu_ip, expected.fsave.fpu_ip);
+ EXPECT_EQ(observed->fsave.fpu_cs, expected.fsave.fpu_cs);
+ EXPECT_EQ(observed->fsave.fpu_dp, expected.fsave.fpu_dp);
+ EXPECT_EQ(observed->fsave.fpu_ds, expected.fsave.fpu_ds);
for (size_t index = 0; index < arraysize(expected.fsave.st); ++index) {
- EXPECT_EQ(BytesToHexString(expected.fsave.st[index],
- arraysize(expected.fsave.st[index])),
- BytesToHexString(observed->fsave.st[index],
- arraysize(observed->fsave.st[index])))
+ EXPECT_EQ(BytesToHexString(observed->fsave.st[index],
+ arraysize(observed->fsave.st[index])),
+ BytesToHexString(expected.fsave.st[index],
+ arraysize(expected.fsave.st[index])))
<< "index " << index;
}
if (snapshot) {
- EXPECT_EQ(0u, observed->float_save.spare_0);
+ EXPECT_EQ(observed->float_save.spare_0, 0u);
} else {
- EXPECT_EQ(expected.float_save.spare_0, observed->float_save.spare_0);
+ EXPECT_EQ(observed->float_save.spare_0, expected.float_save.spare_0);
}
- EXPECT_EQ(expected.gs, observed->gs);
- EXPECT_EQ(expected.fs, observed->fs);
- EXPECT_EQ(expected.es, observed->es);
- EXPECT_EQ(expected.ds, observed->ds);
- EXPECT_EQ(expected.edi, observed->edi);
- EXPECT_EQ(expected.esi, observed->esi);
- EXPECT_EQ(expected.ebx, observed->ebx);
- EXPECT_EQ(expected.edx, observed->edx);
- EXPECT_EQ(expected.ecx, observed->ecx);
- EXPECT_EQ(expected.eax, observed->eax);
- EXPECT_EQ(expected.ebp, observed->ebp);
- EXPECT_EQ(expected.eip, observed->eip);
- EXPECT_EQ(expected.cs, observed->cs);
- EXPECT_EQ(expected.eflags, observed->eflags);
- EXPECT_EQ(expected.esp, observed->esp);
- EXPECT_EQ(expected.ss, observed->ss);
+ EXPECT_EQ(observed->gs, expected.gs);
+ EXPECT_EQ(observed->fs, expected.fs);
+ EXPECT_EQ(observed->es, expected.es);
+ EXPECT_EQ(observed->ds, expected.ds);
+ EXPECT_EQ(observed->edi, expected.edi);
+ EXPECT_EQ(observed->esi, expected.esi);
+ EXPECT_EQ(observed->ebx, expected.ebx);
+ EXPECT_EQ(observed->edx, expected.edx);
+ EXPECT_EQ(observed->ecx, expected.ecx);
+ EXPECT_EQ(observed->eax, expected.eax);
+ EXPECT_EQ(observed->ebp, expected.ebp);
+ EXPECT_EQ(observed->eip, expected.eip);
+ EXPECT_EQ(observed->cs, expected.cs);
+ EXPECT_EQ(observed->eflags, expected.eflags);
+ EXPECT_EQ(observed->esp, expected.esp);
+ EXPECT_EQ(observed->ss, expected.ss);
ExpectMinidumpContextFxsave(&expected.fxsave, &observed->fxsave);
}
@@ -253,98 +253,100 @@ void ExpectMinidumpContextAMD64(
MinidumpContextAMD64 expected;
InitializeMinidumpContextAMD64(&expected, expect_seed);
- EXPECT_EQ(expected.context_flags, observed->context_flags);
+ EXPECT_EQ(observed->context_flags, expected.context_flags);
if (snapshot) {
- EXPECT_EQ(0u, observed->p1_home);
- EXPECT_EQ(0u, observed->p2_home);
- EXPECT_EQ(0u, observed->p3_home);
- EXPECT_EQ(0u, observed->p4_home);
- EXPECT_EQ(0u, observed->p5_home);
- EXPECT_EQ(0u, observed->p6_home);
+ EXPECT_EQ(observed->p1_home, 0u);
+ EXPECT_EQ(observed->p2_home, 0u);
+ EXPECT_EQ(observed->p3_home, 0u);
+ EXPECT_EQ(observed->p4_home, 0u);
+ EXPECT_EQ(observed->p5_home, 0u);
+ EXPECT_EQ(observed->p6_home, 0u);
} else {
- EXPECT_EQ(expected.p1_home, observed->p1_home);
- EXPECT_EQ(expected.p2_home, observed->p2_home);
- EXPECT_EQ(expected.p3_home, observed->p3_home);
- EXPECT_EQ(expected.p4_home, observed->p4_home);
- EXPECT_EQ(expected.p5_home, observed->p5_home);
- EXPECT_EQ(expected.p6_home, observed->p6_home);
+ EXPECT_EQ(observed->p1_home, expected.p1_home);
+ EXPECT_EQ(observed->p2_home, expected.p2_home);
+ EXPECT_EQ(observed->p3_home, expected.p3_home);
+ EXPECT_EQ(observed->p4_home, expected.p4_home);
+ EXPECT_EQ(observed->p5_home, expected.p5_home);
+ EXPECT_EQ(observed->p6_home, expected.p6_home);
}
- EXPECT_EQ(expected.mx_csr, observed->mx_csr);
+ EXPECT_EQ(observed->mx_csr, expected.mx_csr);
- EXPECT_EQ(expected.cs, observed->cs);
+ EXPECT_EQ(observed->cs, expected.cs);
if (snapshot) {
- EXPECT_EQ(0u, observed->ds);
- EXPECT_EQ(0u, observed->es);
+ EXPECT_EQ(observed->ds, 0u);
+ EXPECT_EQ(observed->es, 0u);
} else {
- EXPECT_EQ(expected.ds, observed->ds);
- EXPECT_EQ(expected.es, observed->es);
+ EXPECT_EQ(observed->ds, expected.ds);
+ EXPECT_EQ(observed->es, expected.es);
}
- EXPECT_EQ(expected.fs, observed->fs);
- EXPECT_EQ(expected.gs, observed->gs);
+ EXPECT_EQ(observed->fs, expected.fs);
+ EXPECT_EQ(observed->gs, expected.gs);
if (snapshot) {
- EXPECT_EQ(0u, observed->ss);
+ EXPECT_EQ(observed->ss, 0u);
} else {
- EXPECT_EQ(expected.ss, observed->ss);
+ EXPECT_EQ(observed->ss, expected.ss);
}
- EXPECT_EQ(expected.eflags, observed->eflags);
-
- EXPECT_EQ(expected.dr0, observed->dr0);
- EXPECT_EQ(expected.dr1, observed->dr1);
- EXPECT_EQ(expected.dr2, observed->dr2);
- EXPECT_EQ(expected.dr3, observed->dr3);
- EXPECT_EQ(expected.dr6, observed->dr6);
- EXPECT_EQ(expected.dr7, observed->dr7);
-
- EXPECT_EQ(expected.rax, observed->rax);
- EXPECT_EQ(expected.rcx, observed->rcx);
- EXPECT_EQ(expected.rdx, observed->rdx);
- EXPECT_EQ(expected.rbx, observed->rbx);
- EXPECT_EQ(expected.rsp, observed->rsp);
- EXPECT_EQ(expected.rbp, observed->rbp);
- EXPECT_EQ(expected.rsi, observed->rsi);
- EXPECT_EQ(expected.rdi, observed->rdi);
- EXPECT_EQ(expected.r8, observed->r8);
- EXPECT_EQ(expected.r9, observed->r9);
- EXPECT_EQ(expected.r10, observed->r10);
- EXPECT_EQ(expected.r11, observed->r11);
- EXPECT_EQ(expected.r12, observed->r12);
- EXPECT_EQ(expected.r13, observed->r13);
- EXPECT_EQ(expected.r14, observed->r14);
- EXPECT_EQ(expected.r15, observed->r15);
- EXPECT_EQ(expected.rip, observed->rip);
+ EXPECT_EQ(observed->eflags, expected.eflags);
+
+ EXPECT_EQ(observed->dr0, expected.dr0);
+ EXPECT_EQ(observed->dr1, expected.dr1);
+ EXPECT_EQ(observed->dr2, expected.dr2);
+ EXPECT_EQ(observed->dr3, expected.dr3);
+ EXPECT_EQ(observed->dr6, expected.dr6);
+ EXPECT_EQ(observed->dr7, expected.dr7);
+
+ EXPECT_EQ(observed->rax, expected.rax);
+ EXPECT_EQ(observed->rcx, expected.rcx);
+ EXPECT_EQ(observed->rdx, expected.rdx);
+ EXPECT_EQ(observed->rbx, expected.rbx);
+ EXPECT_EQ(observed->rsp, expected.rsp);
+ EXPECT_EQ(observed->rbp, expected.rbp);
+ EXPECT_EQ(observed->rsi, expected.rsi);
+ EXPECT_EQ(observed->rdi, expected.rdi);
+ EXPECT_EQ(observed->r8, expected.r8);
+ EXPECT_EQ(observed->r9, expected.r9);
+ EXPECT_EQ(observed->r10, expected.r10);
+ EXPECT_EQ(observed->r11, expected.r11);
+ EXPECT_EQ(observed->r12, expected.r12);
+ EXPECT_EQ(observed->r13, expected.r13);
+ EXPECT_EQ(observed->r14, expected.r14);
+ EXPECT_EQ(observed->r15, expected.r15);
+ EXPECT_EQ(observed->rip, expected.rip);
ExpectMinidumpContextFxsave(&expected.fxsave, &observed->fxsave);
for (size_t index = 0; index < arraysize(expected.vector_register); ++index) {
if (snapshot) {
- EXPECT_EQ(0u, observed->vector_register[index].lo) << "index " << index;
- EXPECT_EQ(0u, observed->vector_register[index].hi) << "index " << index;
+ EXPECT_EQ(observed->vector_register[index].lo, 0u) << "index " << index;
+ EXPECT_EQ(observed->vector_register[index].hi, 0u) << "index " << index;
} else {
- EXPECT_EQ(expected.vector_register[index].lo,
- observed->vector_register[index].lo) << "index " << index;
- EXPECT_EQ(expected.vector_register[index].hi,
- observed->vector_register[index].hi) << "index " << index;
+ EXPECT_EQ(observed->vector_register[index].lo,
+ expected.vector_register[index].lo)
+ << "index " << index;
+ EXPECT_EQ(observed->vector_register[index].hi,
+ expected.vector_register[index].hi)
+ << "index " << index;
}
}
if (snapshot) {
- EXPECT_EQ(0u, observed->vector_control);
- EXPECT_EQ(0u, observed->debug_control);
- EXPECT_EQ(0u, observed->last_branch_to_rip);
- EXPECT_EQ(0u, observed->last_branch_from_rip);
- EXPECT_EQ(0u, observed->last_exception_to_rip);
- EXPECT_EQ(0u, observed->last_exception_from_rip);
+ EXPECT_EQ(observed->vector_control, 0u);
+ EXPECT_EQ(observed->debug_control, 0u);
+ EXPECT_EQ(observed->last_branch_to_rip, 0u);
+ EXPECT_EQ(observed->last_branch_from_rip, 0u);
+ EXPECT_EQ(observed->last_exception_to_rip, 0u);
+ EXPECT_EQ(observed->last_exception_from_rip, 0u);
} else {
- EXPECT_EQ(expected.vector_control, observed->vector_control);
- EXPECT_EQ(expected.debug_control, observed->debug_control);
- EXPECT_EQ(expected.last_branch_to_rip, observed->last_branch_to_rip);
- EXPECT_EQ(expected.last_branch_from_rip, observed->last_branch_from_rip);
- EXPECT_EQ(expected.last_exception_to_rip, observed->last_exception_to_rip);
- EXPECT_EQ(expected.last_exception_from_rip,
- observed->last_exception_from_rip);
+ EXPECT_EQ(observed->vector_control, expected.vector_control);
+ EXPECT_EQ(observed->debug_control, expected.debug_control);
+ EXPECT_EQ(observed->last_branch_to_rip, expected.last_branch_to_rip);
+ EXPECT_EQ(observed->last_branch_from_rip, expected.last_branch_from_rip);
+ EXPECT_EQ(observed->last_exception_to_rip, expected.last_exception_to_rip);
+ EXPECT_EQ(observed->last_exception_from_rip,
+ expected.last_exception_from_rip);
}
}

Powered by Google App Engine
This is Rietveld 408576698