You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2017/07/25 01:26:37 UTC
[2/2] mesos git commit: Added a test to check for copy assignment of
`net::IP::Network`.
Added a test to check for copy assignment of `net::IP::Network`.
Review: https://reviews.apache.org/r/61005/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cd3380c4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cd3380c4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cd3380c4
Branch: refs/heads/master
Commit: cd3380c4e9521b4b26f9030658816eee7a4b89a1
Parents: b80e239
Author: Avinash sridharan <av...@mesosphere.io>
Authored: Mon Jul 24 18:24:51 2017 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Mon Jul 24 18:25:49 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/tests/ip_tests.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cd3380c4/3rdparty/stout/tests/ip_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/ip_tests.cpp b/3rdparty/stout/tests/ip_tests.cpp
index dba0de6..a38e93c 100644
--- a/3rdparty/stout/tests/ip_tests.cpp
+++ b/3rdparty/stout/tests/ip_tests.cpp
@@ -238,3 +238,21 @@ TEST(NetTest, ConstructIPv6Network)
ASSERT_SOME(network2);
EXPECT_EQ(network.get(), network2.get());
}
+
+
+// Check the copy assignment operator for `net::IP::Network` works.
+TEST(NetTest, CopyIPNetwork)
+{
+ Try<net::IP::Network> network = net::IP::Network::parse("192.168.1.1/16");
+ EXPECT_SOME(network);
+
+ net::IP::Network network2 = network.get();
+ EXPECT_EQ(network2, network.get());
+
+ // Check the same for IPv6.
+ network = net::IP::Network::parse("::1/128");
+ EXPECT_SOME(network);
+
+ network2 = network.get();
+ EXPECT_EQ(network2, network.get());
+}