Commit 688ec1f599c984298dd51a42a6ff0209463d1f99

Authored by Stéphane Raimbault
1 parent 2b83af9e

Better use \n in printf in unit-test-master.c

Showing 1 changed file with 16 additions and 17 deletions
tests/unit-test-master.c
... ... @@ -202,7 +202,7 @@ int main(void)
202 202 }
203 203  
204 204 /** ILLEGAL DATA ADDRESS */
205   - printf("\nTest illegal data address:");
  205 + printf("\nTest illegal data address:\n");
206 206  
207 207 /* The mapping begins at 0 and end at adresse + nb_points so
208 208 * the adresses above are not valid. */
... ... @@ -211,41 +211,41 @@ int main(void)
211 211 UT_COIL_STATUS_NB_POINTS + 1, tab_rp_status);
212 212 printf("* coil status: ");
213 213 if (ret == ILLEGAL_DATA_ADDRESS)
214   - printf("OK");
  214 + printf("OK\n");
215 215 else
216   - printf("FAILED");
  216 + printf("FAILED\n");
217 217  
218 218 ret = read_input_status(&mb_param, SLAVE, UT_INPUT_STATUS_ADDRESS,
219 219 UT_INPUT_STATUS_NB_POINTS + 1, tab_rp_status);
220 220 printf("* input status: ");
221 221 if (ret == ILLEGAL_DATA_ADDRESS)
222   - printf("OK");
  222 + printf("OK\n");
223 223 else
224   - printf("FAILED");
  224 + printf("FAILED\n");
225 225  
226 226 ret = read_holding_registers(&mb_param, SLAVE, UT_HOLDING_REGISTERS_ADDRESS,
227 227 UT_HOLDING_REGISTERS_NB_POINTS + 1, tab_rp_registers);
228 228 printf("* holding registers: ");
229 229 if (ret == ILLEGAL_DATA_ADDRESS)
230   - printf("OK");
  230 + printf("OK\n");
231 231 else
232   - printf("FAILED");
  232 + printf("FAILED\n");
233 233  
234 234 ret = read_input_registers(&mb_param, SLAVE, UT_INPUT_REGISTERS_ADDRESS,
235 235 UT_INPUT_REGISTERS_NB_POINTS + 1, tab_rp_registers);
236 236 printf("* input registers: ");
237 237 if (ret == ILLEGAL_DATA_ADDRESS)
238   - printf("OK");
  238 + printf("OK\n");
239 239 else
240   - printf("FAILED");
  240 + printf("FAILED\n");
241 241  
242 242 ret = force_single_coil(&mb_param, SLAVE,
243 243 UT_COIL_STATUS_ADDRESS + UT_COIL_STATUS_NB_POINTS, ON);
244 244 printf("* force single coil: ");
245 245 if (ret == ILLEGAL_DATA_ADDRESS) {
246   - printf("OK");
  246 + printf("OK\n");
247 247 } else {
248   - printf("FAILED");
  248 + printf("FAILED\n");
249 249 }
250 250  
251 251 ret = force_multiple_coils(&mb_param, SLAVE,
... ... @@ -253,9 +253,9 @@ int main(void)
253 253 UT_COIL_STATUS_NB_POINTS, tab_rp_status);
254 254 printf("* force multipls coils: ");
255 255 if (ret == ILLEGAL_DATA_ADDRESS) {
256   - printf("OK");
  256 + printf("OK\n");
257 257 } else {
258   - printf("FAILED");
  258 + printf("FAILED\n");
259 259 }
260 260  
261 261 ret = preset_multiple_registers(&mb_param, SLAVE,
... ... @@ -263,12 +263,11 @@ int main(void)
263 263 UT_HOLDING_REGISTERS_NB_POINTS, tab_rp_registers);
264 264 printf("* preset multiple registers: ");
265 265 if (ret == ILLEGAL_DATA_ADDRESS) {
266   - printf("OK");
  266 + printf("OK\n");
267 267 } else {
268   - printf("FAILED");
  268 + printf("FAILED\n");
269 269 }
270   -
271   - printf("\n");
  270 +
272 271 close:
273 272 /* Free the memory */
274 273 free(tab_rp_status);
... ...