Commit f09a7471b08117a7d53f2e7866589cfc5702e79f

Authored by Stéphane Raimbault
1 parent 618f06ba

Enhance the output of the bad response test.

Showing 1 changed file with 5 additions and 4 deletions
tests/unit-test-master.c
@@ -254,7 +254,7 @@ int main(void) @@ -254,7 +254,7 @@ int main(void)
254 printf("OK\n"); 254 printf("OK\n");
255 255
256 256
257 - /** ILLEGAL DATA ADDRESS */ 257 + /** ILLEGAL DATA ADDRESS **/
258 printf("\nTEST ILLEGAL DATA ADDRESS:\n"); 258 printf("\nTEST ILLEGAL DATA ADDRESS:\n");
259 259
260 /* The mapping begins at 0 and ending at address + nb_points so 260 /* The mapping begins at 0 and ending at address + nb_points so
@@ -333,7 +333,7 @@ int main(void) @@ -333,7 +333,7 @@ int main(void)
333 } 333 }
334 334
335 335
336 - /** TOO MANY DATA */ 336 + /** TOO MANY DATA **/
337 printf("\nTEST TOO MANY DATA ERROR:\n"); 337 printf("\nTEST TOO MANY DATA ERROR:\n");
338 338
339 ret = read_coil_status(&mb_param, SLAVE, 339 ret = read_coil_status(&mb_param, SLAVE,
@@ -398,16 +398,17 @@ int main(void) @@ -398,16 +398,17 @@ int main(void)
398 printf("FAILED\n"); 398 printf("FAILED\n");
399 } 399 }
400 400
401 - /* BAD RESPONSE */ 401 + /** BAD RESPONSE **/
  402 + printf("\nTEST BAD RESPONSE ERROR:\n");
402 403
403 /* Allocate only the required space */ 404 /* Allocate only the required space */
404 uint16_t *tab_rp_registers_bad = (uint16_t *) malloc( 405 uint16_t *tab_rp_registers_bad = (uint16_t *) malloc(
405 UT_HOLDING_REGISTERS_NB_POINTS_SPECIAL * sizeof(uint16_t)); 406 UT_HOLDING_REGISTERS_NB_POINTS_SPECIAL * sizeof(uint16_t));
406 - printf("1/1 read_holding_registers: ");  
407 ret = read_holding_registers(&mb_param, 407 ret = read_holding_registers(&mb_param,
408 SLAVE, UT_HOLDING_REGISTERS_ADDRESS, 408 SLAVE, UT_HOLDING_REGISTERS_ADDRESS,
409 UT_HOLDING_REGISTERS_NB_POINTS_SPECIAL, 409 UT_HOLDING_REGISTERS_NB_POINTS_SPECIAL,
410 tab_rp_registers_bad); 410 tab_rp_registers_bad);
  411 + printf("* read_holding_registers: ");
411 if (ret > 0) { 412 if (ret > 0) {
412 /* Error not detected */ 413 /* Error not detected */
413 printf("FAILED\n"); 414 printf("FAILED\n");