#include "util/posix/signals.h"
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <iterator>
#include <limits>
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/errors.h"
#include "test/multiprocess.h"
#include "test/scoped_temp_dir.h"
#include "util/posix/scoped_mmap.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
#include <sys/auxv.h>
#include <sys/prctl.h>
#if defined(ARCH_CPU_ARM64)
#ifndef HWCAP2_MTE
#define HWCAP2_MTE …
#endif
#ifndef SEGV_MTEAERR
#define SEGV_MTEAERR …
#endif
#ifndef PROT_MTE
#define PROT_MTE …
#endif
#ifndef PR_SET_TAGGED_ADDR_CTRL
#define PR_SET_TAGGED_ADDR_CTRL …
#endif
#ifndef PR_TAGGED_ADDR_ENABLE
#define PR_TAGGED_ADDR_ENABLE …
#endif
#ifndef PR_MTE_TCF_ASYNC
#define PR_MTE_TCF_ASYNC …
#endif
#endif
#endif
namespace crashpad {
namespace test {
namespace {
constexpr int kUnexpectedExitStatus = …;
struct TestableSignal { … };
std::vector<TestableSignal> TestableSignals() { … }
void CauseSignal(int sig, int code) { … }
class SignalsTest : public Multiprocess { … };
Signals::OldActions SignalsTest::old_actions_;
bool ShouldTestSignal(int sig) { … }
TEST(Signals, WillSignalReraiseAutonomously) { … }
TEST(Signals, Cause_DefaultHandler) { … }
TEST(Signals, Cause_HandlerExits) { … }
TEST(Signals, Cause_HandlerReraisesToDefault) { … }
TEST(Signals, Cause_HandlerReraisesToPrevious) { … }
TEST(Signals, Raise_DefaultHandler) { … }
TEST(Signals, Raise_HandlerExits) { … }
TEST(Signals, Raise_HandlerReraisesToDefault) { … }
TEST(Signals, Raise_HandlerReraisesToPrevious) { … }
TEST(Signals, IsCrashSignal) { … }
TEST(Signals, IsTerminateSignal) { … }
}
}
}