Skip to content

Commit

Permalink
[tests] fix CharsetConverter.utf8To_UTF32LE test on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Apr 27, 2014
1 parent e0e327c commit 1366003
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xbmc/utils/test/TestCharsetConverter.cpp
Expand Up @@ -22,6 +22,7 @@
#include "utils/CharsetConverter.h"
#include "utils/StdString.h"
#include "utils/Utf8Utils.h"
#include "system.h"

#include "gtest/gtest.h"

Expand Down Expand Up @@ -64,7 +65,11 @@ static const uint32_t refutf32LE1[] = { 0xff54, 0xff45, 0xff53, 0xff54,
0xff33, 0xff54, 0xff44, 0xff33,
0xff54, 0xff52, 0xff49, 0xff4e,
0xff47, 0xff13, 0xff12, 0xff3f,
#ifdef TARGET_DARWIN
0x0 };
#else
0x1f42d, 0x1f42e, 0x0 };
#endif

static const uint16_t refutf16BE[] = { 0x54ff, 0x45ff, 0x53ff, 0x54ff,
0x3fff, 0x55ff, 0x54ff, 0x46ff,
Expand Down Expand Up @@ -192,7 +197,16 @@ TEST_F(TestCharsetConverter, utf8To_UTF16LE)
TEST_F(TestCharsetConverter, utf8To_UTF32LE)
{
refstra1 = "test_utf8To:_charset_UTF-32LE,_"
#ifdef TARGET_DARWIN
/* OSX has it's own 'special' utf-8 charset which we use (see UTF8_SOURCE in CharsetConverter.cpp)
which is basically NFD (decomposed) utf-8. The trouble is, it fails on the COW FACE and MOUSE FACE
characters for some reason (possibly anything over 0x100000, or maybe there's a decomposed form of these
that I couldn't find???) If UTF8_SOURCE is switched to UTF-8 then this test would pass as-is, but then
some filenames stored in utf8-mac wouldn't display correctly in the UI. */
"CStdString32_";
#else
"CStdString32_🐭🐮";
#endif
refstr32_1.assign(refutf32LE1);
varstr32_1.clear();
g_charsetConverter.utf8To("UTF-32LE", refstra1, varstr32_1);
Expand Down

0 comments on commit 1366003

Please sign in to comment.