diff options
author | Bruno Haible <bruno@clisp.org> | 2009-04-26 16:43:25 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-04-26 16:43:25 +0200 |
commit | d4ca6455614829e611b5488421bb4462990e50ad (patch) | |
tree | f702824d7283147cf7c0d659c11777ff29c33e0a /tests/uniconv/test-u16-conv-from-enc.c | |
parent | b16d2ef530105fa88aebd525b63551cab0ef87b5 (diff) | |
download | gnulib-d4ca6455614829e611b5488421bb4462990e50ad.tar.gz |
Simplify calling convention of u*_conv_from_encoding.
Diffstat (limited to 'tests/uniconv/test-u16-conv-from-enc.c')
-rw-r--r-- | tests/uniconv/test-u16-conv-from-enc.c | 77 |
1 files changed, 36 insertions, 41 deletions
diff --git a/tests/uniconv/test-u16-conv-from-enc.c b/tests/uniconv/test-u16-conv-from-enc.c index 69467e00d9..ac7617b3bd 100644 --- a/tests/uniconv/test-u16-conv-from-enc.c +++ b/tests/uniconv/test-u16-conv-from-enc.c @@ -1,5 +1,5 @@ /* Test of conversion to UTF-16 from legacy encodings. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,15 +77,14 @@ main () for (o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (strlen (input)) : NULL); - uint16_t *result = NULL; - size_t length = 0; - int retval = u16_conv_from_encoding ("ISO-8859-1", handler, - input, strlen (input), - offsets, - &result, &length); - ASSERT (retval == 0); + size_t length; + uint16_t *result = u16_conv_from_encoding ("ISO-8859-1", handler, + input, strlen (input), + offsets, + NULL, &length); + ASSERT (result != NULL); ASSERT (length == SIZEOF (expected)); - ASSERT (result != NULL && u16_cmp (result, expected, SIZEOF (expected)) == 0); + ASSERT (u16_cmp (result, expected, SIZEOF (expected)) == 0); if (o) { for (i = 0; i < 37; i++) @@ -110,15 +109,14 @@ main () for (o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (strlen (input)) : NULL); - uint16_t *result = NULL; - size_t length = 0; - int retval = u16_conv_from_encoding ("ISO-8859-2", handler, - input, strlen (input), - offsets, - &result, &length); - ASSERT (retval == 0); + size_t length; + uint16_t *result = u16_conv_from_encoding ("ISO-8859-2", handler, + input, strlen (input), + offsets, + NULL, &length); + ASSERT (result != NULL); ASSERT (length == SIZEOF (expected)); - ASSERT (result != NULL && u16_cmp (result, expected, SIZEOF (expected)) == 0); + ASSERT (u16_cmp (result, expected, SIZEOF (expected)) == 0); if (o) { for (i = 0; i < 16; i++) @@ -144,15 +142,14 @@ main () for (o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (strlen (input)) : NULL); - uint16_t *result = NULL; - size_t length = 0; - int retval = u16_conv_from_encoding ("autodetect_jp", handler, - input, strlen (input), - offsets, - &result, &length); - ASSERT (retval == 0); + size_t length; + uint16_t *result = u16_conv_from_encoding ("autodetect_jp", handler, + input, strlen (input), + offsets, + NULL, &length); + ASSERT (result != NULL); ASSERT (length == SIZEOF (expected)); - ASSERT (result != NULL && u16_cmp (result, expected, SIZEOF (expected)) == 0); + ASSERT (u16_cmp (result, expected, SIZEOF (expected)) == 0); if (o) { for (i = 0; i < 10; i++) @@ -174,15 +171,14 @@ main () for (o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (strlen (input)) : NULL); - uint16_t *result = NULL; - size_t length = 0; - int retval = u16_conv_from_encoding ("autodetect_jp", handler, - input, strlen (input), - offsets, - &result, &length); - ASSERT (retval == 0); + size_t length; + uint16_t *result = u16_conv_from_encoding ("autodetect_jp", handler, + input, strlen (input), + offsets, + NULL, &length); + ASSERT (result != NULL); ASSERT (length == SIZEOF (expected)); - ASSERT (result != NULL && u16_cmp (result, expected, SIZEOF (expected)) == 0); + ASSERT (u16_cmp (result, expected, SIZEOF (expected)) == 0); if (o) { for (i = 0; i < 10; i++) @@ -204,15 +200,14 @@ main () for (o = 0; o < 2; o++) { size_t *offsets = (o ? new_offsets (strlen (input)) : NULL); - uint16_t *result = NULL; - size_t length = 0; - int retval = u16_conv_from_encoding ("autodetect_jp", handler, - input, strlen (input), - offsets, - &result, &length); - ASSERT (retval == 0); + size_t length; + uint16_t *result = u16_conv_from_encoding ("autodetect_jp", handler, + input, strlen (input), + offsets, + NULL, &length); + ASSERT (result != NULL); ASSERT (length == SIZEOF (expected)); - ASSERT (result != NULL && u16_cmp (result, expected, SIZEOF (expected)) == 0); + ASSERT (u16_cmp (result, expected, SIZEOF (expected)) == 0); if (o) { for (i = 0; i < 16; i++) |