test: fix some unreachable code warnings (#3851)

This commit is contained in:
Santiago Gimeno 2022-12-10 19:36:46 +01:00 committed by GitHub
parent 75d9411e80
commit abf77a9eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 21 deletions

View File

@ -85,10 +85,6 @@ int main(int argc, char **argv) {
fflush(stderr); fflush(stderr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#ifndef __SUNPRO_C
return EXIT_SUCCESS;
#endif
} }

View File

@ -55,6 +55,11 @@ static void write_cb(uv_write_t* req, int status) {
* Related issue: https://github.com/joyent/libuv/issues/443 * Related issue: https://github.com/joyent/libuv/issues/443
*/ */
TEST_IMPL(tcp_connect_error_after_write) { TEST_IMPL(tcp_connect_error_after_write) {
#ifdef _WIN32
RETURN_SKIP("This test is disabled on Windows for now. "
"See https://github.com/joyent/libuv/issues/444\n");
#else
uv_connect_t connect_req; uv_connect_t connect_req;
struct sockaddr_in addr; struct sockaddr_in addr;
uv_write_t write_req; uv_write_t write_req;
@ -62,12 +67,6 @@ TEST_IMPL(tcp_connect_error_after_write) {
uv_buf_t buf; uv_buf_t buf;
int r; int r;
#ifdef _WIN32
fprintf(stderr, "This test is disabled on Windows for now.\n");
fprintf(stderr, "See https://github.com/joyent/libuv/issues/444\n");
return 0; /* windows slackers... */
#endif
ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
buf = uv_buf_init("TEST", 4); buf = uv_buf_init("TEST", 4);
@ -95,4 +94,5 @@ TEST_IMPL(tcp_connect_error_after_write) {
MAKE_VALGRIND_HAPPY(); MAKE_VALGRIND_HAPPY();
return 0; return 0;
#endif
} }

View File

@ -114,7 +114,7 @@ static void start_server(void) {
TEST_IMPL(tcp_write_in_a_row) { TEST_IMPL(tcp_write_in_a_row) {
#if defined(_WIN32) #if defined(_WIN32)
RETURN_SKIP("tcp_write_in_a_row does not work on Windows"); RETURN_SKIP("tcp_write_in_a_row does not work on Windows");
#endif #else
uv_connect_t connect_req; uv_connect_t connect_req;
struct sockaddr_in addr; struct sockaddr_in addr;
@ -138,4 +138,5 @@ TEST_IMPL(tcp_write_in_a_row) {
MAKE_VALGRIND_HAPPY(); MAKE_VALGRIND_HAPPY();
return 0; return 0;
#endif
} }

View File

@ -1043,6 +1043,11 @@ TEST_IMPL(tty_set_cursor_shape) {
TEST_IMPL(tty_set_style) { TEST_IMPL(tty_set_style) {
#if _MSC_VER >= 1920 && _MSC_VER <= 1929
RETURN_SKIP("Broken on Microsoft Visual Studio 2019, to be investigated. "
"See: https://github.com/libuv/libuv/issues/3304");
#else
uv_tty_t tty_out; uv_tty_t tty_out;
uv_loop_t* loop; uv_loop_t* loop;
COORD cursor_pos; COORD cursor_pos;
@ -1070,11 +1075,6 @@ TEST_IMPL(tty_set_style) {
WORD attr; WORD attr;
int i, length; int i, length;
#if _MSC_VER >= 1920 && _MSC_VER <= 1929
RETURN_SKIP("Broken on Microsoft Visual Studio 2019, to be investigated. "
"See: https://github.com/libuv/libuv/issues/3304");
#endif
loop = uv_default_loop(); loop = uv_default_loop();
initialize_tty(&tty_out); initialize_tty(&tty_out);
@ -1239,6 +1239,7 @@ TEST_IMPL(tty_set_style) {
MAKE_VALGRIND_HAPPY(); MAKE_VALGRIND_HAPPY();
return 0; return 0;
#endif
} }
@ -1345,6 +1346,10 @@ TEST_IMPL(tty_full_reset) {
TEST_IMPL(tty_escape_sequence_processing) { TEST_IMPL(tty_escape_sequence_processing) {
#if _MSC_VER >= 1920 && _MSC_VER <= 1929
RETURN_SKIP("Broken on Microsoft Visual Studio 2019, to be investigated. "
"See: https://github.com/libuv/libuv/issues/3304");
#else
uv_tty_t tty_out; uv_tty_t tty_out;
uv_loop_t* loop; uv_loop_t* loop;
COORD cursor_pos, cursor_pos_old; COORD cursor_pos, cursor_pos_old;
@ -1353,11 +1358,6 @@ TEST_IMPL(tty_escape_sequence_processing) {
struct captured_screen actual = {0}, expect = {0}; struct captured_screen actual = {0}, expect = {0};
int dir; int dir;
#if _MSC_VER >= 1920 && _MSC_VER <= 1929
RETURN_SKIP("Broken on Microsoft Visual Studio 2019, to be investigated. "
"See: https://github.com/libuv/libuv/issues/3304");
#endif
loop = uv_default_loop(); loop = uv_default_loop();
initialize_tty(&tty_out); initialize_tty(&tty_out);
@ -1622,6 +1622,7 @@ TEST_IMPL(tty_escape_sequence_processing) {
MAKE_VALGRIND_HAPPY(); MAKE_VALGRIND_HAPPY();
return 0; return 0;
#endif
} }
#else #else