Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: remoting/host/setup/pin_validator_unittest.cc

Issue 11090063: [Chromoting] Add a simple Windows app that registers and starts a host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "remoting/host/setup/pin_validator.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace remoting {
10
11 TEST(IsPinValidTest, Normal) {
12 EXPECT_EQ(true, IsPinValid("123456"));
13 }
14
15 TEST(IsPinValidTest, Short) {
16 EXPECT_EQ(false, IsPinValid("12345"));
17 }
18
19 TEST(IsPinValidTest, Long) {
20 EXPECT_EQ(true, IsPinValid("1234567"));
21 }
22
23 TEST(IsPinValidTest, BadCharacter) {
24 EXPECT_EQ(false, IsPinValid("12345/"));
25 EXPECT_EQ(false, IsPinValid("123456/"));
26 EXPECT_EQ(false, IsPinValid("/123456"));
27 EXPECT_EQ(false, IsPinValid("12345:"));
28 EXPECT_EQ(false, IsPinValid("123456:"));
29 EXPECT_EQ(false, IsPinValid(":123456"));
30 EXPECT_EQ(false, IsPinValid("12345a"));
31 EXPECT_EQ(false, IsPinValid("123456a"));
32 EXPECT_EQ(false, IsPinValid("a123456"));
33 }
34
35 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698