summaryrefslogtreecommitdiff
path: root/csharp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-08 13:46:55 +0100
committerJose <jose@zeroc.com>2016-03-08 13:46:55 +0100
commit2bd402833bfdb54c1940dd0038be8af05d6f5e6f (patch)
treeeb7be3853dc45452397b730e586434f6e859efb3 /csharp
parentWindows fixes for icegriddb/icestormdb (diff)
downloadice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.tar.bz2
ice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.tar.xz
ice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.zip
ICE-6991 - Add support for unicode escape sequences
Diffstat (limited to 'csharp')
-rw-r--r--csharp/test/Ice/operations/MyDerivedClassAMDI.cs42
-rw-r--r--csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs41
-rw-r--r--csharp/test/Ice/operations/MyDerivedClassI.cs41
-rw-r--r--csharp/test/Ice/operations/MyDerivedClassTieI.cs41
-rw-r--r--csharp/test/Ice/operations/Test.ice67
-rw-r--r--csharp/test/Ice/operations/TestAMD.ice67
-rw-r--r--csharp/test/Ice/operations/Twoways.cs85
7 files changed, 382 insertions, 2 deletions
diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs
index 41744244172..f7d9f4b267e 100644
--- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs
+++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs
@@ -868,6 +868,48 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass
{
cb.ice_response(value);
}
+
+
+ public override void opStringLiterals_async(Test.AMD_MyClass_opStringLiterals cb, Ice.Current current)
+ {
+ cb.ice_response(new string[]
+ {
+ Test.s0.value,
+ Test.s1.value,
+ Test.s2.value,
+ Test.s3.value,
+ Test.s4.value,
+ Test.s5.value,
+ Test.s6.value,
+ Test.s7.value,
+ Test.s8.value,
+ Test.s9.value,
+ Test.s10.value,
+
+ Test.sw0.value,
+ Test.sw1.value,
+ Test.sw2.value,
+ Test.sw3.value,
+ Test.sw4.value,
+ Test.sw5.value,
+ Test.sw6.value,
+ Test.sw7.value,
+ Test.sw8.value,
+ Test.sw9.value,
+ Test.sw10.value,
+
+ Test.ss0.value,
+ Test.ss1.value,
+ Test.ss2.value,
+ Test.ss3.value,
+ Test.ss4.value,
+ Test.ss5.value,
+
+ Test.su0.value,
+ Test.su1.value,
+ Test.su2.value
+ });
+ }
private Thread_opVoid _opVoidThread;
private int _opByteSOnewayCallCount = 0;
diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs
index 40c15c33790..984b168ba28 100644
--- a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs
+++ b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs
@@ -847,6 +847,47 @@ public sealed class MyDerivedClassTieI : Test.MyDerivedClassOperations_
{
cb.ice_response(value);
}
+
+ public void opStringLiterals_async(Test.AMD_MyClass_opStringLiterals cb, Ice.Current current)
+ {
+ cb.ice_response(new string[]
+ {
+ Test.s0.value,
+ Test.s1.value,
+ Test.s2.value,
+ Test.s3.value,
+ Test.s4.value,
+ Test.s5.value,
+ Test.s6.value,
+ Test.s7.value,
+ Test.s8.value,
+ Test.s9.value,
+ Test.s10.value,
+
+ Test.sw0.value,
+ Test.sw1.value,
+ Test.sw2.value,
+ Test.sw3.value,
+ Test.sw4.value,
+ Test.sw5.value,
+ Test.sw6.value,
+ Test.sw7.value,
+ Test.sw8.value,
+ Test.sw9.value,
+ Test.sw10.value,
+
+ Test.ss0.value,
+ Test.ss1.value,
+ Test.ss2.value,
+ Test.ss3.value,
+ Test.ss4.value,
+ Test.ss5.value,
+
+ Test.su0.value,
+ Test.su1.value,
+ Test.su2.value
+ });
+ }
private Thread_opVoid _opVoidThread;
private int _opByteSOnewayCallCount = 0;
diff --git a/csharp/test/Ice/operations/MyDerivedClassI.cs b/csharp/test/Ice/operations/MyDerivedClassI.cs
index 640e73a07e2..07a182741cb 100644
--- a/csharp/test/Ice/operations/MyDerivedClassI.cs
+++ b/csharp/test/Ice/operations/MyDerivedClassI.cs
@@ -829,6 +829,47 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass
{
return s;
}
+
+ public override string[] opStringLiterals(Ice.Current current)
+ {
+ return new string[]
+ {
+ Test.s0.value,
+ Test.s1.value,
+ Test.s2.value,
+ Test.s3.value,
+ Test.s4.value,
+ Test.s5.value,
+ Test.s6.value,
+ Test.s7.value,
+ Test.s8.value,
+ Test.s9.value,
+ Test.s10.value,
+
+ Test.sw0.value,
+ Test.sw1.value,
+ Test.sw2.value,
+ Test.sw3.value,
+ Test.sw4.value,
+ Test.sw5.value,
+ Test.sw6.value,
+ Test.sw7.value,
+ Test.sw8.value,
+ Test.sw9.value,
+ Test.sw10.value,
+
+ Test.ss0.value,
+ Test.ss1.value,
+ Test.ss2.value,
+ Test.ss3.value,
+ Test.ss4.value,
+ Test.ss5.value,
+
+ Test.su0.value,
+ Test.su1.value,
+ Test.su2.value
+ };
+ }
private int _opByteSOnewayCallCount = 0;
}
diff --git a/csharp/test/Ice/operations/MyDerivedClassTieI.cs b/csharp/test/Ice/operations/MyDerivedClassTieI.cs
index f3b602b6428..7d36de46c69 100644
--- a/csharp/test/Ice/operations/MyDerivedClassTieI.cs
+++ b/csharp/test/Ice/operations/MyDerivedClassTieI.cs
@@ -804,6 +804,47 @@ public sealed class MyDerivedClassTieI : Test.MyDerivedClassOperations_
{
return s;
}
+
+ public string[] opStringLiterals(Ice.Current current)
+ {
+ return new string[]
+ {
+ Test.s0.value,
+ Test.s1.value,
+ Test.s2.value,
+ Test.s3.value,
+ Test.s4.value,
+ Test.s5.value,
+ Test.s6.value,
+ Test.s7.value,
+ Test.s8.value,
+ Test.s9.value,
+ Test.s10.value,
+
+ Test.sw0.value,
+ Test.sw1.value,
+ Test.sw2.value,
+ Test.sw3.value,
+ Test.sw4.value,
+ Test.sw5.value,
+ Test.sw6.value,
+ Test.sw7.value,
+ Test.sw8.value,
+ Test.sw9.value,
+ Test.sw10.value,
+
+ Test.ss0.value,
+ Test.ss1.value,
+ Test.ss2.value,
+ Test.ss3.value,
+ Test.ss4.value,
+ Test.ss5.value,
+
+ Test.su0.value,
+ Test.su1.value,
+ Test.su2.value
+ };
+ }
private int _opByteSOnewayCallCount = 0;
}
diff --git a/csharp/test/Ice/operations/Test.ice b/csharp/test/Ice/operations/Test.ice
index e8cbcc5a56e..d085b4b2cd3 100644
--- a/csharp/test/Ice/operations/Test.ice
+++ b/csharp/test/Ice/operations/Test.ice
@@ -251,6 +251,8 @@ class MyClass
ByteBoolD opByteBoolD1(ByteBoolD opByteBoolD1);
StringS opStringS2(StringS stringS);
ByteBoolD opByteBoolD2(ByteBoolD byteBoolD);
+
+ StringS opStringLiterals();
};
struct MyStruct1
@@ -274,4 +276,69 @@ class MyDerivedClass extends MyClass
MyStruct1 opMyStruct1(MyStruct1 s);
};
+//
+// String literals
+//
+
+const string s0 = "\u005c"; // backslash
+const string s1 = "\u0041"; // A
+const string s2 = "\u0049\u0063\u0065"; // Ice
+const string s3 = "\u004121"; // A21
+const string s4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string s5 = "\u00FF"; // ÿ
+const string s6 = "\u03FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string s7 = "\u05F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string s8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string s9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string s10 = "\u0DA7"; // Sinhala Letter Alpapraana Ttayanna
+
+const string sw0 = "\U0000005c"; // backslash
+const string sw1 = "\U00000041"; // A
+const string sw2 = "\U00000049\U00000063\U00000065"; // Ice
+const string sw3 = "\U0000004121"; // A21
+const string sw4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string sw5 = "\U000000FF"; // ÿ
+const string sw6 = "\U000003FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string sw7 = "\U000005F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string sw8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string sw9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string sw10 = "\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 string ss0 = "\'\"\?\\\a\b\f\n\r\t\v";
+const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b";
+const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b";
+
+const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */
+const string ss4 = "\\\u0041\\"; /* \A\ */
+const string ss5 = "\\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 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";
+
};
diff --git a/csharp/test/Ice/operations/TestAMD.ice b/csharp/test/Ice/operations/TestAMD.ice
index 86ff8eb92ee..179834bcd5f 100644
--- a/csharp/test/Ice/operations/TestAMD.ice
+++ b/csharp/test/Ice/operations/TestAMD.ice
@@ -249,6 +249,8 @@ dictionary<MyEnum, MyEnumS> MyEnumMyEnumSD;
ByteBoolD opByteBoolD1(ByteBoolD opByteBoolD1);
StringS opStringS2(StringS stringS);
ByteBoolD opByteBoolD2(ByteBoolD byteBoolD);
+
+ StringS opStringLiterals();
};
struct MyStruct1
@@ -277,4 +279,69 @@ class MyClass1
Ice::Context getContext();
};
+//
+// String literals
+//
+
+const string s0 = "\u005c"; // backslash
+const string s1 = "\u0041"; // A
+const string s2 = "\u0049\u0063\u0065"; // Ice
+const string s3 = "\u004121"; // A21
+const string s4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string s5 = "\u00FF"; // ÿ
+const string s6 = "\u03FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string s7 = "\u05F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string s8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string s9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string s10 = "\u0DA7"; // Sinhala Letter Alpapraana Ttayanna
+
+const string sw0 = "\U0000005c"; // backslash
+const string sw1 = "\U00000041"; // A
+const string sw2 = "\U00000049\U00000063\U00000065"; // Ice
+const string sw3 = "\U0000004121"; // A21
+const string sw4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string sw5 = "\U000000FF"; // ÿ
+const string sw6 = "\U000003FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string sw7 = "\U000005F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string sw8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string sw9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string sw10 = "\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 string ss0 = "\'\"\?\\\a\b\f\n\r\t\v";
+const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b";
+const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b";
+
+const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */
+const string ss4 = "\\\u0041\\"; /* \A\ */
+const string ss5 = "\\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 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";
+
};
diff --git a/csharp/test/Ice/operations/Twoways.cs b/csharp/test/Ice/operations/Twoways.cs
index 5887239158c..25324cd2ca7 100644
--- a/csharp/test/Ice/operations/Twoways.cs
+++ b/csharp/test/Ice/operations/Twoways.cs
@@ -54,10 +54,91 @@ class Twoways
internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p)
{
+
+ string[] literals = p.opStringLiterals();
+
+ test(Test.s0.value.Equals("\\") &&
+ Test.s0.value.Equals(Test.sw0.value) &&
+ Test.s0.value.Equals(literals[0]) &&
+ Test.s0.value.Equals(literals[11]));
+
+ test(Test.s1.value.Equals("A") &&
+ Test.s1.value.Equals(Test.sw1.value) &&
+ Test.s1.value.Equals(literals[1]) &&
+ Test.s1.value.Equals(literals[12]));
+
+ test(Test.s2.value.Equals("Ice") &&
+ Test.s2.value.Equals(Test.sw2.value) &&
+ Test.s2.value.Equals(literals[2]) &&
+ Test.s2.value.Equals(literals[13]));
+
+ test(Test.s3.value.Equals("A21") &&
+ Test.s3.value.Equals(Test.sw3.value) &&
+ Test.s3.value.Equals(literals[3]) &&
+ Test.s3.value.Equals(literals[14]));
+
+ test(Test.s4.value.Equals("\\u0041 \\U00000041") &&
+ Test.s4.value.Equals(Test.sw4.value) &&
+ Test.s4.value.Equals(literals[4]) &&
+ Test.s4.value.Equals(literals[15]));
+
+ test(Test.s5.value.Equals("\u00FF") &&
+ Test.s5.value.Equals(Test.sw5.value) &&
+ Test.s5.value.Equals(literals[5]) &&
+ Test.s5.value.Equals(literals[16]));
+
+ test(Test.s6.value.Equals("\u03FF") &&
+ Test.s6.value.Equals(Test.sw6.value) &&
+ Test.s6.value.Equals(literals[6]) &&
+ Test.s6.value.Equals(literals[17]));
+
+ test(Test.s7.value.Equals("\u05F0") &&
+ Test.s7.value.Equals(Test.sw7.value) &&
+ Test.s7.value.Equals(literals[7]) &&
+ Test.s7.value.Equals(literals[18]));
+
+ test(Test.s8.value.Equals("\U00010000") &&
+ Test.s8.value.Equals(Test.sw8.value) &&
+ Test.s8.value.Equals(literals[8]) &&
+ Test.s8.value.Equals(literals[19]));
+
+ test(Test.s9.value.Equals("\U0001F34C") &&
+ Test.s9.value.Equals(Test.sw9.value) &&
+ Test.s9.value.Equals(literals[9]) &&
+ Test.s9.value.Equals(literals[20]));
+
+ test(Test.s10.value.Equals("\u0DA7") &&
+ Test.s10.value.Equals(Test.sw10.value) &&
+ Test.s10.value.Equals(literals[10]) &&
+ Test.s10.value.Equals(literals[21]));
+
+ test(Test.ss0.value.Equals("\'\"\u003f\\\a\b\f\n\r\t\v") &&
+ Test.ss0.value.Equals(Test.ss1.value) &&
+ Test.ss0.value.Equals(Test.ss2.value) &&
+ Test.ss0.value.Equals(literals[22]) &&
+ Test.ss0.value.Equals(literals[23]) &&
+ Test.ss0.value.Equals(literals[24]));
+
+ test(Test.ss3.value.Equals("\\\\U\\u\\") &&
+ Test.ss3.value.Equals(literals[25]));
+
+ test(Test.ss4.value.Equals("\\A\\") &&
+ Test.ss4.value.Equals(literals[26]));
+
+ test(Test.ss5.value.Equals("\\u0041\\") &&
+ Test.ss5.value.Equals(literals[27]));
+
+ test(Test.su0.value.Equals(Test.su1.value) &&
+ Test.su0.value.Equals(Test.su2.value) &&
+ Test.su0.value.Equals(literals[28]) &&
+ Test.su0.value.Equals(literals[29]) &&
+ Test.su0.value.Equals(literals[30]));
+
p.ice_ping();
- test(Test.MyClassPrxHelper.ice_staticId().Equals(Test.MyClass.ice_staticId()));
- test(Ice.ObjectPrxHelper.ice_staticId().Equals(Ice.ObjectImpl.ice_staticId()));
+
+ test(Test.MyClassPrxHelper.ice_staticId().Equals(Test.MyClass.ice_staticId()));
+ test(Ice.ObjectPrxHelper.ice_staticId().Equals(Ice.ObjectImpl.ice_staticId()));
test(p.ice_isA(Test.MyClass.ice_staticId()));