Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / cert / internal / verify_name_match_unittest.cc
blobb7e16ad0ade4b5102543a36992a3865836c6fc39
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"
10 namespace net {
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)));
23 } // namespace net