Skip to content

FLASHIAP test: skip test if test region overlaps code #9257

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

Merged
merged 1 commit into from
Jan 18, 2019
Merged
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
5 changes: 5 additions & 0 deletions TESTS/mbed_drivers/flashiap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void flashiap_cross_sector_program_test()
agg_size += sector_size;
address -= sector_size;
}
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address, agg_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
Expand Down Expand Up @@ -184,6 +185,7 @@ void flashiap_program_error_test()
TEST_ASSERT_TRUE(address != 0UL);

// unaligned address
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address + 1, sector_size);
TEST_ASSERT_EQUAL_INT32(-1, ret);
Expand Down Expand Up @@ -220,6 +222,9 @@ void flashiap_timing_test()
utest_printf("\nFlash timing:\n");
uint32_t sector_size = flash_device.get_sector_size(end_address - 1UL);
uint32_t base_address = end_address - sector_size;
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, base_address);
TEST_SKIP_UNLESS_MESSAGE(base_address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are also adding some debug prints , not only skip test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove them, but it's practical in case of test skip to understand.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to the commit message and PR title (does not cover adding debug msg). Otherwise looks fine to me


timer.start();
for (num_write_sizes = 0; num_write_sizes < max_write_sizes; num_write_sizes++) {
if (write_size > sector_size) {
Expand Down