C++: Tests: Fix unicode tests with MSVC

Change-Id: I5575826558bf60982ecc964e4dd85a3f4e920197
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-05-30 12:09:05 -04:00
committed by Christian Stenger
parent 2e5ce2a8dc
commit 655470cc0c
15 changed files with 175 additions and 126 deletions

View File

@@ -1784,21 +1784,39 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_unicodeIdentifier()
QByteArray original;
QByteArray expected;
//
// The following "non-latin1" code points are used in the tests:
//
// U+00FC - 2 code units in UTF8, 1 in UTF16 - LATIN SMALL LETTER U WITH DIAERESIS
// U+4E8C - 3 code units in UTF8, 1 in UTF16 - CJK UNIFIED IDEOGRAPH-4E8C
// U+10302 - 4 code units in UTF8, 2 in UTF16 - OLD ITALIC LETTER KE
//
#define UNICODE_U00FC "\xc3\xbc"
#define UNICODE_U4E8C "\xe4\xba\x8c"
#define UNICODE_U10302 "\xf0\x90\x8c\x82"
#define TEST_UNICODE_IDENTIFIER UNICODE_U00FC UNICODE_U4E8C UNICODE_U10302
original =
"class Foo {\n"
" void @\u00FC\u4E8C\U00010302();\n"
" void @" TEST_UNICODE_IDENTIFIER "();\n"
"};\n";
;
expected = original;
expected +=
"\n"
"\n"
"void Foo::\u00FC\u4E8C\U00010302()\n"
"void Foo::" TEST_UNICODE_IDENTIFIER "()\n"
"{\n"
"\n"
"}\n";
testFiles << QuickFixTestDocument::create("file.cpp", original, expected);
#undef UNICODE_U00FC
#undef UNICODE_U4E8C
#undef UNICODE_U10302
#undef TEST_UNICODE_IDENTIFIER
InsertDefFromDecl factory;
QuickFixTestCase(testFiles, &factory);
}