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

Unified Diff: snapshot/cpu_context_test.cc

Issue 693933002: Add MinidumpThreadListWriter::InitializeFromSnapshot() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_init_from_snapshot_context_new
Patch Set: Address review feedback Created 6 years, 1 month 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
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/snapshot.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/cpu_context_test.cc
diff --git a/snapshot/cpu_context_test.cc b/snapshot/cpu_context_test.cc
index e48561f7d06fcc9603dd9089f3b01a8c2b785ce8..a5f0b6aab6eee7c60d7ffbcd750de64948d86d6f 100644
--- a/snapshot/cpu_context_test.cc
+++ b/snapshot/cpu_context_test.cc
@@ -17,6 +17,7 @@
#include <stdint.h>
#include <string.h>
+#include "base/basictypes.h"
#include "gtest/gtest.h"
namespace crashpad {
@@ -143,6 +144,21 @@ TEST(CPUContextX86, FxsaveToFsaveTagWord) {
SetX87Register(&st_mm[7], kExponentNormal, true, kFractionNormal); // valid
EXPECT_EQ(0xfe90,
CPUContextX86::FxsaveToFsaveTagWord(fsw, fxsave_tag, st_mm));
+
+ // In this set, everything is valid.
+ fsw = 0 << 11; // top = 0: logical 0-7 maps to physical 0-7
+ fxsave_tag = 0xff; // nothing empty
+ for (size_t index = 0; index < arraysize(st_mm); ++index) {
+ SetX87Register(&st_mm[index], kExponentNormal, true, kFractionAllZero);
+ }
+ EXPECT_EQ(0, CPUContextX86::FxsaveToFsaveTagWord(fsw, fxsave_tag, st_mm));
+
+ // In this set, everything is empty. The registers shouldn’t be consulted at
+ // all, so they’re left alone from the previous set.
+ fsw = 0 << 11; // top = 0: logical 0-7 maps to physical 0-7
+ fxsave_tag = 0; // everything empty
+ EXPECT_EQ(0xffff,
+ CPUContextX86::FxsaveToFsaveTagWord(fsw, fxsave_tag, st_mm));
}
} // namespace
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/snapshot.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698