From d52c7167bc481f4daed4992dbac2ec8477e0ebef Mon Sep 17 00:00:00 2001 From: fabian18 Date: Wed, 6 May 2020 18:07:24 +0200 Subject: [PATCH] Revert "tests/driver_at25xxx: adapt to change in driver API" This reverts commit 6ca7ac949a8768b2c5307f77bdcb581679b059cd. --- tests/driver_at25xxx/main.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/tests/driver_at25xxx/main.c b/tests/driver_at25xxx/main.c index a148edff92..b4f1ebeff0 100644 --- a/tests/driver_at25xxx/main.c +++ b/tests/driver_at25xxx/main.c @@ -34,12 +34,12 @@ static void test_normal_write(void) const char data_in_b[] = "This is a test."; char data_out[32]; - TEST_ASSERT_EQUAL_INT(sizeof(data_in_a), at25xxx_write(&dev, 0, data_in_a, sizeof(data_in_a))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), at25xxx_read(&dev, 0, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_write(&dev, 0, data_in_a, sizeof(data_in_a))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, 0, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_STRING(data_in_a, data_out); - TEST_ASSERT_EQUAL_INT(sizeof(data_in_b), at25xxx_write(&dev, 0, data_in_b, sizeof(data_in_b))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), at25xxx_read(&dev, 0, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_write(&dev, 0, data_in_b, sizeof(data_in_b))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, 0, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_STRING(data_in_b, data_out); } @@ -49,16 +49,12 @@ static void test_page_write(void) const char data_in_b[] = "This is a test."; char data_out[32]; - TEST_ASSERT_EQUAL_INT(sizeof(data_in_a), - at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_a, sizeof(data_in_a))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), - at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_a, sizeof(data_in_a))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_STRING(data_in_a, data_out); - TEST_ASSERT_EQUAL_INT(sizeof(data_in_b), - at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_b, sizeof(data_in_b))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), - at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_b, sizeof(data_in_b))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_STRING(data_in_b, data_out); } @@ -70,15 +66,12 @@ static void test_page_clear(void) memset(data_clr, 0, sizeof(data_clr)); - TEST_ASSERT_EQUAL_INT(sizeof(data_in_a), - at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_a, sizeof(data_in_a))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), - at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_write(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_in_a, sizeof(data_in_a))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_STRING(data_in_a, data_out); TEST_ASSERT_EQUAL_INT(0, at25xxx_clear(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, sizeof(data_out))); - TEST_ASSERT_EQUAL_INT(sizeof(data_out), - at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); + TEST_ASSERT_EQUAL_INT(0, at25xxx_read(&dev, AT25XXX_PARAM_PAGE_SIZE - 5, data_out, sizeof(data_out))); TEST_ASSERT_EQUAL_INT(0, memcmp(data_out, data_clr, sizeof(data_clr))); }