8000 unit-test-client: The test fails in environments where networking is not available · Issue #802 · stephane/libmodbus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 /div>

unit-test-client: The test fails in environments where networking is not available #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
artyom-poptsov opened this issue Mar 23, 2025 · 0 comments

Comments

@artyom-poptsov
Copy link

The change that was introduced in 6ae4a76 leads to test errors in environments where networking is not available (e.g. in GNU Guix build environment):

    // Invalid in TCP or RTU mode...
    modbus_t *invalid_ctx = modbus_new_tcp("1.2.3.4", 1502);
    modbus_set_response_timeout(ctx, 0, 1);
    rc = modbus_connect(invalid_ctx);
    printf("8/8 Connection timeout: ");
    ASSERT_TRUE(rc == -1 && errno == ETIMEDOUT, "");
    modbus_free(invalid_ctx);

Assertion fails due to errno being equal to 101 (ENETUNREACH) instead of 110 (ETIMEDOUT)

Currently I solved this problem by removing the code I mentioned above with a patch, but maybe we should add an option that disables such tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0