add missing const to fix `folly::toDynamic` on `std::vector<bool>`
[folly.git] / folly / test / SocketAddressTest.cpp
index 6a95db98f1040a60461621c34738c43080d92b15..2af4370fe7d7d734ef86eacbe44512e21e401222 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -909,3 +909,15 @@ TEST(SocketAddress, ResetIPAddress) {
   EXPECT_FALSE(addr.isInitialized());
   EXPECT_TRUE(addr.empty());
 }
+
+TEST(SocketAddress, ValidFamilyInet) {
+  SocketAddress addr;
+  EXPECT_FALSE(addr.isFamilyInet());
+  folly::IPAddress ipAddr("123.234.0.23");
+  addr.setFromIpAddrPort(ipAddr, 8888);
+  EXPECT_TRUE(addr.isFamilyInet());
+
+  folly::IPAddress ip6Addr("2620:0:1cfe:face:b00c::3");
+  SocketAddress addr6(ip6Addr, 8888);
+  EXPECT_TRUE(addr6.isFamilyInet());
+}