1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2019 Heinrich Schuchardt <xypron.glpk@gmx.de>
5 * Unit tests for memory functions
7 * The architecture dependent implementations run through different lines of
8 * code depending on the alignment and length of memory regions copied or set.
9 * This has to be considered in testing.
16 #include <test/test.h>
20 * lib_errno_str() - unit test for errno_str()
22 * Test errno_str() with varied alignment and length of the copied buffer.
24 * @uts: unit test state
25 * Return: 0 = success, 1 = failure
27 static int lib_errno_str(struct unit_test_state *uts)
32 ut_asserteq_str("Success", msg);
35 ut_asserteq_str("Success", msg);
37 msg = errno_str(-ENOMEM);
38 ut_asserteq_str("Out of memory", msg);
40 msg = errno_str(-99999);
41 ut_asserteq_str("Unknown error", msg);
46 LIB_TEST(lib_errno_str, 0);