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

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: 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..a5469ecbfd8b6eaf68b496e0f0be1771a423d7aa
--- /dev/null
+++ b/remoting/host/setup/pin_validator_unittest.cc
@@ -0,0 +1,32 @@
+// 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"));
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
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698