chromium/net/dns/dns_names_util_unittest.cc

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

#include "net/dns/dns_names_util.h"

#include <climits>
#include <cstdint>
#include <cstring>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

#include "base/containers/span_reader.h"
#include "base/numerics/safe_conversions.h"
#include "net/dns/dns_util.h"
#include "net/dns/public/dns_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net::dns_names_util {
namespace {

Eq;
Optional;

// ToBytes converts a char* to a std::vector<uint8_t> and includes the
// terminating NUL in the result.
std::vector<uint8_t> ToBytes(const char* in) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkWithValidation) {}

TEST(DnsNamesUtilTest, DottedNameToNetwork) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkWithValidationRejectsEmptyLabels) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkRejectsEmptyLabels) {}

TEST(DnsNamesUtilTest,
     DottedNameToNetworkWithValidationAcceptsEmptyLabelAtEnd) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkAcceptsEmptyLabelAtEnd) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkWithValidationAllowsLongNames) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkAllowsLongNames) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkWithValidationRejectsTooLongNames) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkRejectsTooLongNames) {}

TEST(DnsNamesUtilTest,
     DottedNameToNetworkWithValidationRejectsRestrictedCharacters) {}

TEST(DnsNamesUtilTest, DottedNameToNetworkAcceptsRestrictedCharacters) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameAdvancesReader) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleSimpleNames) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleEmpty) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectEmptyIncomplete) {}

// Test `require_complete` functionality given an input with terminating zero-
// length label.
TEST(DnsNamesUtilTest, NetworkToDottedNameComplete) {}

// Test `require_complete` functionality given an input without terminating
// zero-length label.
TEST(DnsNamesUtilTest, NetworkToDottedNameNotComplete) {}

TEST(DnsNamesUtilTest,
     NetworkToDottedNameShouldRejectEmptyWhenRequiringComplete) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectCompression) {}

// Test that extra input past the terminating zero-length label are ignored.
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleExcessInput) {}

// Test that input is malformed if it ends mid label.
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTruncatedNames) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongSingleLabel) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongSecondLabel) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongSingleLabel) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongSecondLabel) {}

#if CHAR_MIN < 0
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectCharMinLabels) {}
#endif  // if CHAR_MIN < 0

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongName) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongName) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongCompleteName) {}

TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongCompleteName) {}

TEST(DnsNamesUtilTest, ValidDnsNames) {}

TEST(DnsNamesUtilTest, EmptyNotValidDnsName) {}

TEST(DnsNamesUtilTest, EmptyLabelNotValidDnsName) {}

TEST(DnsNameUtilTest, LongLabelsInValidDnsNames) {}

TEST(DnsNameUtilTest, TooLongLabelsInInvalidDnsNames) {}

TEST(DnsNameUtilTest, LongValidDnsNames) {}

TEST(DnsNameUtilTest, TooLongInalidDnsNames) {}

TEST(DnsNameUtilTest, LocalhostNotValidDnsRecordName) {}

TEST(DnsNameUtilTest, IpAddressNotValidDnsRecordName) {}

TEST(DnsUtilTest, CanonicalizeNames) {}

TEST(DnsUtilTest, IgnoreUncanonicalizeableNames) {}

TEST(DnsNamesUtilTest, ReadU8LengthPrefixed) {}

TEST(DnsNamesUtilTest, ReadU16LengthPrefixed) {}

}  // namespace
}  // namespace net::dns_names_util