summaryrefslogtreecommitdiffstats
path: root/tests/layout.c
Commit message (Collapse)AuthorAgeFilesLines
* libflashrom: Add layout "exclude" APIBrian Norris2023-07-181-0/+5
| | | | | | | | | | | | | | Layouts can be expensive to derive (reading from flash), so we might want to reuse a layout for different purposes. Today, it's not possible to undo a flashrom_layout_include_region() operation (to, say, operate on a different region). Add such an API. Change-Id: I7ea3e0674f25e34bf2cfc8f464ae7ca1c1a3fbfd Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/76005 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
* tests: Add and include headers with function prototypesAnastasia Klimchuk2022-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Part 2 of fixing -Wmissing-prototypes warnings. This patch adds headers with function prototypes and includes the headers into source files. This fixes the warnings like this: warning: no previous prototype for ‘function_name’ [-Wmissing-prototypes] This patch is needed to sync compiler warning options between meson and makefile. TEST=running the following produces no warnings: meson setup --wipe (to clean build directory) ninja test Change-Id: Ia1ff22deb2354569f277649c6575ef2d5ffbb6e0 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63489 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* layout: Hoist get_region_range() into libflashrom APIEdward O'Callaghan2022-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | While using the libflashrom API to read specific regions there is no currently no general way to find the offset into the read buffer of the expected region. flashrom_layout_include_region() probably should have returned the region offset and size if it was included. However to avoid a change in API signature we can instead hoist up get_region_range() into the API to be called after. BUG=b:207808292 TEST=`make` && tested in porting cbfstool use-case. Change-Id: I8cf95b5eaec943a51d0ea668f26a56bf6d6b4446 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/60881 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sam McNally <sammc@google.com>
* tests: Add unit tests for layout sanity checksAnastasia Klimchuk2021-07-221-0/+105
| | | | | | | | | | | | | | | Three more tests in this patch where layout does / does not pass sanity checks. BUG=b:193584590 TEST=ninja test Change-Id: Ia21585d60443b2741f3868d7887476090e35f79b Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/56440 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Trim excessive new lines from layout test outputAnastasia Klimchuk2021-07-221-18/+18
| | | | | | | | | | | | | | | | | | This patch is making layout test output more compact, spanning less vertical lines while logging the same information. No changes made to the test functionality. BUG=b:193584590 TEST=ninja test Change-Id: I36a39505f8db508672cde5a848684a3a22f5ccc4 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/56439 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* tests: Add layout tests for overlapping regionsAnastasia Klimchuk2021-07-191-0/+103
There are no tests for layout, it would be great to add some. Also partially inspired by commit 06a89d713951a2e08ef8fb698a7688357baa83d1 and commit c9039fc27916c03e21ba91365d01e6bc49503053 BUG=b:193584590 TEST=ninja test Change-Id: I7aa8dc0c9bc5a22fe5deea757eea1a151b969cea Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/56324 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>