Debian Codegraph @

debian/patches/Fix-resolve-FTBFS-due-to-unit-tests.sh-failure.patch

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