Put GetSocketPairs() in unnamed namespace

This avoids conflicting definitions of GetSocketPairs() in outer namespace when
multiple such cc files are complied for one binary.

PiperOrigin-RevId: 286243045
This commit is contained in:
Jay Zhuang
2019-12-18 12:50:04 -08:00
committed by gVisor bot
parent 803437c96b
commit 65f53c5833
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -10,6 +10,7 @@ exports_files(
[
"socket.cc",
"socket_ip_loopback_blocking.cc",
"socket_ip_tcp_loopback.cc",
"socket_ipv4_udp_unbound_loopback.cc",
"tcp_socket.cc",
"udp_socket.cc",
@@ -23,6 +23,7 @@
namespace gvisor {
namespace testing {
namespace {
std::vector<SocketPairKind> GetSocketPairs() {
return VecCat<SocketPairKind>(
@@ -43,5 +44,6 @@ INSTANTIATE_TEST_SUITE_P(
BlockingIPSockets, BlockingSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
} // namespace
} // namespace testing
} // namespace gvisor
@@ -21,6 +21,7 @@
namespace gvisor {
namespace testing {
namespace {
std::vector<SocketPairKind> GetSocketPairs() {
return {
@@ -34,5 +35,6 @@ INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
} // namespace
} // namespace testing
} // namespace gvisor