Commit bb23b4abfaa50620255c882158d44160c0758ab3
1 parent
b4330d21
Remove set but unused req_lenth and address in unit tests
Showing
1 changed file
with
2 additions
and
7 deletions
tests/unit-test-client.c
| ... | ... | @@ -38,7 +38,6 @@ int main(int argc, char *argv[]) |
| 38 | 38 | modbus_t *ctx; |
| 39 | 39 | int i; |
| 40 | 40 | uint8_t value; |
| 41 | - int address; | |
| 42 | 41 | int nb_points; |
| 43 | 42 | int rc; |
| 44 | 43 | float real; |
| ... | ... | @@ -151,7 +150,6 @@ int main(int argc, char *argv[]) |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | 152 | i = 0; |
| 154 | - address = UT_BITS_ADDRESS; | |
| 155 | 153 | nb_points = UT_BITS_NB; |
| 156 | 154 | while (nb_points > 0) { |
| 157 | 155 | int nb_bits = (nb_points > 8) ? 8 : nb_points; |
| ... | ... | @@ -179,7 +177,6 @@ int main(int argc, char *argv[]) |
| 179 | 177 | } |
| 180 | 178 | |
| 181 | 179 | i = 0; |
| 182 | - address = UT_INPUT_BITS_ADDRESS; | |
| 183 | 180 | nb_points = UT_INPUT_BITS_NB; |
| 184 | 181 | while (nb_points > 0) { |
| 185 | 182 | int nb_bits = (nb_points > 8) ? 8 : nb_points; |
| ... | ... | @@ -492,7 +489,6 @@ int main(int argc, char *argv[]) |
| 492 | 489 | if (use_backend == RTU) { |
| 493 | 490 | const int RAW_REQ_LENGTH = 6; |
| 494 | 491 | uint8_t raw_req[] = { INVALID_SERVER_ID, 0x03, 0x00, 0x01, 0xFF, 0xFF }; |
| 495 | - int req_length; | |
| 496 | 492 | uint8_t rsp[MODBUS_TCP_MAX_ADU_LENGTH]; |
| 497 | 493 | |
| 498 | 494 | /* No response in RTU mode */ |
| ... | ... | @@ -506,9 +502,8 @@ int main(int argc, char *argv[]) |
| 506 | 502 | } |
| 507 | 503 | |
| 508 | 504 | /* Send an invalid query with a wrong slave ID */ |
| 509 | - req_length = modbus_send_raw_request( | |
| 510 | - ctx, raw_req, | |
| 511 | - RAW_REQ_LENGTH * sizeof(uint8_t)); | |
| 505 | + modbus_send_raw_request(ctx, raw_req, | |
| 506 | + RAW_REQ_LENGTH * sizeof(uint8_t)); | |
| 512 | 507 | rc = modbus_receive_confirmation(ctx, rsp); |
| 513 | 508 | |
| 514 | 509 | printf("1/4-B No response from slave %d with invalid request: ", | ... | ... |