Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: storage: remove ifdef from ztest_test_suite #25058

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/subsys/storage/stream/stream_flash/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ static void test_stream_flash_buffered_write_callback(void)
zassert_equal(rc, -EFAULT, "expected failure from callback");
}

#ifdef CONFIG_STREAM_FLASH_ERASE
static void test_stream_flash_buffered_write_whole_page(void)
{
#ifdef CONFIG_STREAM_FLASH_ERASE
int rc;

init_target();
Expand All @@ -305,10 +305,12 @@ static void test_stream_flash_buffered_write_whole_page(void)

/* Second page should not be erased */
VERIFY_WRITTEN(page_size, page_size);
#endif
}

static void test_stream_flash_erase_page(void)
{
#ifdef CONFIG_STREAM_FLASH_ERASE
int rc;

init_target();
Expand All @@ -321,8 +323,8 @@ static void test_stream_flash_erase_page(void)
zassert_equal(rc, 0, "expected success");

VERIFY_ERASED(FLASH_BASE, page_size);
}
#endif
}

void test_main(void)
{
Expand All @@ -340,10 +342,8 @@ void test_main(void)
ztest_unit_test(test_stream_flash_buffered_write_multi_page),
ztest_unit_test(test_stream_flash_buf_size_greater_than_page_size),
ztest_unit_test(test_stream_flash_buffered_write_callback),
#ifdef CONFIG_STREAM_FLASH_ERASE
ztest_unit_test(test_stream_flash_buffered_write_whole_page),
ztest_unit_test(test_stream_flash_erase_page),
#endif
ztest_unit_test(test_stream_flash_bytes_written)
);

Expand Down