Skip to content

Commit 1914d00

Browse files
committed
tests/unit-test-client.c: apply "33ms > 20ms" test also to FreeBSD and OpenBSD
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 2526df3 commit 1914d00

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/unit-test-client.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,15 @@ int main(int argc, char *argv[])
739739
usleep(1000000);
740740
modbus_flush(ctx);
741741

742-
#ifdef _WIN32
743-
/* Timeout of 20ms between bytes, allow for 2*16+1
744-
* Windows sleep seems to be at least 15ms always
745-
*/
742+
#if defined(_WIN32) || defined(__FreeBSD__) || defined(__OpenBSD__)
743+
/* Timeout of 20ms between bytes, allow for 2*16+1
744+
* Windows sleep seems to be at least 15ms always
745+
* Windows sleep seems to be at least 15ms always.
746+
* For some reason, FreeBSD 12 and OpenBSD 6.5 also
747+
* tended to fail with 7ms variant as "gmake check"
748+
* but pass in
749+
* gmake -j 8 && ( ./tests/unit-test-server|cat & sleep 1 ; ./tests/unit-test-client|cat )
750+
*/
746751
TEST_TITLE("2/2 Adapted byte timeout (33ms > 20ms)");
747752
modbus_set_byte_timeout(ctx, 0, 33000);
748753
rc = modbus_read_registers(

0 commit comments

Comments
 (0)