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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/setup/pin_validator_unittest.cc
diff --git a/remoting/host/setup/pin_validator_unittest.cc b/remoting/host/setup/pin_validator_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7244bd7a2bdc3f11babe5fe993caa63b45f00832
--- /dev/null
+++ b/remoting/host/setup/pin_validator_unittest.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/setup/pin_validator.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace remoting {
+
+TEST(IsPinValidTest, Normal) {
+ EXPECT_EQ(true, IsPinValid("123456"));
+}
+
+TEST(IsPinValidTest, Short) {
+ EXPECT_EQ(false, IsPinValid("12345"));
+}
+
+TEST(IsPinValidTest, Long) {
+ EXPECT_EQ(true, IsPinValid("1234567"));
+}
+
+TEST(IsPinValidTest, BadCharacter) {
+ EXPECT_EQ(false, IsPinValid("12345/"));
+ EXPECT_EQ(false, IsPinValid("123456/"));
+ EXPECT_EQ(false, IsPinValid("/123456"));
+ EXPECT_EQ(false, IsPinValid("12345:"));
+ EXPECT_EQ(false, IsPinValid("123456:"));
+ EXPECT_EQ(false, IsPinValid(":123456"));
+ EXPECT_EQ(false, IsPinValid("12345a"));
+ EXPECT_EQ(false, IsPinValid("123456a"));
+ EXPECT_EQ(false, IsPinValid("a123456"));
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698