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

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: 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"));
Sergey Ulanov 2012/10/11 01:15:24 nit: also try letters, e.g. "a123123"
simonmorris 2012/10/11 21:27:35 Done (though the invalid characters I used are adj
30 }
31
32 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698