1 // Copyright (c) 2012 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 "remoting/host/setup/pin_validator.h"
7 #include "testing/gtest/include/gtest/gtest.h"
11 TEST(IsPinValidTest
, Normal
) {
12 EXPECT_TRUE(IsPinValid("123456"));
15 TEST(IsPinValidTest
, Short
) {
16 EXPECT_FALSE(IsPinValid("12345"));
19 TEST(IsPinValidTest
, Long
) {
20 EXPECT_TRUE(IsPinValid("1234567"));
23 TEST(IsPinValidTest
, BadCharacter
) {
24 EXPECT_FALSE(IsPinValid("12345/"));
25 EXPECT_FALSE(IsPinValid("123456/"));
26 EXPECT_FALSE(IsPinValid("/123456"));
27 EXPECT_FALSE(IsPinValid("12345:"));
28 EXPECT_FALSE(IsPinValid("123456:"));
29 EXPECT_FALSE(IsPinValid(":123456"));
30 EXPECT_FALSE(IsPinValid("12345a"));
31 EXPECT_FALSE(IsPinValid("123456a"));
32 EXPECT_FALSE(IsPinValid("a123456"));
35 } // namespace remoting