test_src_input_stream random data triggering random failure
As experienced here https://code.videolan.org/fcartegnie/vlc/-/jobs/918078 Test randomly failing as the stream went, in that case, into infinite decompression error loop
FAIL: test_src_input_stream
===========================
[000055e0883a49a0] inflate stream error: unhandled decompression error (2)
[000055e0883a49a0] inflate stream error: unhandled decompression error (2)
[000055e0883a49a0] inflate stream error: unhandled decompression error (2)
[000055e0883a49a0] inflate stream error: unhandled decompression error (2)
[000055e0883a49a0] inflate stream error: unhandled decompression error (2)
Magic bytes being generated in:
#ifndef TEST_NET
static void
fill_rand( int i_fd, size_t i_size )
{
uint8_t p_buf[4096];
size_t i_written = 0;
while( i_written < i_size )
{
size_t i_tocopy = __MIN( i_size - i_written, 4096 );
vlc_rand_bytes(p_buf, i_tocopy);
ssize_t i_ret = write( i_fd, p_buf, i_tocopy );
assert( i_ret > 0 );
i_written += i_ret;
}
assert( i_written == i_size );
}
#endif