mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-17 08:33:54 +00:00
Simplify test set-up
Use platform independent helpers to simplify initializing a ProcessMemory object in this test. Bug: crashpad:263 Change-Id: Id0f9e006f6dbaca31453803b8c790a6832e855e5 Reviewed-on: https://chromium-review.googlesource.com/c/1387264 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
This commit is contained in:
parent
bf6d2e0283
commit
7018a80b36
@ -20,18 +20,8 @@
|
|||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/misc/from_pointer_cast.h"
|
#include "util/misc/from_pointer_cast.h"
|
||||||
|
#include "util/process/process_memory_native.h"
|
||||||
#if defined(OS_FUCHSIA)
|
#include "test/process_type.h"
|
||||||
#include <lib/zx/process.h>
|
|
||||||
|
|
||||||
#include "util/process/process_memory_fuchsia.h"
|
|
||||||
#elif defined(OS_WIN)
|
|
||||||
#include "util/process/process_memory_win.h"
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "util/process/process_memory_linux.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
namespace test {
|
namespace test {
|
||||||
@ -49,16 +39,8 @@ TEST(ProcessMemoryRange, Basic) {
|
|||||||
constexpr bool is_64_bit = false;
|
constexpr bool is_64_bit = false;
|
||||||
#endif // ARCH_CPU_64_BITS
|
#endif // ARCH_CPU_64_BITS
|
||||||
|
|
||||||
#if defined(OS_FUCHSIA)
|
ProcessMemoryNative memory;
|
||||||
ProcessMemoryFuchsia memory;
|
ASSERT_TRUE(memory.Initialize(GetSelfProcess()));
|
||||||
ASSERT_TRUE(memory.Initialize(*zx::process::self()));
|
|
||||||
#elif defined(OS_WIN)
|
|
||||||
ProcessMemoryWin memory;
|
|
||||||
ASSERT_TRUE(memory.Initialize(GetCurrentProcess()));
|
|
||||||
#elif defined(OS_LINUX) || defined(OS_ANDROID)
|
|
||||||
ProcessMemoryLinux memory;
|
|
||||||
ASSERT_TRUE(memory.Initialize(getpid()));
|
|
||||||
#endif // OS_FUCHSIA
|
|
||||||
|
|
||||||
ProcessMemoryRange range;
|
ProcessMemoryRange range;
|
||||||
ASSERT_TRUE(range.Initialize(&memory, is_64_bit));
|
ASSERT_TRUE(range.Initialize(&memory, is_64_bit));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user