coreboot/tests
Nico Huber b8a1115f51 b64_decode-test: Properly terminate strings before comparison
Undefined behavior in unit-tests is no fun.  assert_string_equal()
expects properly zero-terminated strings. None of the encoded test
strings contain a termination, hence add it manually.

Without this change, the test was often failing with a wrong error
message:

    [==========] tests_lib_b64_decode-test(tests): Running 1 test(s).
    [ RUN      ] test_b64_decode
    [  ERROR   ] --- "AB" != "AB"
    [   LINE   ] --- tests/lib/b64_decode-test.c:38: error: Failure!
    [  FAILED  ] test_b64_decode
    [==========] tests_lib_b64_decode-test(tests): 1 test(s) run.

Probably due to unprintable characters in the string. No idea why
my system is more susceptible to this issue.

Change-Id: Id1bd2c3ff06bc1d4e5aa21ddd0f1d5802540999d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84088
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-08-26 18:49:54 +00:00
..
acpi tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
commonlib region: Turn region_end() into an inclusive region_last() 2024-08-23 01:08:16 +00:00
console tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
data/lib lib/device_tree: Add some FDT helper functions 2024-05-21 13:44:47 +00:00
device tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
drivers tests/drivers/efivars: Remove duplicated <limits.h> 2024-07-03 20:21:06 +00:00
helpers tests/lib: Factor out file related functions 2024-05-21 13:44:39 +00:00
include tests/lib: Factor out file related functions 2024-05-21 13:44:39 +00:00
lib b64_decode-test: Properly terminate strings before comparison 2024-08-26 18:49:54 +00:00
mock tests: Fix tests code and comments style 2022-01-14 14:29:29 +00:00
stubs tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
Makefile.common tests/lib: Factor out file related functions 2024-05-21 13:44:39 +00:00
Makefile.mk tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00