#1142 closed defect (fixed)
[PATCH] TestCLogger::test_unicode() failure on FreeBSD
Reported by: | historic_bruno | Owned by: | leper |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 18 |
Component: | Core engine | Keywords: | freebsd patch |
Cc: | Patch: |
Description
Running 258 tests............................................................................................................APIC: all zero .............................................................................................................. In TestCLogger::test_unicode: ../../../source/ps/tests/../../../source/ps/tests/test_CLogger.h:100: Error: Expected (lines[0] == "\xC3\xA2 \xC4\xA7"), found ("" != �� ��) ....................................... Failed 1 of 258 tests Success rate: 99%
Attachments (1)
Change History (4)
by , 9 years ago
Attachment: | test_setup.cpp.patch added |
---|
comment:1 by , 9 years ago
Keywords: | review patch added |
---|---|
Milestone: | Backlog → Alpha 18 |
Summary: | TestCLogger::test_unicode() failure on FreeBSD → [PATCH] TestCLogger::test_unicode() failure on FreeBSD |
CLogger::LogMessage calls vswprintf
. In FreeBSD, this is implemented by
a call to __vfwprintf (via vswprintf_l) using a fake FILE structure
followed by mbsrtowcs_l (see /usr/src/lib/libc/stdio/vswprintf.c
) on the
output and thus dependant on the locale setting.
When setlocale/2
has not been called, the default seems to be C/ascii
which allows only code points 0-FFh to pass through. In the test case
mentioned, this behavior causes an unnoticed EILSEQ error.
Apparently, this bug has been fixed in GameState.cpp
already and was not
copied over into the test project, see associated patch.
(Fix is simple but finding the cause took ages of grep-ing through the libc sources and multiple test programs... :-(
Enable vswprintf-calls for Unicode in test project/*BSD-projects