Test for region list sanity (sizes all >= 0)

pull/6017/head
Jimmy Brisson 2018-02-05 13:58:37 -06:00
parent 964e6e74fb
commit c52d1edd3e
1 changed files with 22 additions and 0 deletions

View File

@ -174,3 +174,25 @@ def test_init_override_app_config(target):
mock_json_file_to_dict.assert_any_call(app_config)
assert config.app_config_data == mock_return
@pytest.mark.parametrize("target", ["K64F", "UBLOX_EVK_ODIN_W2"])
@pytest.mark.parametrize("overrides", [
{},
{"restrict_size": "0x200"},
{"mbed_app_start": "0x200"}
])
def test_basic_regions(target, overrides):
"""
Test that the region lists are sane with various configurations
"""
set_targets_json_location()
config = Config(target)
for o, v in overrides.items():
setattr(config.target, o, v)
try:
if config.has_regions:
regions = list(config.regions)
for r in regions:
assert r.size >= 0
except ConfigException:
pass