History log of /u-boot/test/unicode_ut.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# aeba385e 18-Jan-2024 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: enhance unicode_test_utf8_to_utf32_stream()

Additionally test a UTF-8 string where each code point translates to three
UTF-8 bytes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# be5f9a77 27-Jul-2023 Dan Carpenter <dan.carpenter@linaro.org>

test: unicode: fix a sizeof() vs ARRAY_SIZE() bug

The u16_strlcat() is in units of u16 not bytes. So the limit needs to
be ARRAY_SIZE() instead of sizeof().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

# 7c00b80d 14-Jul-2023 Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

lib/charset: fix u16_strlcat() return value

strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's
behaviour the same for consistency.

Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

# fa847bb4 09-Mar-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

test: Wrap assert macros in ({ ... }) and fix missing semicolons

Wrap the assert macros in ({ ... }) so they can be safely used both as
right side argument as well as in conditionals without curly brackets
around them. In the process, find a bunch of missing semicolons, fix
them.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 07355760 29-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# f823e323 17-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# be5f9a77 27-Jul-2023 Dan Carpenter <dan.carpenter@linaro.org>

test: unicode: fix a sizeof() vs ARRAY_SIZE() bug

The u16_strlcat() is in units of u16 not bytes. So the limit needs to
be ARRAY_SIZE() instead of sizeof().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

# 7c00b80d 14-Jul-2023 Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

lib/charset: fix u16_strlcat() return value

strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's
behaviour the same for consistency.

Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

# fa847bb4 09-Mar-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

test: Wrap assert macros in ({ ... }) and fix missing semicolons

Wrap the assert macros in ({ ... }) so they can be safely used both as
right side argument as well as in conditionals without curly brackets
around them. In the process, find a bunch of missing semicolons, fix
them.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 07355760 29-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# f823e323 17-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fa847bb4 09-Mar-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

test: Wrap assert macros in ({ ... }) and fix missing semicolons

Wrap the assert macros in ({ ... }) so they can be safely used both as
right side argument as well as in conditionals without curly brackets
around them. In the process, find a bunch of missing semicolons, fix
them.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 07355760 29-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# f823e323 17-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 07355760 29-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# f823e323 17-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f823e323 17-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# b8cd1e7f 28-Apr-2022 Masahisa Kojima <masahisa.kojima@linaro.org>

test: unit test for u16_strlcat()

Provide a unit test for function u16_strlcat().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# c672dd77 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test UTF-16 truncation in snprintf()

Check that snprintf() returns the correct required buffer length and prints
the correct string for UTF-16 strings.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22fc991d 14-Mar-2021 Tom Rini <trini@konsulko.com>

Merge tag 'v2021.04-rc4' into next

Prepare v2021.04-rc4


# a7a98755 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Add a macros for finding tests in linker_lists

At present we use the linker list directly. This is not very friendly, so
add a helpful macro instead. This will also allow us to change the naming
later without updating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# e91789e2 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: UTF-8 stream conversion

Provide functions to convert an UTF-8 stream to code page 437 or UTF-32.

Add unit tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# ddbaff53 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/charset: utf8_get() should return error

utf8_get() should return an error if hitting an illegal UTF-8 sequence and
not silently convert the input to a question mark.

Correct utf_8() and the its unit test.

console_read_unicode() now will ignore illegal UTF-8 sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 73bb90ca 27-Feb-2021 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: carve out utf_to_cp()

Carve out a function to translate a Unicode code point to an 8bit codepage.

Provide a unit test for the new function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fe179d7f 30-Dec-2020 Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# af11423e 29-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for efi_create_indexed_name()

Provide a unit test for function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f91f366b 10-May-2020 Simon Glass <sjg@chromium.org>

test: Use ut_asserteq_mem() where possible

Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify
them to use the macro designed for this purpose.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# efe3b5c8 09-May-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strsize()

Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 336d4615 03-Feb-2020 Simon Glass <sjg@chromium.org>

dm: core: Create a new header file for 'compat' features

At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ad4edfe 17-Dec-2019 Philippe Reynes <philippe.reynes@softathome.com>

cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 79907a4f 17-Sep-2019 AKASHI Takahiro <takahiro.akashi@linaro.org>

test: add tests for u16_str<n>cmp()

New seven test cases for u16_str<n>cmp() are added under Unicode unit test,
which should be executed by "ut unicode" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 02b31dce 14-Jul-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit test for u16_strlen()

Provide a unit test for u16_strlen().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# bc19681a 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: adjust names of Unicode test functions

In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# abb93cb0 14-Dec-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for u16_strdup() and u16_strcpy()

Provide unit tests for u16_strdup() and u16_strcpy().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 35cbb796 11-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: support Unicode text input

Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
With the patch it can consume UTF-8 from the console.

Currently only the serial console and the console can deliver UTF-8.
Local consoles are restricted to ASCII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 1a1012a1 04-Sep-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: tests for utf_to_lower() utf_to_upper().

Provide unit tests for utf_to_lower() utf_to_upper().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# fbba2f67 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: test printing Unicode

Test printing of Unicode strings

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# f11a164b 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

test: unit tests for Unicode functions

Provide unit tests for Unicode functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>