1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/cert/internal/verify_name_match.h"
7 #include "net/der/input.h"
8 #include "testing/gtest/include/gtest/gtest.h"
12 TEST(VerifyNameMatchTest
, Simple
) {
13 // TODO(mattm): Use valid Names.
14 const uint8_t hello
[] = {'h', 'e', 'l', 'l', 'o'};
15 const uint8_t aello
[] = {'a', 'e', 'l', 'l', 'o'};
16 const uint8_t hello1
[] = {'h', 'e', 'l', 'l', 'o', '1'};
17 EXPECT_TRUE(VerifyNameMatch(der::Input(hello
), der::Input(hello
)));
18 EXPECT_FALSE(VerifyNameMatch(der::Input(aello
), der::Input(hello
)));
19 EXPECT_FALSE(VerifyNameMatch(der::Input(hello
), der::Input(hello1
)));
20 EXPECT_FALSE(VerifyNameMatch(der::Input(hello1
), der::Input(hello
)));