From 54625d6c72a2156ac075e14cf8cc51e84907aed7 Mon Sep 17 00:00:00 2001 From: "Vanya A. Sergeev" Date: Tue, 8 Oct 2019 22:37:37 -0500 Subject: [PATCH] tests/spi: add tostring check to interactive test --- tests/test_spi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_spi.c b/tests/test_spi.c index b40b066..9c1b540 100644 --- a/tests/test_spi.c +++ b/tests/test_spi.c @@ -123,6 +123,7 @@ bool getc_yes(void) { } void test_interactive(void) { + char str[256]; spi_t *spi; uint8_t buf[] = { 0x55, 0xaa, 0x0f, 0xf0 }; @@ -138,6 +139,12 @@ void test_interactive(void) { printf("Press enter to continue...\n"); getc(stdin); + /* Check tostring */ + passert(spi_tostring(spi, str, sizeof(str)) > 0); + printf("SPI description: %s\n", str); + printf("SPI description looks OK? y/n\n"); + passert(getc_yes()); + /* Mode 0 transfer */ printf("Press enter to start transfer..."); getc(stdin);