Skip to content

Commit 064d497

Browse files
committed
tests/unit-test-client.c: flush before "4/5 modbus_write_and_read_registers" so the buffer does not contaminate the result on some systems
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 1d83f11 commit 064d497

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/unit-test-client.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ int main(int argc, char *argv[])
297297
: UT_INPUT_REGISTERS_NB;
298298
memset(tab_rp_registers, 0, nb_points * sizeof(uint16_t));
299299

300+
/* Wait remaining bytes before flushing */
301+
usleep(1000000);
302+
modbus_flush(ctx);
303+
300304
TEST_TITLE("4/5 modbus_write_and_read_registers");
301305
/* Write registers to zero from tab_rp_registers and store read registers
302306
into tab_rp_registers. So the read registers must set to 0, except the

0 commit comments

Comments
 (0)