|
From: | Aleksander Morgado |
Subject: | Re: [pdf-devel] Text module unit tests failing |
Date: | Mon, 15 Sep 2008 19:09:24 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b1pre) Gecko/20080910025452 Shredder/3.0b1pre |
Hi Jose, Thanks for your explanation!
I suggest to explicitly set the locale to C/POSIX in the text module unit tests (and not to rely on maint.mk to do it) except when testing specific features needing another locale (such as the turkish, upper-lower case and comparison scenario).
In fact, I avoided the need of the specific turkish locale info by testing the upper/lower case stuff with PDF strings in UTF-16BE and country/lang info embedded. So we can set the locale equal to 'C' in all the text module unit tests without any problem.
/* Get system default locale name and check it */ locale_name = gl_locale_name(LC_CTYPE, "LC_CTYPE"); - if((locale_name == NULL) || \ - (strlen(locale_name)< 2)) + if (locale_name == NULL) { PDF_DEBUG_BASE("Invalid locale info detected! '%s'", ((locale_name!=NULL) ? locale_name : "null")); return PDF_ETEXTENC; }
As you now just check if locale_name is NULL, there is no need to check it again within the debug message. So the debug message could be just:
PDF_DEBUG_BASE("Invalid locale info detected! (null)"); All the other stuff seems to be ok for me. Did you check the unit tests with this change? Cheers! -Aleksander
[Prev in Thread] | Current Thread | [Next in Thread] |