From c08b6a7037e4dd21f08a2fc8d40db51c7b4e051b Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Mon, 10 Jan 2022 13:36:47 +0000 Subject: tests: Fix tests code and comments style This patch applies clang-format settings to most of tests files. Some files were fixed "by-hand" to exclude some lines, which whould be less readable after automatic style fixing. Moreover, some comments (mostly in tests/lib/edid-test.c) were adjusted to match coreboot coding style guidelines. Change-Id: I69f25a7b6d8265800c731754e2fbb2255f482134 Signed-off-by: Jakub Czapiga Reviewed-on: https://review.coreboot.org/c/coreboot/+/60970 Tested-by: build bot (Jenkins) Reviewed-by: Paul Fagerburg --- tests/commonlib/region-test.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'tests/commonlib/region-test.c') diff --git a/tests/commonlib/region-test.c b/tests/commonlib/region-test.c index 59f272a7d95d..32804825a6ed 100644 --- a/tests/commonlib/region-test.c +++ b/tests/commonlib/region-test.c @@ -14,30 +14,30 @@ static void test_region(void **state) assert_true(VAL(5) + VAL(10) > VAL(10)); assert_true(VAL(7) + VAL(10) < VAL(10)); - struct region outer = { .offset = VAL(2), .size = VAL(4) }; + struct region outer = {.offset = VAL(2), .size = VAL(4)}; assert_int_equal(region_offset(&outer), VAL(2)); assert_int_equal(region_sz(&outer), VAL(4)); assert_int_equal(region_end(&outer), VAL(6)); - struct region inner = { .offset = VAL(3), .size = VAL(2) }; + struct region inner = {.offset = VAL(3), .size = VAL(2)}; assert_true(region_is_subregion(&outer, &inner)); - struct region touching_bottom = { .offset = VAL(2), .size = VAL(1) }; + struct region touching_bottom = {.offset = VAL(2), .size = VAL(1)}; assert_true(region_is_subregion(&outer, &touching_bottom)); - struct region touching_top = { .offset = VAL(5), .size = VAL(1) }; + struct region touching_top = {.offset = VAL(5), .size = VAL(1)}; assert_true(region_is_subregion(&outer, &touching_top)); - struct region overlap_bottom = { .offset = VAL(1), .size = VAL(2) }; + struct region overlap_bottom = {.offset = VAL(1), .size = VAL(2)}; assert_false(region_is_subregion(&outer, &overlap_bottom)); - struct region overlap_top = { .offset = VAL(5), .size = VAL(2) }; + struct region overlap_top = {.offset = VAL(5), .size = VAL(2)}; assert_false(region_is_subregion(&outer, &overlap_top)); - struct region below = { .offset = 0, .size = VAL(1) }; + struct region below = {.offset = 0, .size = VAL(1)}; assert_false(region_is_subregion(&outer, &below)); - struct region above = { .offset = VAL(0xf), .size = VAL(1) }; + struct region above = {.offset = VAL(0xf), .size = VAL(1)}; assert_false(region_is_subregion(&outer, &above)); } @@ -58,8 +58,8 @@ static int mock_unmap(const struct region_device *rdev, void *mapping) return mock(); } -static ssize_t mock_readat(const struct region_device *rdev, void *buffer, - size_t offset, size_t size) +static ssize_t mock_readat(const struct region_device *rdev, void *buffer, size_t offset, + size_t size) { check_expected_ptr(rdev); check_expected_ptr(buffer); @@ -73,8 +73,8 @@ static ssize_t mock_readat(const struct region_device *rdev, void *buffer, return ret; } -static ssize_t mock_writeat(const struct region_device *rdev, const void *buffer, - size_t offset, size_t size) +static ssize_t mock_writeat(const struct region_device *rdev, const void *buffer, size_t offset, + size_t size) { check_expected_ptr(rdev); check_expected_ptr(buffer); @@ -365,7 +365,7 @@ static void test_mem_rdev(void **state) /* Test read/write/erase of larger chunk. */ size_t offs = 0x47; - size_t chunk = 0x72; + size_t chunk = 0x72; memset(backing, 0, size); memset(scratch, 0, size); memset(scratch + offs, 0x39, chunk); -- cgit v1.2.3