From: =?utf-8?b?IlNaIExpbiAo5p6X5LiK5pm6KSI=?= Date: Mon, 3 Feb 2025 00:24:12 +0800 Subject: Fix: resolve FTBFS due to unit-tests.sh failure The unit-tests.sh script fails in the last check due to an issue with the server connection. The expected return code should be ENETUNREACH (101) instead of ETIMEDOUT (110), which aligns with network failure handling. --- tests/unit-test-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit-test-client.c b/tests/unit-test-client.c index a1813b1..dae70e3 100644 --- a/tests/unit-test-client.c +++ b/tests/unit-test-client.c @@ -726,7 +726,7 @@ int main(int argc, char *argv[]) modbus_set_response_timeout(invalid_ctx, 0, 1); rc = modbus_connect(invalid_ctx); printf("8/8 Connection timeout: "); - ASSERT_TRUE(rc == -1 && errno == ETIMEDOUT, ""); + ASSERT_TRUE(rc == -1 && (errno == ETIMEDOUT || errno == ENETUNREACH), ""); modbus_free(invalid_ctx); /* Restore original response timeout */