Browse Source

Fix incorrect number of points in unit-test-master.c

Stéphane Raimbault 17 years ago
parent
commit
62654acc0b
1 changed files with 6 additions and 4 deletions
  1. 6 4
      tests/unit-test-master.c

+ 6 - 4
tests/unit-test-master.c

@@ -250,8 +250,9 @@ int main(void)
                 printf("FAILED");
                 printf("FAILED");
         }
         }
 
 
-        ret = force_multiple_coils(&mb_param, SLAVE, UT_COIL_STATUS_ADDRESS,
-                                   UT_COIL_STATUS_NB_POINTS + 1, tab_rp_status);
+        ret = force_multiple_coils(&mb_param, SLAVE,
+                                   UT_COIL_STATUS_ADDRESS + UT_COIL_STATUS_NB_POINTS,
+                                   UT_COIL_STATUS_NB_POINTS, tab_rp_status);
         printf("* force multipls coils: ");
         printf("* force multipls coils: ");
         if (ret == ILLEGAL_DATA_ADDRESS) {
         if (ret == ILLEGAL_DATA_ADDRESS) {
                 printf("OK");
                 printf("OK");
@@ -259,8 +260,9 @@ int main(void)
                 printf("FAILED");
                 printf("FAILED");
         }
         }
 
 
-        ret = preset_multiple_registers(&mb_param, SLAVE, UT_HOLDING_REGISTERS_ADDRESS,
-                                        UT_HOLDING_REGISTERS_NB_POINTS + 1, tab_rp_registers);
+        ret = preset_multiple_registers(&mb_param, SLAVE,
+                                        UT_HOLDING_REGISTERS_ADDRESS + UT_HOLDING_REGISTERS_NB_POINTS,
+                                        UT_HOLDING_REGISTERS_NB_POINTS, tab_rp_registers);
         printf("* preset multiple registers: ");
         printf("* preset multiple registers: ");
         if (ret == ILLEGAL_DATA_ADDRESS) {
         if (ret == ILLEGAL_DATA_ADDRESS) {
                 printf("OK");
                 printf("OK");