#include "components/zucchini/disassembler_ztf.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <map>
#include <set>
#include <string_view>
#include <utility>
#include <vector>
#include "components/zucchini/buffer_view.h"
#include "components/zucchini/element_detection.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace zucchini {
namespace {
constexpr char kNormalText[] = …;
constexpr size_t kNormalTextExtraBytes = …;
constexpr char kOutOfBoundsText[] = …;
std::vector<uint8_t> StrToData(std::string_view s) { … }
struct ReferenceCompare { … };
ReferenceKey;
ReferenceSets;
void WriteReferences(MutableBufferView image,
size_t expected_size,
const ReferenceSets& refs_to_write) { … }
void ReadReferences(ConstBufferView image,
size_t expected_size,
ReferenceSets* refs_to_read) { … }
void TestTranslation(const ZtfTranslator& translator,
offset_t expected_location,
ztf::LineCol lc) { … }
template <typename T>
size_t CountDistinct(const std::vector<T>& v) { … }
}
TEST(ZtfTranslatorTest, Translate) { … }
TEST(DisassemblerZtfTest, ReferenceGroups) { … }
TEST(DisassemblerZtfTest, BadMagic) { … }
TEST(DisassemblerZtfTest, ZtfSizeBound) { … }
TEST(DisassemblerZtfTest, NormalRead) { … }
TEST(DisassemblerZtfTest, NormalWrite) { … }
TEST(DisassemblerZtfTest, ReadOutOfBoundsRefs) { … }
TEST(DisassemblerZtfTest, WriteOutOfBoundsRefs) { … }
}