chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc

// Copyright 2017 The Crashpad Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#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  // defined(ARCH_CPU_ARM64)
#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ||
        // BUILDFLAG(IS_CHROMEOS)

namespace crashpad {
namespace test {
namespace {

constexpr int kUnexpectedExitStatus =;

struct TestableSignal {};

// Keep synchronized with CauseSignal().
std::vector<TestableSignal> TestableSignals() {}

// Keep synchronized with 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) {}

}  // namespace
}  // namespace test
}  // namespace crashpad