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

Unified Diff: third_party/crashpad/crashpad/snapshot/mac/mach_o_image_annotations_reader_test.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/snapshot/mac/mach_o_image_annotations_reader_test.cc
diff --git a/third_party/crashpad/crashpad/snapshot/mac/mach_o_image_annotations_reader_test.cc b/third_party/crashpad/crashpad/snapshot/mac/mach_o_image_annotations_reader_test.cc
index 50e646aec946c3672bf4d7fcefb52a47aea7b023..c73eebbfd19a75d977bca1fda18c291de8252894 100644
--- a/third_party/crashpad/crashpad/snapshot/mac/mach_o_image_annotations_reader_test.cc
+++ b/third_party/crashpad/crashpad/snapshot/mac/mach_o_image_annotations_reader_test.cc
@@ -35,7 +35,7 @@
#include "test/errors.h"
#include "test/mac/mach_errors.h"
#include "test/mac/mach_multiprocess.h"
-#include "test/paths.h"
+#include "test/test_paths.h"
#include "util/file/file_io.h"
#include "util/mac/mac_util.h"
#include "util/mach/exc_server_variants.h"
@@ -50,12 +50,12 @@ namespace {
// \return The path to crashpad_snapshot_test_module_crashy_initializer.so
std::string ModuleWithCrashyInitializer() {
- return Paths::Executable().value() + "_module_crashy_initializer.so";
+ return TestPaths::Executable().value() + "_module_crashy_initializer.so";
}
//! \return The path to the crashpad_snapshot_test_no_op executable.
base::FilePath NoOpExecutable() {
- return base::FilePath(Paths::Executable().value() + "_no_op");
+ return base::FilePath(TestPaths::Executable().value() + "_no_op");
}
class TestMachOImageAnnotationsReader final
@@ -121,14 +121,14 @@ class TestMachOImageAnnotationsReader final
// In 10.12.1 and later, the task port will not match ChildTask() in the
// kCrashDyld case, because kCrashDyld uses execl(), which results in a
// new task port being assigned.
- EXPECT_EQ(ChildTask(), task);
+ EXPECT_EQ(task, ChildTask());
}
// The process ID should always compare favorably.
pid_t task_pid;
kern_return_t kr = pid_for_task(task, &task_pid);
- EXPECT_EQ(KERN_SUCCESS, kr) << MachErrorMessage(kr, "pid_for_task");
- EXPECT_EQ(ChildPID(), task_pid);
+ EXPECT_EQ(kr, KERN_SUCCESS) << MachErrorMessage(kr, "pid_for_task");
+ EXPECT_EQ(task_pid, ChildPID());
ProcessReader process_reader;
bool rv = process_reader.Initialize(task);
@@ -261,11 +261,11 @@ class TestMachOImageAnnotationsReader final
}
EXPECT_GE(all_annotations_simple_map.size(), 5u);
- EXPECT_EQ("crash", all_annotations_simple_map["#TEST# pad"]);
- EXPECT_EQ("value", all_annotations_simple_map["#TEST# key"]);
- EXPECT_EQ("y", all_annotations_simple_map["#TEST# x"]);
- EXPECT_EQ("shorter", all_annotations_simple_map["#TEST# longer"]);
- EXPECT_EQ("", all_annotations_simple_map["#TEST# empty_value"]);
+ EXPECT_EQ(all_annotations_simple_map["#TEST# pad"], "crash");
+ EXPECT_EQ(all_annotations_simple_map["#TEST# key"], "value");
+ EXPECT_EQ(all_annotations_simple_map["#TEST# x"], "y");
+ EXPECT_EQ(all_annotations_simple_map["#TEST# longer"], "shorter");
+ EXPECT_EQ(all_annotations_simple_map["#TEST# empty_value"], "");
// Tell the child process that it’s permitted to crash.
CheckedWriteFile(WritePipeHandle(), &c, sizeof(c));
@@ -282,7 +282,7 @@ class TestMachOImageAnnotationsReader final
MachMessageServer::kOneShot,
MachMessageServer::kReceiveLargeError,
kMachMessageTimeoutWaitIndefinitely);
- EXPECT_EQ(MACH_MSG_SUCCESS, mr)
+ EXPECT_EQ(mr, MACH_MSG_SUCCESS)
<< MachErrorMessage(mr, "MachMessageServer::Run");
switch (test_type_) {
@@ -360,7 +360,7 @@ class TestMachOImageAnnotationsReader final
// This should have crashed in the dlopen(). If dlopen() failed, the
// ASSERT_NE() will show the message. If it succeeded without crashing,
// the FAIL() will fail the test.
- ASSERT_NE(nullptr, dl_handle) << dlerror();
+ ASSERT_NE(dl_handle, nullptr) << dlerror();
FAIL();
break;
}
@@ -369,9 +369,9 @@ class TestMachOImageAnnotationsReader final
// Set DYLD_INSERT_LIBRARIES to contain a library that does not exist.
// Unable to load it, dyld will abort with a fatal error.
ASSERT_EQ(
- 0,
setenv(
- "DYLD_INSERT_LIBRARIES", "/var/empty/NoDirectory/NoLibrary", 1))
+ "DYLD_INSERT_LIBRARIES", "/var/empty/NoDirectory/NoLibrary", 1),
+ 0)
<< ErrnoMessage("setenv");
// The actual executable doesn’t matter very much, because dyld won’t
@@ -381,9 +381,10 @@ class TestMachOImageAnnotationsReader final
// with system executables on OS X 10.11 due to System Integrity
// Protection.
base::FilePath no_op_executable = NoOpExecutable();
- ASSERT_EQ(0, execl(no_op_executable.value().c_str(),
- no_op_executable.BaseName().value().c_str(),
- nullptr))
+ ASSERT_EQ(execl(no_op_executable.value().c_str(),
+ no_op_executable.BaseName().value().c_str(),
+ nullptr),
+ 0)
<< ErrnoMessage("execl");
break;
}

Powered by Google App Engine
This is Rietveld 408576698