summaryrefslogtreecommitdiff
path: root/tests/commonlib
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2022-01-10 13:36:47 +0000
committerFelix Held <felix-coreboot@felixheld.de>2022-01-14 14:29:29 +0000
commitc08b6a7037e4dd21f08a2fc8d40db51c7b4e051b (patch)
treebcab84b0853151766b0fe4a3c324e962fb05bb4c /tests/commonlib
parent63ec2ac97aab17a7e5c8e929c96a188bcd59b9c0 (diff)
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 <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60970 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'tests/commonlib')
-rw-r--r--tests/commonlib/region-test.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/commonlib/region-test.c b/tests/commonlib/region-test.c
index 59f272a7d9..32804825a6 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);