diff options
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/operations/Test.ice | 67 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMD.ice | 68 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.cpp | 45 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.h | 3 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.cpp | 43 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.h | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Twoways.cpp | 92 |
7 files changed, 313 insertions, 7 deletions
diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index cf44e14a50d..d7698951ca8 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -43,6 +43,7 @@ sequence<long> LongS; sequence<float> FloatS; sequence<double> DoubleS; sequence<string> StringS; +sequence<["cpp:type:wstring"]string> WStringS; sequence<MyEnum> MyEnumS; sequence<MyClass*> MyClassS; @@ -253,6 +254,7 @@ class MyClass ByteBoolD opByteBoolD2(ByteBoolD byteBoolD); StringS opStringLiterals(); + WStringS opWStringLiterals(); }; struct MyStruct1 @@ -341,5 +343,70 @@ const string su0 = "ÿĀἀ𐆔𐅪𐆘🍀🍁🍂🍃"; const string su1 = "\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; const string su2 = "\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; +// +// Wide string literals +// + +const ["cpp:type:wstring"]string ws0 = "\u005c"; // backslash +const ["cpp:type:wstring"]string ws1 = "\u0041"; // A +const ["cpp:type:wstring"]string ws2 = "\u0049\u0063\u0065"; // Ice +const ["cpp:type:wstring"]string ws3 = "\u004121"; // A21 +const ["cpp:type:wstring"]string ws4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041 +const ["cpp:type:wstring"]string ws5 = "\u00FF"; // ÿ +const ["cpp:type:wstring"]string ws6 = "\u03FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF) +const ["cpp:type:wstring"]string ws7 = "\u05F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0) +const ["cpp:type:wstring"]string ws8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000) +const ["cpp:type:wstring"]string ws9 = "\U0001F34C"; // BANANA (U+1F34C) +const ["cpp:type:wstring"]string ws10 = "\u0DA7"; // Sinhala Letter Alpapraana Ttayanna + +const ["cpp:type:wstring"]string wsw0 = "\U0000005c"; // backslash +const ["cpp:type:wstring"]string wsw1 = "\U00000041"; // A +const ["cpp:type:wstring"]string wsw2 = "\U00000049\U00000063\U00000065"; // Ice +const ["cpp:type:wstring"]string wsw3 = "\U0000004121"; // A21 +const ["cpp:type:wstring"]string wsw4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041 +const ["cpp:type:wstring"]string wsw5 = "\U000000FF"; // ÿ +const ["cpp:type:wstring"]string wsw6 = "\U000003FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF) +const ["cpp:type:wstring"]string wsw7 = "\U000005F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0) +const ["cpp:type:wstring"]string wsw8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000) +const ["cpp:type:wstring"]string wsw9 = "\U0001F34C"; // BANANA (U+1F34C) +const ["cpp:type:wstring"]string wsw10 = "\U00000DA7"; // Sinhala Letter Alpapraana Ttayanna + +/** +\' single quote byte 0x27 in ASCII encoding +\" double quote byte 0x22 in ASCII encoding +\? question mark byte 0x3f in ASCII encoding +\\ backslash byte 0x5c in ASCII encoding +\a audible bell byte 0x07 in ASCII encoding +\b backspace byte 0x08 in ASCII encoding +\f form feed - new page byte 0x0c in ASCII encoding +\n line feed - new line byte 0x0a in ASCII encoding +\r carriage return byte 0x0d in ASCII encoding +\t horizontal tab byte 0x09 in ASCII encoding +\v vertical tab byte 0x0b in ASCII encoding +**/ + +const ["cpp:type:wstring"]string wss0 = "\'\"\?\\\a\b\f\n\r\t\v"; +const ["cpp:type:wstring"]string wss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b"; +const ["cpp:type:wstring"]string wss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b"; + +const ["cpp:type:wstring"]string wss3 = "\\\\U\\u\\"; /* \\U\u\ */ +const ["cpp:type:wstring"]string wss4 = "\\\u0041\\"; /* \A\ */ +const ["cpp:type:wstring"]string wss5 = "\\u0041\\"; /* \u0041\ */ + +// +// ÿ - Unicode Character 'LATIN SMALL LETTER Y WITH DIAERESIS' (U+00FF) +// Ā - Unicode Character 'LATIN CAPITAL LETTER A WITH MACRON' (U+0100) +// ἀ - Unicode Character 'GREEK SMALL LETTER ALPHA WITH PSILI' (U+1F00) +// 𐆔 - Unicode Character 'ROMAN DIMIDIA SEXTULA SIGN' (U+10194) +// 𐅪 - Unicode Character 'GREEK ACROPHONIC THESPIAN ONE HUNDRED' (U+1016A) +// 𐆘 - Unicode Character 'ROMAN SESTERTIUS SIGN' (U+10198) +// 🍀 - Unicode Character 'FOUR LEAF CLOVER' (U+1F340) +// 🍁 - Unicode Character 'MAPLE LEAF' (U+1F341) +// 🍂 - Unicode Character 'FALLEN LEAF' (U+1F342) +// 🍃 - Unicode Character 'LEAF FLUTTERING IN WIND' (U+1F343) +const ["cpp:type:wstring"]string wsu0 = "ÿĀἀ𐆔𐅪𐆘🍀🍁🍂🍃"; +const ["cpp:type:wstring"]string wsu1 = "\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; +const ["cpp:type:wstring"]string wsu2 = "\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; + }; diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index a65608ea4c7..ee26d1c1970 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -43,6 +43,7 @@ sequence<long> LongS; sequence<float> FloatS; sequence<double> DoubleS; sequence<string> StringS; +sequence<["cpp:type:wstring"] string> WStringS; sequence<MyEnum> MyEnumS; sequence<MyClass*> MyClassS; @@ -254,6 +255,8 @@ dictionary<MyEnum, MyEnumS> MyEnumMyEnumSD; ByteBoolD opByteBoolD2(ByteBoolD byteBoolD); StringS opStringLiterals(); + + WStringS opWStringLiterals(); }; struct MyStruct1 @@ -344,6 +347,71 @@ const string su0 = "ÿĀἀ𐆔𐅪𐆘🍀🍁🍂🍃"; const string su1 = "\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; const string su2 = "\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; +// +// Wide string literals +// + +const ["cpp:type:wstring"]string ws0 = "\u005c"; // backslash +const ["cpp:type:wstring"]string ws1 = "\u0041"; // A +const ["cpp:type:wstring"]string ws2 = "\u0049\u0063\u0065"; // Ice +const ["cpp:type:wstring"]string ws3 = "\u004121"; // A21 +const ["cpp:type:wstring"]string ws4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041 +const ["cpp:type:wstring"]string ws5 = "\u00FF"; // ÿ +const ["cpp:type:wstring"]string ws6 = "\u03FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF) +const ["cpp:type:wstring"]string ws7 = "\u05F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0) +const ["cpp:type:wstring"]string ws8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000) +const ["cpp:type:wstring"]string ws9 = "\U0001F34C"; // BANANA (U+1F34C) +const ["cpp:type:wstring"]string ws10 = "\u0DA7"; // Sinhala Letter Alpapraana Ttayanna + +const ["cpp:type:wstring"]string wsw0 = "\U0000005c"; // backslash +const ["cpp:type:wstring"]string wsw1 = "\U00000041"; // A +const ["cpp:type:wstring"]string wsw2 = "\U00000049\U00000063\U00000065"; // Ice +const ["cpp:type:wstring"]string wsw3 = "\U0000004121"; // A21 +const ["cpp:type:wstring"]string wsw4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041 +const ["cpp:type:wstring"]string wsw5 = "\U000000FF"; // ÿ +const ["cpp:type:wstring"]string wsw6 = "\U000003FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF) +const ["cpp:type:wstring"]string wsw7 = "\U000005F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0) +const ["cpp:type:wstring"]string wsw8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000) +const ["cpp:type:wstring"]string wsw9 = "\U0001F34C"; // BANANA (U+1F34C) +const ["cpp:type:wstring"]string wsw10 = "\U00000DA7"; // Sinhala Letter Alpapraana Ttayanna + +/** +\' single quote byte 0x27 in ASCII encoding +\" double quote byte 0x22 in ASCII encoding +\? question mark byte 0x3f in ASCII encoding +\\ backslash byte 0x5c in ASCII encoding +\a audible bell byte 0x07 in ASCII encoding +\b backspace byte 0x08 in ASCII encoding +\f form feed - new page byte 0x0c in ASCII encoding +\n line feed - new line byte 0x0a in ASCII encoding +\r carriage return byte 0x0d in ASCII encoding +\t horizontal tab byte 0x09 in ASCII encoding +\v vertical tab byte 0x0b in ASCII encoding +**/ + +const ["cpp:type:wstring"]string wss0 = "\'\"\?\\\a\b\f\n\r\t\v"; +const ["cpp:type:wstring"]string wss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b"; +const ["cpp:type:wstring"]string wss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b"; + +const ["cpp:type:wstring"]string wss3 = "\\\\U\\u\\"; /* \\U\u\ */ +const ["cpp:type:wstring"]string wss4 = "\\\u0041\\"; /* \A\ */ +const ["cpp:type:wstring"]string wss5 = "\\u0041\\"; /* \u0041\ */ + +// +// ÿ - Unicode Character 'LATIN SMALL LETTER Y WITH DIAERESIS' (U+00FF) +// Ā - Unicode Character 'LATIN CAPITAL LETTER A WITH MACRON' (U+0100) +// ἀ - Unicode Character 'GREEK SMALL LETTER ALPHA WITH PSILI' (U+1F00) +// 𐆔 - Unicode Character 'ROMAN DIMIDIA SEXTULA SIGN' (U+10194) +// 𐅪 - Unicode Character 'GREEK ACROPHONIC THESPIAN ONE HUNDRED' (U+1016A) +// 𐆘 - Unicode Character 'ROMAN SESTERTIUS SIGN' (U+10198) +// 🍀 - Unicode Character 'FOUR LEAF CLOVER' (U+1F340) +// 🍁 - Unicode Character 'MAPLE LEAF' (U+1F341) +// 🍂 - Unicode Character 'FALLEN LEAF' (U+1F342) +// 🍃 - Unicode Character 'LEAF FLUTTERING IN WIND' (U+1F343) +const ["cpp:type:wstring"]string wsu0 = "ÿĀἀ𐆔𐅪𐆘🍀🍁🍂🍃"; +const ["cpp:type:wstring"]string wsu1 = "\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; +const ["cpp:type:wstring"]string wsu2 = "\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; + }; diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index df030eb030d..419320fdcc4 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -780,7 +780,6 @@ MyDerivedClassI::opMyClass1_async(const Test::AMD_MyDerivedClass_opMyClass1Ptr& cb->ice_response(c); } - void MyDerivedClassI::opStringLiterals_async(const Test::AMD_MyClass_opStringLiteralsPtr& cb, const Ice::Current&) @@ -821,4 +820,46 @@ MyDerivedClassI::opStringLiterals_async(const Test::AMD_MyClass_opStringLiterals data.push_back(Test::su1); data.push_back(Test::su2); cb->ice_response(data); -}
\ No newline at end of file +} + +void +MyDerivedClassI::opWStringLiterals_async(const Test::AMD_MyClass_opWStringLiteralsPtr& cb, + const Ice::Current&) +{ + Test::WStringS data; + data.push_back(Test::ws0); + data.push_back(Test::ws1); + data.push_back(Test::ws2); + data.push_back(Test::ws3); + data.push_back(Test::ws4); + data.push_back(Test::ws5); + data.push_back(Test::ws6); + data.push_back(Test::ws7); + data.push_back(Test::ws8); + data.push_back(Test::ws9); + data.push_back(Test::ws10); + + data.push_back(Test::wsw0); + data.push_back(Test::wsw1); + data.push_back(Test::wsw2); + data.push_back(Test::wsw3); + data.push_back(Test::wsw4); + data.push_back(Test::wsw5); + data.push_back(Test::wsw6); + data.push_back(Test::wsw7); + data.push_back(Test::wsw8); + data.push_back(Test::wsw9); + data.push_back(Test::wsw10); + + data.push_back(Test::wss0); + data.push_back(Test::wss1); + data.push_back(Test::wss2); + data.push_back(Test::wss3); + data.push_back(Test::wss4); + data.push_back(Test::wss5); + + data.push_back(Test::wsu0); + data.push_back(Test::wsu1); + data.push_back(Test::wsu2); + cb->ice_response(data); +} diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index 418d0a2aa36..686a76f00cd 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -278,6 +278,9 @@ public: virtual void opStringLiterals_async(const Test::AMD_MyClass_opStringLiteralsPtr&, const Ice::Current&); + + virtual void opWStringLiterals_async(const Test::AMD_MyClass_opWStringLiteralsPtr&, + const Ice::Current&); private: IceUtil::ThreadPtr _opVoidThread; diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 29e6728047b..84054ac8d45 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -782,3 +782,46 @@ MyDerivedClassI::opStringLiterals(const Ice::Current&) return data; } + +Test::WStringS +MyDerivedClassI::opWStringLiterals(const Ice::Current&) +{ + Test::WStringS data; + data.push_back(Test::ws0); + data.push_back(Test::ws1); + data.push_back(Test::ws2); + data.push_back(Test::ws3); + data.push_back(Test::ws4); + data.push_back(Test::ws5); + data.push_back(Test::ws6); + data.push_back(Test::ws7); + data.push_back(Test::ws8); + data.push_back(Test::ws9); + data.push_back(Test::ws10); + + data.push_back(Test::wsw0); + data.push_back(Test::wsw1); + data.push_back(Test::wsw2); + data.push_back(Test::wsw3); + data.push_back(Test::wsw4); + data.push_back(Test::wsw5); + data.push_back(Test::wsw6); + data.push_back(Test::wsw7); + data.push_back(Test::wsw8); + data.push_back(Test::wsw9); + data.push_back(Test::wsw10); + + data.push_back(Test::wss0); + data.push_back(Test::wss1); + data.push_back(Test::wss2); + data.push_back(Test::wss3); + data.push_back(Test::wss4); + data.push_back(Test::wss5); + + data.push_back(Test::wsu0); + data.push_back(Test::wsu1); + data.push_back(Test::wsu2); + + return data; +} + diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 4f31f7eecfe..8f8b0b1b573 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -270,6 +270,8 @@ public: virtual Test::MyClass1Ptr opMyClass1(const Test::MyClass1Ptr&, const Ice::Current&); virtual Test::StringS opStringLiterals(const Ice::Current&); + + virtual Test::WStringS opWStringLiterals(const Ice::Current&); private: diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 54d2d2d439a..379d808c520 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -135,11 +135,93 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) test(Test::ss5 == "\\u0041\\" && Test::ss5 == literals[27]); - test(Test::su0 == Test::su1); - test(Test::su0 == Test::su2); - test(Test::su0 == literals[28]); - test(Test::su0 == literals[29]); - test(Test::su0 == literals[30]); + test(Test::su0 == Test::su1 && + Test::su0 == Test::su2 && + Test::su0 == literals[28] && + Test::su0 == literals[29] && + Test::su0 == literals[30]); + + // + // Same but using wide strings + // + Test::WStringS wliterals = p->opWStringLiterals(); + + test(Test::ws0 == L"\\" && + Test::ws0 == Test::wsw0 && + Test::ws0 == wliterals[0] && + Test::ws0 == wliterals[11]); + + test(Test::ws1 == L"A" && + Test::ws1 == Test::wsw1 && + Test::ws1 == wliterals[1] && + Test::ws1 == wliterals[12]); + + test(Test::ws2 == L"Ice" && + Test::ws2 == Test::wsw2 && + Test::ws2 == wliterals[2] && + Test::ws2 == wliterals[13]); + + test(Test::ws3 == L"A21" && + Test::ws3 == Test::wsw3 && + Test::ws3 == wliterals[3] && + Test::ws3 == wliterals[14]); + + test(Test::ws4 == L"\\u0041 \\U00000041" && + Test::ws4 == Test::wsw4 && + Test::ws4 == wliterals[4] && + Test::ws4 == wliterals[15]); + + test(Test::ws5 == L"\u00FF" && + Test::ws5 == Test::wsw5 && + Test::ws5 == wliterals[5] && + Test::ws5 == wliterals[16]); + + test(Test::ws6 == L"\u03FF" && + Test::ws6 == Test::wsw6 && + Test::ws6 == wliterals[6] && + Test::ws6 == wliterals[17]); + + test(Test::ws7 == L"\u05F0" && + Test::ws7 == Test::wsw7 && + Test::ws7 == wliterals[7] && + Test::ws7 == wliterals[18]); + + test(Test::ws8 == L"\U00010000" && + Test::ws8 == Test::wsw8 && + Test::ws8 == wliterals[8] && + Test::ws8 == wliterals[19]); + + test(Test::ws9 == L"\U0001F34C" && + Test::ws9 == Test::wsw9 && + Test::ws9 == wliterals[9] && + Test::ws9 == wliterals[20]); + + test(Test::ws10 == L"\u0DA7" && + Test::ws10 == Test::wsw10 && + Test::ws10 == wliterals[10] && + Test::ws10 == wliterals[21]); + + test(Test::wss0 == L"\'\"\?\\\a\b\f\n\r\t\v" && + Test::wss0 == Test::wss1 && + Test::wss0 == Test::wss2 && + Test::wss0 == wliterals[22] && + Test::wss0 == wliterals[23] && + Test::wss0 == wliterals[24]); + + test(Test::wss3 == L"\\\\U\\u\\" && + Test::wss3 == wliterals[25]); + + test(Test::wss4 == L"\\A\\" && + Test::wss4 == wliterals[26]); + + test(Test::wss5 == L"\\u0041\\" && + Test::wss5 == wliterals[27]); + + test(Test::wsu0 == Test::wsu1 && + Test::wsu0 == Test::wsu2 && + Test::wsu0 == wliterals[28] && + Test::wsu0 == wliterals[29] && + Test::wsu0 == wliterals[30]); { p->ice_ping(); |