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

[Greentea] Fix test code mbed-os-tests-mbed_hal-flash #3968

Merged
merged 1 commit into from Mar 23, 2017

Conversation

Projects
None yet
5 participants
@ccli8
Contributor

ccli8 commented Mar 20, 2017

This PR fixes the test code mbed-os-tests-mbed_hal-flash.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 20, 2017

This PR fixes the test code mbed-os-tests-mbed_hal-flash.

Thanks for the fix. how does this fixes it ? Does it fail ? With this patch it passes ?

It would be helpful to provide test results (prior and after this change). We can reproduce this locally and compare our results.

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Mar 20, 2017

@0xc0170 The issue is not met on K64F, but on my NUMAKER_PFM_NUC472 on which flash support is being added. In original mbed-os-tests-mbed_hal-flash > main.cpp > erase_range:

static void erase_range(flash_t *flash, uint32_t addr, uint32_t size)
{
    while (size > 0) {
        uint32_t sector_size = flash_get_sector_size(flash, addr);
        TEST_ASSERT_NOT_EQUAL(0, sector_size);
        int32_t ret = flash_erase_sector(flash, addr);
        TEST_ASSERT_EQUAL_INT32(0, ret);
        size = size > sector_size ? size - sector_size : 0;
    }
}

In the while loop, addr should be advanced with each iteration. On K64F, the passed in size is 0x1000 which equals its sector size, so there is only one iteration in the loop and the bug is not met. On my NUMAKER_PFM_NUC472 case, the passed in size is 0x2000 which is 4 times its sector size 0x800. There are 4 iterations in the while loop but addr is not updated.

@sg-

This comment has been minimized.

Member

sg- commented Mar 22, 2017

/morph test-nightly

@sg- sg- added needs: CI and removed needs: review labels Mar 22, 2017

@mbed-bot

This comment has been minimized.

mbed-bot commented Mar 23, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1716

All builds and test passed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 23, 2017

@adbridge adbridge merged commit 2bf9791 into ARMmbed:master Mar 23, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test-nightly Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ccli8 ccli8 deleted the OpenNuvoton:nuvoton_ccli8 branch Mar 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment