diff mbox series

[1/1] test: unit test for u16_strsize()

Message ID 20200509071931.20543-1-xypron.glpk@gmx.de
State Accepted
Commit efe3b5c8dfe8eef46fe951146b8e23fab04e040a
Headers show
Series [1/1] test: unit test for u16_strsize() | expand

Commit Message

Heinrich Schuchardt May 9, 2020, 7:19 a.m. UTC
Provide a test for new Unicode library function u16_strsize().

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 test/unicode_ut.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

--
2.26.2

Comments

Ilias Apalodimas May 9, 2020, 7:23 a.m. UTC | #1
On Sat, May 09, 2020 at 09:19:31AM +0200, Heinrich Schuchardt wrote:
> Provide a test for new Unicode library function u16_strsize().
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  test/unicode_ut.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/test/unicode_ut.c b/test/unicode_ut.c
> index 4d99c20bc0..d8b4aa9b44 100644
> --- a/test/unicode_ut.c
> +++ b/test/unicode_ut.c
> @@ -581,6 +581,16 @@ static int unicode_test_u16_strncmp(struct unit_test_state *uts)
>  }
>  UNICODE_TEST(unicode_test_u16_strncmp);
> 
> +static int unicode_test_u16_strsize(struct unit_test_state *uts)
> +{
> +	ut_asserteq_64(u16_strsize(c1), 14);
> +	ut_asserteq_64(u16_strsize(c2), 18);
> +	ut_asserteq_64(u16_strsize(c3), 8);
> +	ut_asserteq_64(u16_strsize(c4), 14);
> +	return 0;
> +}
> +UNICODE_TEST(unicode_test_u16_strsize);
> +
>  int do_ut_unicode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
>  	struct unit_test *tests = ll_entry_start(struct unit_test, unicode_test);
> --
> 2.26.2
> 

Acked-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
diff mbox series

Patch

diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index 4d99c20bc0..d8b4aa9b44 100644
--- a/test/unicode_ut.c
+++ b/test/unicode_ut.c
@@ -581,6 +581,16 @@  static int unicode_test_u16_strncmp(struct unit_test_state *uts)
 }
 UNICODE_TEST(unicode_test_u16_strncmp);

+static int unicode_test_u16_strsize(struct unit_test_state *uts)
+{
+	ut_asserteq_64(u16_strsize(c1), 14);
+	ut_asserteq_64(u16_strsize(c2), 18);
+	ut_asserteq_64(u16_strsize(c3), 8);
+	ut_asserteq_64(u16_strsize(c4), 14);
+	return 0;
+}
+UNICODE_TEST(unicode_test_u16_strsize);
+
 int do_ut_unicode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	struct unit_test *tests = ll_entry_start(struct unit_test, unicode_test);