diff options
author | Paul Selkirk <paul@psgd.org> | 2015-11-16 14:29:29 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-11-16 14:31:52 -0500 |
commit | eda8daef7822536a59642efc13bb5d0f6b0430ff (patch) | |
tree | e974c38dcf7270fa51e8384a4f1d4eefbe8b24d1 /tests | |
parent | 962116cb04e5fe551451c0df0b02085ae96ba4e3 (diff) |
remove dependency on csprng
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-bus.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test-bus.c b/tests/test-bus.c index be0eadb..d30f3fc 100644 --- a/tests/test-bus.c +++ b/tests/test-bus.c @@ -45,24 +45,19 @@ #define TEST_NUM_ROUNDS 2000000 /* - * Sanity test - are the cores present, and can we get a random number? + * Sanity test - can we read and write the dummy register? */ -static int sanity(const hal_core_t *board_core, const hal_core_t *csprng_core) +static int sanity(const hal_core_t *board_core) { - uint32_t rnd, data; + uint32_t rnd = 0xdeadbeef, data; hal_error_t err; - if (board_core == NULL || csprng_core == NULL) { + if (board_core == NULL) { printf("initialization failed (is the bitstream loaded?)\n"); return 1; } - if ((err = hal_get_random(csprng_core, (void *) &rnd, sizeof(rnd))) != HAL_OK) { - printf("reading CSPRNG: %s\n", hal_error_string(err)); - return 1; - } - if ((err = hal_io_write(board_core, 0xFF, (const uint8_t *) &rnd, sizeof(rnd))) != HAL_OK) { printf("writing dummy: %s\n", hal_error_string(err)); return 1; @@ -145,10 +140,9 @@ static int test_write(const hal_core_t *board_core) int main(void) { const hal_core_t *board_core = hal_core_find(NOVENA_BOARD_NAME, NULL); - const hal_core_t *csprng_core = hal_core_find(CSPRNG_NAME, NULL); int err = 0; - if (sanity(board_core, csprng_core) != 0) + if (sanity(board_core) != 0) return 1; time_check("read ", test_read(board_core)); |