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