Patch for Ice 3.5.0: Make properties unit tests run on any locale

grembogrembo Michael GmelinOrganization: Grem Equity GmbHProject: E-Commerce platformMember
The source distribution contains unit tests to test correct UTF-8 handling in properties. For this purpose a test configuration file named 中国_client.config is written and read back in. The way the unit tests are written they only succeed when a UTF-8 locale is set, e.g. export LANG=en_US.UTF-8. Since this is not the case for all build environments, unit tests will fail with Python string decoding errors. This can be easily reproduced by unsetting LANG before running the tests:
[[email protected] ~]$ unset LANG
[[email protected] ~]$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

The attached patched fixes this problem for C++ and Python unit tests. There are additional unit tests for C#, Java, etc., I assume that the same fix will apply.

To apply the source patch Attachment not found. to a fresh Ice 3.5.0 source distribution:
cd Ice-3.5.0
patch -p0 < ice350-fix-locale-unit-test-cpp-py.patch.txt

Cheers,
Michael
Sign In or Register to comment.