OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/cert/internal/verify_name_match.h" | 5 #include "net/cert/internal/verify_name_match.h" |
6 | 6 |
7 #include "net/der/input.h" | 7 #include "net/der/input.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 TEST(VerifyNameMatchTest, Simple) { | 12 TEST(VerifyNameMatchTest, Simple) { |
13 // TODO(mattm): Use valid Names. | 13 // TODO(mattm): Use valid Names. |
14 EXPECT_TRUE(VerifyNameMatch(der::Input("hello"), der::Input("hello"))); | 14 EXPECT_TRUE(VerifyNameMatch(der::Input::FromCString("hello"), |
15 EXPECT_FALSE(VerifyNameMatch(der::Input("aello"), der::Input("hello"))); | 15 der::Input::FromCString("hello"))); |
16 EXPECT_FALSE(VerifyNameMatch(der::Input("hello"), der::Input("hello1"))); | 16 EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("aello"), |
17 EXPECT_FALSE(VerifyNameMatch(der::Input("hello1"), der::Input("hello"))); | 17 der::Input::FromCString("hello"))); |
| 18 EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("hello"), |
| 19 der::Input::FromCString("hello1"))); |
| 20 EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("hello1"), |
| 21 der::Input::FromCString("hello"))); |
18 } | 22 } |
19 | 23 |
20 } // namespace net | 24 } // namespace net |
OLD | NEW |