#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;
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(DnsNamesUtilTest, NetworkToDottedNameComplete) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameNotComplete) { … }
TEST(DnsNamesUtilTest,
NetworkToDottedNameShouldRejectEmptyWhenRequiringComplete) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectCompression) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleExcessInput) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTruncatedNames) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongSingleLabel) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldHandleLongSecondLabel) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongSingleLabel) { … }
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectTooLongSecondLabel) { … }
#if CHAR_MIN < 0
TEST(DnsNamesUtilTest, NetworkToDottedNameShouldRejectCharMinLabels) { … }
#endif
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) { … }
}
}