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>
This commit is contained in:
Jakub Czapiga
2022-01-10 13:36:47 +00:00
committed by Felix Held
parent 63ec2ac97a
commit c08b6a7037
31 changed files with 1225 additions and 1228 deletions

View File

@@ -13,7 +13,7 @@ static u32 decode_package_length(const char *ptr)
{
const u8 *aml = (u8 *)ptr;
const u32 offset = (aml[0] == EXT_OP_PREFIX ? 2 : 1);
u32 byte_zero_mask = 0x3F; /* Bits [0:5] */
u32 byte_zero_mask = 0x3F; /* Bits [0:5] */
u32 byte_count = aml[offset] >> 6;
u32 package_length = 0;
@@ -106,7 +106,7 @@ static void test_acpigen_nested_ifs(void **state)
for (int i = 0; i < nesting_level; ++i)
assert_int_equal(decode_package_length(block_start[i]),
block_end[i] - block_start[i] - 1);
block_end[i] - block_start[i] - 1);
}
static void test_acpigen_write_package(void **state)
@@ -203,14 +203,14 @@ static void test_acpigen_scope_with_contents(void **state)
int main(void)
{
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(test_acpigen_single_if,
setup_acpigen, teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_nested_ifs,
setup_acpigen, teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_write_package,
setup_acpigen, teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_scope_with_contents,
setup_acpigen, teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_single_if, setup_acpigen,
teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_nested_ifs, setup_acpigen,
teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_write_package, setup_acpigen,
teardown_acpigen),
cmocka_unit_test_setup_teardown(test_acpigen_scope_with_contents, setup_acpigen,
teardown_acpigen),
};
return cb_run_group_tests(tests, NULL, NULL);