diff options
| author | Simon Glass <[email protected]> | 2023-12-27 13:07:05 -0800 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2023-12-31 07:21:02 -0700 |
| commit | 997dac6edebe5b82f4d6f9b90753f0af6e9d04f0 (patch) | |
| tree | 42c0bebc0af5e779a3982bd983646a78bfb53253 /test | |
| parent | 47e1047b0cc25269124737696971ab0c3187666d (diff) | |
bloblist: Checksum the entire bloblist
Use a sinple 8-bit checksum for bloblist, as specified by the spec
version 0.9.
Spec v0.9 specifies that the entire bloblist area is checksummed,
including unused portions. Update the code to follow this.
Signed-off-by: Simon Glass <[email protected]>
Co-developed-by: Raymond Mao <[email protected]>
Signed-off-by: Raymond Mao <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/bloblist.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/bloblist.c b/test/bloblist.c index 8b435e27ca3..49ac4b92aee 100644 --- a/test/bloblist.c +++ b/test/bloblist.c @@ -237,12 +237,18 @@ static int bloblist_test_checksum(struct unit_test_state *uts) *data2 -= 1; /* - * Changing data outside the range of valid data should not affect - * the checksum. + * Changing data outside the range of valid data should affect the + * checksum. */ ut_assertok(bloblist_check(TEST_ADDR, TEST_BLOBLIST_SIZE)); data[TEST_SIZE]++; + ut_asserteq(-EIO, bloblist_check(TEST_ADDR, TEST_BLOBLIST_SIZE)); + data[TEST_SIZE]--; + ut_assertok(bloblist_check(TEST_ADDR, TEST_BLOBLIST_SIZE)); + data2[TEST_SIZE2]++; + ut_asserteq(-EIO, bloblist_check(TEST_ADDR, TEST_BLOBLIST_SIZE)); + data[TEST_SIZE]--; ut_assertok(bloblist_check(TEST_ADDR, TEST_BLOBLIST_SIZE)); return 0; |
