Add error handling for base64 decoding in test

This commit adds a check for errors when decoding base64 strings in the b64linebreaker_test.go file. If an error occurs, it logs a meaningful error message, improving the test's robustness and clarity.
This commit is contained in:
Winni Neessen 2024-10-23 11:29:04 +02:00
parent b31c7cf3a7
commit 0bac51746d
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -255,6 +255,9 @@ func FuzzBase64LineBreaker(f *testing.F) {
} }
decode, err := base64.StdEncoding.DecodeString(buffer.String()) decode, err := base64.StdEncoding.DecodeString(buffer.String())
if err != nil {
t.Errorf("failed to decode base64 data: %s", err)
}
if !bytes.Equal(data, decode) { if !bytes.Equal(data, decode) {
t.Error("generated line breaker output differs from original data") t.Error("generated line breaker output differs from original data")
} }