summaryrefslogtreecommitdiff
path: root/tests/lib/compute_ip_checksum-test.c
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/lib/compute_ip_checksum-test.c
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/lib/compute_ip_checksum-test.c')
-rw-r--r--tests/lib/compute_ip_checksum-test.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/lib/compute_ip_checksum-test.c b/tests/lib/compute_ip_checksum-test.c
index 18e7ff0f84..d465bfc4d0 100644
--- a/tests/lib/compute_ip_checksum-test.c
+++ b/tests/lib/compute_ip_checksum-test.c
@@ -7,12 +7,9 @@
#include <ip_checksum.h>
static const uint8_t test_data_simple[] = {
- 0x64, 0x3b, 0x33, 0x17, 0x34, 0x74, 0x62, 0x30,
- 0x75, 0x73, 0xf3, 0x11, 0x30, 0x2c, 0x34, 0x35,
- 0x6d, 0x39, 0x69, 0x32, 0x23, 0x24, 0x76, 0x71,
- 0x77, 0x30, 0x39, 0x75, 0x76, 0x35, 0x71, 0x32,
- 0x40, 0x46, 0x34, 0x34, 0xBB, 0x03, 0x66, 0x52
-};
+ 0x64, 0x3b, 0x33, 0x17, 0x34, 0x74, 0x62, 0x30, 0x75, 0x73, 0xf3, 0x11, 0x30, 0x2c,
+ 0x34, 0x35, 0x6d, 0x39, 0x69, 0x32, 0x23, 0x24, 0x76, 0x71, 0x77, 0x30, 0x39, 0x75,
+ 0x76, 0x35, 0x71, 0x32, 0x40, 0x46, 0x34, 0x34, 0xBB, 0x03, 0x66, 0x52};
static const size_t test_data_simple_sz = ARRAY_SIZE(test_data_simple);
static const unsigned long test_data_simple_checksum = 0x4267;
@@ -81,7 +78,7 @@ static void test_add_ip_checksums(void **state)
{
unsigned long res_1 = compute_ip_checksum(test_data_simple, test_data_simple_sz / 2);
unsigned long res_2 = compute_ip_checksum(test_data_simple + test_data_simple_sz / 2,
- test_data_simple_sz / 2);
+ test_data_simple_sz / 2);
unsigned long res_sum = add_ip_checksums(test_data_simple_sz / 2, res_1, res_2);
assert_int_equal(test_data_simple_checksum, res_sum);