A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/e0aaa44331d7396369531bc65e1b12d70888a480 below:

[tests] Minor improvement of the TestSocketOptions · Haivision/srt@e0aaa44 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+7

-6

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+7

-6

lines changed Original file line number Diff line number Diff line change

@@ -110,8 +110,6 @@ class TestSocketOptions

110 110

}

111 111 112 112

protected:

113 -

// put in any custom data members that you need

114 - 115 113

sockaddr_in m_sa;

116 114

SRTSOCKET m_caller_sock = SRT_INVALID_SOCK;

117 115

SRTSOCKET m_listen_sock = SRT_INVALID_SOCK;

@@ -982,6 +980,8 @@ TEST_F(TestSocketOptions, StreamIDFull)

982 980

ASSERT_NE(srt_close(accepted_sock), SRT_ERROR);

983 981

}

984 982 983 +

// Check that StreamID assigned to a listener socket is not inherited by accepted sockets,

984 +

// and is not derived by a caller socket.

985 985

TEST_F(TestSocketOptions, StreamIDLenListener)

986 986

{

987 987

string stream_id_13 = "something1234";

@@ -991,18 +991,19 @@ TEST_F(TestSocketOptions, StreamIDLenListener)

991 991

char buffer[648];

992 992

int buffer_len = sizeof buffer;

993 993

EXPECT_EQ(srt_getsockopt(m_listen_sock, 0, SRTO_STREAMID, &buffer, &buffer_len), SRT_SUCCESS);

994 +

EXPECT_EQ(string(buffer), stream_id_13);

995 +

EXPECT_EQ(size_t(buffer_len), stream_id_13.size());

994 996 995 997

StartListener();

996 998

const SRTSOCKET accepted_sock = EstablishConnection();

997 999 998 -

// Check accepted socket inherits values

1000 +

// Check accepted and caller sockets do not inherit StreamID.

999 1001

for (SRTSOCKET sock : { m_caller_sock, accepted_sock })

1000 1002

{

1001 -

for (size_t i = 0; i < sizeof buffer; ++i)

1002 -

buffer[i] = 'a';

1003 1003

buffer_len = (int)(sizeof buffer);

1004 +

fill_n(buffer, buffer_len, 'a');

1004 1005

EXPECT_EQ(srt_getsockopt(sock, 0, SRTO_STREAMID, &buffer, &buffer_len), SRT_SUCCESS);

1005 -

EXPECT_EQ(buffer_len, 0) << (sock == accepted_sock ? "ACCEPTED" : "LISTENER");

1006 +

EXPECT_EQ(buffer_len, 0) << (sock == accepted_sock ? "ACCEPTED" : "CALLER");

1006 1007

}

1007 1008 1008 1009

ASSERT_NE(srt_close(accepted_sock), SRT_ERROR);

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4