[PATCH] test: fix unit test build error for crc8

From: Emanuele Ghidoli emanuele.ghidoli@toradex.com
Build fail due to ENOSYS undeclared if CONFIG_SANDBOX_SDL is not defined. Include errno.h before including test/lib.h.
Fixes: 3080ddf970b1 ("test: unit test for crc8") Signed-off-by: Emanuele Ghidoli emanuele.ghidoli@toradex.com --- test/lib/test_crc8.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/test/lib/test_crc8.c b/test/lib/test_crc8.c index 0dac97bc5bfd..5037db806d09 100644 --- a/test/lib/test_crc8.c +++ b/test/lib/test_crc8.c @@ -5,6 +5,7 @@ * Unit test for crc8 */
+#include <errno.h> #include <test/lib.h> #include <test/ut.h> #include <u-boot/crc.h>

On 5/30/23 17:39, ghidoliemanuele@gmail.com wrote:
From: Emanuele Ghidoli emanuele.ghidoli@toradex.com
Build fail due to ENOSYS undeclared if CONFIG_SANDBOX_SDL is not defined. Include errno.h before including test/lib.h.
Fixes: 3080ddf970b1 ("test: unit test for crc8") Signed-off-by: Emanuele Ghidoli emanuele.ghidoli@toradex.com
test/lib/test_crc8.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/test/lib/test_crc8.c b/test/lib/test_crc8.c index 0dac97bc5bfd..5037db806d09 100644 --- a/test/lib/test_crc8.c +++ b/test/lib/test_crc8.c @@ -5,6 +5,7 @@
- Unit test for crc8
*/
+#include <errno.h> #include <test/lib.h> #include <test/ut.h> #include <u-boot/crc.h>
Thank you for reporting the issue. Unfortunately this patch seems to add a change in the wrong place:
For sandbox_defconfig with CONFIG_SANDBOX_SDL=n I get:
In file included from include/test/test.h:156, from include/test/lib.h:9, from test/lib/test_crc8.c:8: ./arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’: CC lib/libavb/avb_util.o ./arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function) 323 | return -ENOSYS; | ^~~~~~ ./arch/sandbox/include/asm/test.h:323:17: note: each undeclared identifier is reported only once for each function it appears in
The file to fix is /arch/sandbox/include/asm/test.h which uses ENOSYS without declaring it.
Please, update your patch and add a line Fixes: 67a36465216a ("sandbox: video: Fix building without SDL")
Best regards
Heinrich
participants (2)
-
ghidoliemanuele@gmail.com
-
Heinrich Schuchardt