Browse Source

tests: fix misc cppcheck warnings

master
Kaspar Schleiser 6 years ago committed by Oleg Hahm
parent
commit
908429eb33
  1. 2
      tests/driver_hdc1000/main.c
  2. 2
      tests/driver_pn532/main.c
  3. 2
      tests/leds/main.c
  4. 2
      tests/periph_hwrng/main.c
  5. 2
      tests/pthread_cleanup/main.c
  6. 2
      tests/unittests/tests-crypto/tests-crypto.h

2
tests/driver_hdc1000/main.c

@ -33,7 +33,6 @@ int main(void)
{
hdc1000_t dev;
int16_t temp, hum;
size_t len;
char tstr[8];
char hstr[8];
@ -49,6 +48,7 @@ int main(void)
}
while (1) {
size_t len;
hdc1000_read(&dev, &temp, &hum);
len = fmt_s16_dfp(tstr, temp, 2);

2
tests/driver_pn532/main.c

@ -50,6 +50,8 @@ int main(void)
ret = pn532_init_i2c(&pn532, &pn532_conf[0]);
#elif defined(PN532_SUPPORT_SPI)
ret = pn532_init_spi(&pn532, &pn532_conf[0]);
#else
#error None of PN532_SUPPORT_I2C and PN532_SUPPORT_SPI set!
#endif
if (ret != 0) {

2
tests/leds/main.c

@ -77,6 +77,8 @@ int main(void)
#endif
puts("On-board LED test\n");
/* cppcheck-suppress knownConditionTrueFalse
* rationale: board-dependent ifdefs */
if (numof == 0) {
puts("NO LEDs AVAILABLE");
}

2
tests/periph_hwrng/main.c

@ -31,7 +31,7 @@ int main(void)
uint8_t buf[LIMIT];
puts("\nHWRNG peripheral driver test\n");
printf("This test will print from 1 to %i random bytes about every "
printf("This test will print from 1 to %u random bytes about every "
"second\n\n", LIMIT);
puts("Initializing the HWRNG driver.\n");

2
tests/pthread_cleanup/main.c

@ -68,7 +68,7 @@ int main(void) {
void *res;
pthread_join(th_id, (void **) &res);
printf("Result: %u\n", (int) (intptr_t) res);
printf("Result: %i\n", (int) (intptr_t) res);
puts("Done.");
return 0;
}

2
tests/unittests/tests-crypto/tests-crypto.h

@ -40,7 +40,7 @@ void tests_crypto(void);
*/
Test *tests_crypto_chacha_tests(void);
static inline int compare(uint8_t a[16], uint8_t b[16], uint8_t len)
static inline int compare(uint8_t *a, uint8_t *b, uint8_t len)
{
int result = 1;

Loading…
Cancel
Save