tests/periph_eeprom: remove useless casts
Casting to `const char *` is not necessary as input, the type are already the right ones. It could not be before as `result` was with the wrong type.
This commit is contained in:
parent
c029fcde11
commit
6d8fd279ac
@ -226,7 +226,7 @@ static int cmd_test(int argc, char **argv)
|
||||
|
||||
char result[4];
|
||||
ret = eeprom_read(0, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, (const char *)expected, 4) == 0);
|
||||
assert(strncmp(result, expected, 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
/* read/write at end of EEPROM */
|
||||
@ -234,7 +234,7 @@ static int cmd_test(int argc, char **argv)
|
||||
assert(ret == 4);
|
||||
memset(result, 0, 4);
|
||||
ret = eeprom_read(EEPROM_SIZE - 4, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, expected, 4) == 0);
|
||||
assert(strncmp(result, expected, 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
/* read/write single byte */
|
||||
@ -249,24 +249,24 @@ static int cmd_test(int argc, char **argv)
|
||||
eeprom_clear(0, 4);
|
||||
memset(result, 0, 4);
|
||||
ret = eeprom_read(0, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, "", 4) == 0);
|
||||
assert(strncmp(result, "", 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
eeprom_clear(EEPROM_SIZE - 4, 4);
|
||||
ret = eeprom_read(EEPROM_SIZE - 4, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, "", 4) == 0);
|
||||
assert(strncmp(result, "", 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
/* set some bytes */
|
||||
eeprom_set(0, 'A', 4);
|
||||
ret = eeprom_read(0, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, "AAAA", 4) == 0);
|
||||
assert(strncmp(result, "AAAA", 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
memset(result, 0, 4);
|
||||
eeprom_set(EEPROM_SIZE - 4, 'A', 4);
|
||||
ret = eeprom_read(EEPROM_SIZE - 4, (uint8_t *)result, 4);
|
||||
assert(strncmp((const char *)result, "AAAA", 4) == 0);
|
||||
assert(strncmp(result, "AAAA", 4) == 0);
|
||||
assert(ret == 4);
|
||||
|
||||
puts("SUCCESS");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user