chromium/components/zucchini/address_translator_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/zucchini/address_translator.h"

#include <string>
#include <utility>

#include "base/format_macros.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace zucchini {

namespace {

// Test case structs. The convention of EXPECT() specifies "expectd" value
// before ""actual". However, AddressTranslator interfaces explicitly state "X
// to Y". So it is clearer in test cases to specify "input" before "expect".
struct OffsetToRvaTestCase {};

struct RvaToOffsetTestCase {};

class TestAddressTranslator : public AddressTranslator {};

// Simple test: Initialize TestAddressTranslator using |specs|, and match
// |expected| results re. success or failure.
void SimpleTest(const std::vector<std::string>& specs,
                AddressTranslator::Status expected,
                const std::string& case_name) {}

// Test AddressTranslator::Initialize's Unit overlap and error checks over
// multiple test cases, each case consists of a fixed unit (specified as
// string), and a variable string taken from an list.
class TwoUnitOverlapTester {};

}  // namespace

TEST(AddressTranslatorTest, Empty) {}

TEST(AddressTranslatorTest, Single) {}

TEST(AddressTranslatorTest, SingleDanglingRva) {}

TEST(AddressTranslatorTest, BasicUsage) {}

TEST(AddressTranslatorTest, Overflow) {}

// Sanity test for TestAddressTranslator::InitializeWithStrings();
TEST(AddressTranslatorTest, AddUnitAsString) {}

// AddressTranslator::Initialize() lists Unit merging examples in comments. The
// format is different from that used by InitializeWithStrings(), but adapting
// them is easy, so we may as well do so.
TEST(AddressTranslatorTest, OverlapFromComment) {}

TEST(AddressTranslatorTest, Overlap) {}

TEST(AddressTranslatorTest, OverlapOffsetMultiple) {}

TEST(AddressTranslatorTest, OverlapDangling) {}

// Tests implementation since algorithm is tricky.
TEST(AddressTranslatorTest, Merge) {}

TEST(AddressTranslatorTest, RvaToOffsetCache_IsValid) {}

}  // namespace zucchini