Commit 6c1ef13d20db2bc778e9167f0b36fb0fc7285a8c

Authored by Andrey Skvortsov
Committed by Stéphane Raimbault
1 parent 9db133d2

Added ILLEGAL_DATA_ADDRESS tests for modbus_write_register[|s]

Showing 1 changed file with 6 additions and 1 deletions
tests/unit-test-client.c
... ... @@ -346,7 +346,12 @@ int main(int argc, char *argv[])
346 346 printf("* modbus_write_coils: ");
347 347 ASSERT_TRUE(rc == -1 && errno == EMBXILADD, "");
348 348  
349   - rc = modbus_read_registers(ctx, UT_REGISTERS_ADDRESS + UT_REGISTERS_NB,
  349 + rc = modbus_write_register(ctx, UT_REGISTERS_ADDRESS + UT_REGISTERS_NB,
  350 + tab_rp_registers[0]);
  351 + printf("* modbus_write_register: ");
  352 + ASSERT_TRUE(rc == -1 && errno == EMBXILADD, "");
  353 +
  354 + rc = modbus_write_registers(ctx, UT_REGISTERS_ADDRESS + UT_REGISTERS_NB,
350 355 UT_REGISTERS_NB, tab_rp_registers);
351 356 printf("* modbus_write_registers: ");
352 357 ASSERT_TRUE(rc == -1 && errno == EMBXILADD, "");
... ...