mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commitc8ffd1356d, reversing changes made to2ee6f3a5f7. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
47 lines
1.0 KiB
C
47 lines
1.0 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2019 Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|
*
|
|
* Unit tests for memory functions
|
|
*
|
|
* The architecture dependent implementations run through different lines of
|
|
* code depending on the alignment and length of memory regions copied or set.
|
|
* This has to be considered in testing.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <command.h>
|
|
#include <errno.h>
|
|
#include <test/lib.h>
|
|
#include <test/test.h>
|
|
#include <test/ut.h>
|
|
|
|
/**
|
|
* lib_errno_str() - unit test for errno_str()
|
|
*
|
|
* Test errno_str() with varied alignment and length of the copied buffer.
|
|
*
|
|
* @uts: unit test state
|
|
* Return: 0 = success, 1 = failure
|
|
*/
|
|
static int lib_errno_str(struct unit_test_state *uts)
|
|
{
|
|
const char *msg;
|
|
|
|
msg = errno_str(1);
|
|
ut_asserteq_str("Success", msg);
|
|
|
|
msg = errno_str(0);
|
|
ut_asserteq_str("Success", msg);
|
|
|
|
msg = errno_str(-ENOMEM);
|
|
ut_asserteq_str("Out of memory", msg);
|
|
|
|
msg = errno_str(-99999);
|
|
ut_asserteq_str("Unknown error", msg);
|
|
|
|
return 0;
|
|
}
|
|
|
|
LIB_TEST(lib_errno_str, 0);
|