#include "verify_name_match.h"
#include <gtest/gtest.h>
#include "string_util.h"
#include "test_helpers.h"
BSSL_NAMESPACE_BEGIN
namespace {
::testing::AssertionResult LoadTestData(const std::string &prefix,
const std::string &value_type,
const std::string &suffix,
std::string *result) { … }
bool TypesAreComparable(const std::string &type_1, const std::string &type_2) { … }
static const char *kValueTypes[] = …;
static const char *kUnicodeBMPValueTypes[] = …;
static const char *kUnicodeSupplementaryValueTypes[] = …;
static const char *kMangleTypes[] = …;
}
class VerifyNameMatchSimpleTest
: public ::testing::TestWithParam<
::testing::tuple<const char *, const char *>> { … };
TEST_P(VerifyNameMatchSimpleTest, ExactEquality) { … }
TEST_P(VerifyNameMatchSimpleTest, ExtraAttrDoesNotMatch) { … }
TEST_P(VerifyNameMatchSimpleTest, DupeAttrDoesNotMatch) { … }
TEST_P(VerifyNameMatchSimpleTest, ExtraRdnDoesNotMatch) { … }
INSTANTIATE_TEST_SUITE_P(…);
class VerifyNameMatchNormalizationTest
: public ::testing::TestWithParam<::testing::tuple<bool, const char *>> { … };
TEST_P(VerifyNameMatchNormalizationTest, CaseInsensitivity) { … }
TEST_P(VerifyNameMatchNormalizationTest, CollapseWhitespace) { … }
INSTANTIATE_TEST_SUITE_P(…);
class VerifyNameMatchDifferingTypesTest
: public ::testing::TestWithParam<
::testing::tuple<const char *, const char *>> { … };
TEST_P(VerifyNameMatchDifferingTypesTest, NormalizableTypesAreEqual) { … }
TEST_P(VerifyNameMatchDifferingTypesTest, NormalizableTypesInSubtrees) { … }
INSTANTIATE_TEST_SUITE_P(…);
class VerifyNameMatchUnicodeConversionTest
: public ::testing::TestWithParam<::testing::tuple<
const char *, ::testing::tuple<const char *, const char *>>> { … };
TEST_P(VerifyNameMatchUnicodeConversionTest, UnicodeConversionsAreEqual) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
TEST(VerifyNameMatchInvalidDataTest, FailOnInvalidPrintableStringChars) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnInvalidIA5StringChars) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnAttributeTypeAndValueExtraData) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnAttributeTypeAndValueShort) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnAttributeTypeAndValueEmpty) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnBadAttributeType) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnAttributeTypeAndValueNotSequence) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnRdnNotSet) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnEmptyRdn) { … }
TEST(VerifyNameMatchInvalidDataTest, FailOnBmpStringSurrogates) { … }
TEST(VerifyNameMatchTest, EmptyNameMatching) { … }
TEST(VerifyNameMatchRDNSorting, Simple) { … }
TEST(VerifyNameMatchRDNSorting, DuplicateTypes) { … }
TEST(VerifyNameInSubtreeInvalidDataTest, FailOnEmptyRdn) { … }
TEST(VerifyNameInSubtreeTest, EmptyNameMatching) { … }
TEST(NameNormalizationTest, TestEverything) { … }
TEST(NameNormalizationTest, NormalizeCustom) { … }
BSSL_NAMESPACE_END