dovecot-2.2: lib: Improved unit test for uni_utf8_get_char() ret...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 1 19:19:08 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5f4742b69e7e
changeset: 18787:5f4742b69e7e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 01 22:11:55 2015 +0300
description:
lib: Improved unit test for uni_utf8_get_char() return value check.

diffstat:

 src/lib/test-unichar.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 8b7be28bd518 -r 5f4742b69e7e src/lib/test-unichar.c
--- a/src/lib/test-unichar.c	Mon Jun 01 22:08:43 2015 +0300
+++ b/src/lib/test-unichar.c	Mon Jun 01 22:11:55 2015 +0300
@@ -58,7 +58,7 @@
 		str_truncate(str, 0);
 		uni_ucs4_to_utf8_c(chr, str);
 		test_assert(uni_utf8_str_is_valid(str_c(str)));
-		test_assert(uni_utf8_get_char(str_c(str), &chr2) > 0);
+		test_assert(uni_utf8_get_char(str_c(str), &chr2) == (int)uni_utf8_char_bytes(*str_data(str)));
 		test_assert(chr2 == chr);
 
 		if ((chr & 0x63) == 0) {


More information about the dovecot-cvs mailing list