diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-bus.c | 3 | ||||
-rw-r--r-- | tests/test-mkmif.c | 10 | ||||
-rw-r--r-- | tests/test-trng.c | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/tests/test-bus.c b/tests/test-bus.c index b4a3e1c..94d7a70 100644 --- a/tests/test-bus.c +++ b/tests/test-bus.c @@ -68,7 +68,8 @@ static int sanity(const hal_core_t *board_core) } if (data != rnd) { - printf("Data bus fail: expected %08x, got %08x, diff %08x\n", rnd, data, data ^ rnd); + printf("Data bus fail: expected %08lx, got %08lx, diff %08lx\n", + (unsigned long) rnd, (unsigned long) data, (unsigned long) (data ^ rnd)); return 1; } diff --git a/tests/test-mkmif.c b/tests/test-mkmif.c index ab5801e..3645577 100644 --- a/tests/test-mkmif.c +++ b/tests/test-mkmif.c @@ -61,12 +61,12 @@ static hal_error_t write_test(hal_core_t *core) uint32_t write_address; int i; hal_error_t err; - + for (write_data = 0x01020304, write_address = 0, i = 0; i < 0x10; write_data += 0x01010101, write_address += 4, ++i) { - printf("Trying to write 0x%08x to memory address 0x%08x.\n", + printf("Trying to write 0x%08x to memory address 0x%08x.\n", (unsigned int)write_data, (unsigned int)write_address); if ((err = hal_mkmif_write_word(core, write_address, write_data)) != HAL_OK) { @@ -84,7 +84,7 @@ static hal_error_t read_test(hal_core_t *core) uint32_t read_address; int i; hal_error_t err; - + for (read_address = 0, i = 0; i < 0x10; read_address += 4, ++i) { @@ -115,7 +115,7 @@ static hal_error_t write_read_test(hal_core_t *core) printf("write error: %s\n", hal_error_string(err)); return err; } - + if ((err = hal_mkmif_read_word(core, 0x00000000, &readback)) != HAL_OK) { printf("read error: %s\n", hal_error_string(err)); return err; @@ -125,7 +125,7 @@ static hal_error_t write_read_test(hal_core_t *core) printf("read %08x, expected %08x\n", (unsigned int)readback, (unsigned int)data); return HAL_ERROR_IO_UNEXPECTED; } - + return HAL_OK; } diff --git a/tests/test-trng.c b/tests/test-trng.c index ebfe701..f570752 100644 --- a/tests/test-trng.c +++ b/tests/test-trng.c @@ -84,7 +84,7 @@ static hal_error_t test_random(const char *name) return err; } - printf("%08x ", rnd); + printf("%08lx ", (unsigned long) rnd); } printf("\n"); @@ -106,7 +106,7 @@ int main(void) } else { for (i = 0; i < 8; ++i) { - printf("%08x ", rnd[i]); + printf("%08lx ", (unsigned long) rnd[i]); } printf("\n"); } |