summaryrefslogtreecommitdiff
path: root/test/cmd/mbr.c
AgeCommit message (Collapse)Author
2025-02-11test: Drop suites.hSimon Glass
This file is empty now. Remove it and its uses. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running mbr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the _test suffix on linker listsSimon Glass
Most test suites have a _test suffix. This is not necessary as there is also a ut_ prefix. Drop the suffix so that (with future work) the suite name can be used as the linker-list name. Remove the suffix from the pytest regex as well, moving it to the top of the file, as it is a constant. Signed-off-by: Simon Glass <[email protected]>
2024-11-14test: use %zd for size_t in mbr_test_run()Heinrich Schuchardt
For printing size_t we must use %zd and not %ld to avoid a -Wformat error on 32-bit systems. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-11-14test: cmd/mbr: pass correct buffer size to init_write_buffersHeinrich Schuchardt
We want to completely initialize the mbr and embr buffers. This requires passing the buffer size and not the size of a pointer to the buffer. Addresses-Coverity-ID: 510454 Wrong sizeof argument Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-09-18test: mbr: Drop a duplicate testSimon Glass
The test currently runs twice as it is declared twice. Unwind this. Signed-off-by: Simon Glass <[email protected]>
2024-09-18test: mbr: Use RAM for the buffersSimon Glass
The normal approach with sandbox is to use a fixed memory address in the RAM, to avoid needing to create a map for transient local variables. Update this test to use this approach. Signed-off-by: Simon Glass <[email protected]>
2024-09-18test: mbr: Use a constant for the block sizeSimon Glass
It isn't that important to factor out constants in tests, but in this case we have 0x200 and 512 used. The commands don't use the constant as they use a block count ('1'). It doesn't create more code to use a constant, so create one. Signed-off-by: Simon Glass <[email protected]>
2024-09-18test: mbr: Unmap the buffers after useSimon Glass
This tests maps some local variables into sandbox's address space. Make sure to unmap them afterwards. Note that the normal approach with sandbox is to use a fixed memory address in the RAM, to avoid needing to create a map for transient local variables. Signed-off-by: Simon Glass <[email protected]> Fixes: 04291ee0aba ("cmd: mbr: Allow 4 MBR partitions without need...")
2024-09-18test: mbr: Adjust test to drop 0xSimon Glass
U-Boot commands typically don't need 0x to specify hex, since they use hex by default. Adding 0x in this test is confusing since it suggests that it is necessary. Drop it from the file. Also use the %#x construct to get the 0x when needed. Signed-off-by: Simon Glass <[email protected]>
2024-09-18test: mbr: Adjust test to use lower-case hexSimon Glass
Switch to lower-case hex which is more commonly used in U-Boot. Signed-off-by: Simon Glass <[email protected]>
2024-08-26test: Tidy up checking for console endSimon Glass
Use the ut_assert_console_end() function provided, rather than doing it separately. Signed-off-by: Simon Glass <[email protected]>
2024-08-26test: cmd: Drop unnecessary console_record_reset_enable()Simon Glass
It is seldom necessary to call this function. Drop its use in the command tests. Add a few extra checks to the wget test so that resetting is not needed. Signed-off-by: Simon Glass <[email protected]>
2024-08-26test: Rename UTF_CONSOLE_REC to UTF_CONSOLESimon Glass
The _REC suffix doesn't add much. Really what we want to know is whether the test uses the console, so rename this flag. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2024-08-26test: Drop the blank line before test macrosSimon Glass
Most tests don't have this. It helps to keep the test declaration clearly associated with the function it relates to, rather than the next one in the file. Remove the extra blank line and mention this in the docs. Signed-off-by: Simon Glass <[email protected]>
2024-08-26test: Rename unit-test flagsSimon Glass
The UT_TESTF_ macros read as 'unit test test flags' which is not right. Rename to UTF ('unit test flags'). This has the benefit of being shorter, which helps keep UNIT_TEST() declarations on a single line. Give the enum a name and reference it from the UNIT_TEST() macros while we are here. Signed-off-by: Simon Glass <[email protected]>
2024-03-02test: cmd: mbr: Fix Smatch static checker warningAlexander Gendin
This patch fixes Smatch static checker warning: test/cmd/mbr.c:243 mbr_test_run() warn: sizeof(NUMBER)? Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Alexander Gendin <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2023-11-10test: cmd: mbr: Remove unreachable codeAlexander Gendin
Fix an issue reported by Coverity scan, and fix code indentation. Addresses-Coverity-ID: 467404 ("Control flow issues (DEADCODE)") Signed-off-by: Alexander Gendin <[email protected]>
2023-10-24cmd: mbr: Allow 4 MBR partitions without need for extendedAlexander Gendin
Current code allows up to 3 MBR partitions without extended one. If more than 3 partitions are required, then extended partition(s) must be used. This commit allows up to 4 primary MBR partitions without the need for extended partition. Add mbr test unit. In order to run the test manually, mmc6.img file of size 12 MiB or greater is required in the same directory as u-boot. Test also runs automatically via ./test/py/test.py tool. Running mbr test is only supported in sandbox mode. Signed-off-by: Alex Gendin <[email protected]> [ And due to some further changes for testing ] Signed-off-by: Simon Glass <[email protected]>