mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-25 21:24:21 +08:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
37 lines
1.4 KiB
Python
37 lines
1.4 KiB
Python
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (c) 2015 Stephen Warren
|
|
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
import pytest
|
|
import u_boot_utils
|
|
|
|
@pytest.mark.buildconfigspec('cmd_memory')
|
|
def test_md(u_boot_console):
|
|
"""Test that md reads memory as expected, and that memory can be modified
|
|
using the mw command."""
|
|
|
|
ram_base = u_boot_utils.find_ram_base(u_boot_console)
|
|
addr = '%08x' % ram_base
|
|
val = 'a5f09876'
|
|
expected_response = addr + ': ' + val
|
|
u_boot_console.run_command('mw ' + addr + ' 0 10')
|
|
response = u_boot_console.run_command('md ' + addr + ' 10')
|
|
assert(not (expected_response in response))
|
|
u_boot_console.run_command('mw ' + addr + ' ' + val)
|
|
response = u_boot_console.run_command('md ' + addr + ' 10')
|
|
assert(expected_response in response)
|
|
|
|
@pytest.mark.buildconfigspec('cmd_memory')
|
|
def test_md_repeat(u_boot_console):
|
|
"""Test command repeat (via executing an empty command) operates correctly
|
|
for "md"; the command must repeat and dump an incrementing address."""
|
|
|
|
ram_base = u_boot_utils.find_ram_base(u_boot_console)
|
|
addr_base = '%08x' % ram_base
|
|
words = 0x10
|
|
addr_repeat = '%08x' % (ram_base + (words * 4))
|
|
u_boot_console.run_command('md %s %x' % (addr_base, words))
|
|
response = u_boot_console.run_command('')
|
|
expected_response = addr_repeat + ': '
|
|
assert(expected_response in response)
|