diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2022-01-10 13:36:47 +0000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-01-14 14:29:29 +0000 |
commit | c08b6a7037e4dd21f08a2fc8d40db51c7b4e051b (patch) | |
tree | bcab84b0853151766b0fe4a3c324e962fb05bb4c /tests/lib/lzma-test.c | |
parent | 63ec2ac97aab17a7e5c8e929c96a188bcd59b9c0 (diff) | |
download | coreboot-c08b6a7037e4dd21f08a2fc8d40db51c7b4e051b.tar.gz coreboot-c08b6a7037e4dd21f08a2fc8d40db51c7b4e051b.tar.bz2 coreboot-c08b6a7037e4dd21f08a2fc8d40db51c7b4e051b.zip |
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/lib/lzma-test.c')
-rw-r--r-- | tests/lib/lzma-test.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/lib/lzma-test.c b/tests/lib/lzma-test.c index 8ae9ceda1829..b68d38e122a8 100644 --- a/tests/lib/lzma-test.c +++ b/tests/lib/lzma-test.c @@ -51,12 +51,12 @@ static int setup_ulzman_file(void **state) if (!s) return 1; - const size_t raw_filename_size = strlen(path_prefix) + strlen(fname_base) - + ARRAY_SIZE(raw_file_suffix); + const size_t raw_filename_size = + strlen(path_prefix) + strlen(fname_base) + ARRAY_SIZE(raw_file_suffix); s->raw_filename = test_malloc(raw_filename_size); - const size_t comp_filename_size = strlen(path_prefix) + strlen(fname_base) - + ARRAY_SIZE(comp_file_suffix); + const size_t comp_filename_size = + strlen(path_prefix) + strlen(fname_base) + ARRAY_SIZE(comp_file_suffix); s->comp_filename = test_malloc(comp_filename_size); if (!s->raw_filename || !s->comp_filename) { @@ -67,7 +67,7 @@ static int setup_ulzman_file(void **state) snprintf(s->raw_filename, raw_filename_size, path_prefix, fname_base, raw_file_suffix); snprintf(s->comp_filename, comp_filename_size, path_prefix, fname_base, - comp_file_suffix); + comp_file_suffix); s->raw_file_sz = get_file_size(s->raw_filename); s->comp_file_sz = get_file_size(s->comp_filename); @@ -117,10 +117,10 @@ static void test_ulzman_correct_file(void **state) assert_non_null(comp_buf); assert_int_equal(s->raw_file_sz, read_file(s->raw_filename, raw_buf, s->raw_file_sz)); assert_int_equal(s->comp_file_sz, - read_file(s->comp_filename, comp_buf, s->comp_file_sz)); + read_file(s->comp_filename, comp_buf, s->comp_file_sz)); assert_int_equal(s->raw_file_sz, - ulzman(comp_buf, s->comp_file_sz, decomp_buf, s->raw_file_sz)); + ulzman(comp_buf, s->comp_file_sz, decomp_buf, s->raw_file_sz)); assert_memory_equal(raw_buf, decomp_buf, s->raw_file_sz); test_free(raw_buf); @@ -148,13 +148,11 @@ static void test_ulzman_zero_buffer(void **state) } #define ULZMAN_CORRECT_FILE_TEST(_file_prefix) \ -{ \ - .name = "test_ulzman_correct_file(" _file_prefix ")", \ - .test_func = test_ulzman_correct_file, \ - .setup_func = setup_ulzman_file, \ - .teardown_func = teardown_ulzman_file, \ - .initial_state = (_file_prefix) \ -} + { \ + .name = "test_ulzman_correct_file(" _file_prefix ")", \ + .test_func = test_ulzman_correct_file, .setup_func = setup_ulzman_file, \ + .teardown_func = teardown_ulzman_file, .initial_state = (_file_prefix) \ + } int main(void) { |