From 0a52b647945e557c446b173309644458cd0a2ec3 Mon Sep 17 00:00:00 2001 From: Nayana Bidari Date: Fri, 29 Jan 2021 13:13:46 -0800 Subject: - Add more comments for the TCP_INFO struct fields. PiperOrigin-RevId: 354595623 --- test/syscalls/linux/socket_ip_tcp_generic.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/syscalls') diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index a73987a7e..2c8e5f6f3 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -65,6 +65,9 @@ TEST_P(TCPSocketPairTest, ZeroTcpInfoSucceeds) { SyscallSucceeds()); } +// Copied from include/net/tcp.h. +constexpr int TCP_CA_OPEN = 0; + TEST_P(TCPSocketPairTest, CheckTcpInfoFields) { auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); @@ -87,7 +90,7 @@ TEST_P(TCPSocketPairTest, CheckTcpInfoFields) { SyscallSucceeds()); // Validates the received tcp_info fields. - EXPECT_EQ(opt.tcpi_ca_state, 0); + EXPECT_EQ(opt.tcpi_ca_state, TCP_CA_OPEN); EXPECT_GT(opt.tcpi_snd_cwnd, 0); EXPECT_GT(opt.tcpi_rto, 0); } -- cgit v1.2.3