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

Side by Side Diff: remoting/protocol/network_settings_unittest.cc

Issue 390983003: Remove remoting/jingle_glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « remoting/protocol/network_settings.cc ('k') | remoting/protocol/socket_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/jingle_glue/network_settings.h" 5 #include "remoting/protocol/network_settings.h"
6
6 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
7 8
8 namespace remoting { 9 namespace remoting {
10 namespace protocol {
9 11
10 TEST(ParsePortRange, Basic) { 12 TEST(ParsePortRange, Basic) {
11 int min, max; 13 int min, max;
12 14
13 // Valid range 15 // Valid range
14 EXPECT_TRUE(NetworkSettings::ParsePortRange("1-65535", &min, &max)); 16 EXPECT_TRUE(NetworkSettings::ParsePortRange("1-65535", &min, &max));
15 EXPECT_EQ(1, min); 17 EXPECT_EQ(1, min);
16 EXPECT_EQ(65535, max); 18 EXPECT_EQ(65535, max);
17 19
18 EXPECT_TRUE(NetworkSettings::ParsePortRange(" 1 - 65535 ", &min, &max)); 20 EXPECT_TRUE(NetworkSettings::ParsePortRange(" 1 - 65535 ", &min, &max));
(...skipping 12 matching lines...) Expand all
31 EXPECT_FALSE(NetworkSettings::ParsePortRange("-1-65535", &min, &max)); 33 EXPECT_FALSE(NetworkSettings::ParsePortRange("-1-65535", &min, &max));
32 EXPECT_FALSE(NetworkSettings::ParsePortRange("1--65535", &min, &max)); 34 EXPECT_FALSE(NetworkSettings::ParsePortRange("1--65535", &min, &max));
33 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65535-", &min, &max)); 35 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65535-", &min, &max));
34 EXPECT_FALSE(NetworkSettings::ParsePortRange("0-65535", &min, &max)); 36 EXPECT_FALSE(NetworkSettings::ParsePortRange("0-65535", &min, &max));
35 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65536", &min, &max)); 37 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65536", &min, &max));
36 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-4294967295", &min, &max)); 38 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-4294967295", &min, &max));
37 EXPECT_FALSE(NetworkSettings::ParsePortRange("10-1", &min, &max)); 39 EXPECT_FALSE(NetworkSettings::ParsePortRange("10-1", &min, &max));
38 EXPECT_FALSE(NetworkSettings::ParsePortRange("1foo-2bar", &min, &max)); 40 EXPECT_FALSE(NetworkSettings::ParsePortRange("1foo-2bar", &min, &max));
39 } 41 }
40 42
43 } // namespace protocol
41 } // namespace remoting 44 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/network_settings.cc ('k') | remoting/protocol/socket_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698