mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
Compare commits
266
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbd64296dc | ||
|
|
19130f7816 | ||
|
|
4fd72b41e7 | ||
|
|
c02307527f | ||
|
|
e82dc9b80a | ||
|
|
58a0d6c0f4 | ||
|
|
588a9dfb97 | ||
|
|
070414b678 | ||
|
|
924615b32a | ||
|
|
c9a6d708a9 | ||
|
|
749a6d407e | ||
|
|
4a1653412f | ||
|
|
ec95d97fa6 | ||
|
|
b72b8b187d | ||
|
|
a3bcbb7b58 | ||
|
|
74ea9f56e3 | ||
|
|
537f1de77a | ||
|
|
c39fc0cecc | ||
|
|
b2cd2b28fc | ||
|
|
67805650b9 | ||
|
|
ec3afb7da4 | ||
|
|
6a6343c5da | ||
|
|
d0f6e32026 | ||
|
|
413cb9b41a | ||
|
|
5382fc7b11 | ||
|
|
f215040500 | ||
|
|
1ba5bc6aa7 | ||
|
|
f41fa10aa8 | ||
|
|
4c84f3c99d | ||
|
|
312c249d36 | ||
|
|
fa0059bb83 | ||
|
|
f180a0aa3b | ||
|
|
b17dda2348 | ||
|
|
864629bacd | ||
|
|
9871c89692 | ||
|
|
90d7758e2e | ||
|
|
8eff004670 | ||
|
|
d3f3d95a1c | ||
|
|
a88262b52b | ||
|
|
8486317e0b | ||
|
|
7d8a09f2ed | ||
|
|
393fd6001e | ||
|
|
cd90e8c706 | ||
|
|
f902ecd5be | ||
|
|
595392d965 | ||
|
|
557e9f5c0b | ||
|
|
2701b19413 | ||
|
|
6dec86a023 | ||
|
|
70c6478d97 | ||
|
|
c24df31a2d | ||
|
|
a832ca5578 | ||
|
|
90877bd0fb | ||
|
|
fb9b4f8789 | ||
|
|
ae33495a12 | ||
|
|
9173d8aa78 | ||
|
|
9b990f2b19 | ||
|
|
296bc43db3 | ||
|
|
bb2eacec40 | ||
|
|
6f87943866 | ||
|
|
d3e75456b3 | ||
|
|
f4de388789 | ||
|
|
801e6f8760 | ||
|
|
b81f846775 | ||
|
|
4ca894aaf4 | ||
|
|
0c74c0342c | ||
|
|
cdc35fc76b | ||
|
|
7e42365186 | ||
|
|
1d2c58215f | ||
|
|
220b9ba759 | ||
|
|
0b1360c8e3 | ||
|
|
cff09392e1 | ||
|
|
08b7103fef | ||
|
|
4b31a4cd57 | ||
|
|
a22465351b | ||
|
|
4fd7f72a55 | ||
|
|
5345159fdd | ||
|
|
34ea1c350f | ||
|
|
917c8f6b12 | ||
|
|
66ddca9cbc | ||
|
|
880b0ddde1 | ||
|
|
644d8d6571 | ||
|
|
b4ff1e3d0f | ||
|
|
05d33f1888 | ||
|
|
afdc35694b | ||
|
|
14804f4582 | ||
|
|
044b879cfb | ||
|
|
186ce2fc46 | ||
|
|
0900418353 | ||
|
|
12eefdae82 | ||
|
|
a1c8874b2c | ||
|
|
376b2c32bb | ||
|
|
5048da46fe | ||
|
|
eede15eb71 | ||
|
|
5bcb420286 | ||
|
|
3f07b978c4 | ||
|
|
0d47e98ca4 | ||
|
|
abc5449308 | ||
|
|
5bcc48192c | ||
|
|
ac5452a1b9 | ||
|
|
b892a92153 | ||
|
|
8abcfa68f6 | ||
|
|
012cc7f646 | ||
|
|
3396738374 | ||
|
|
64e24dffc1 | ||
|
|
33a75810b5 | ||
|
|
2d1c17d47e | ||
|
|
c133880bc4 | ||
|
|
6b6e7ca19e | ||
|
|
c109f9ca03 | ||
|
|
3b17abfb9b | ||
|
|
8331376182 | ||
|
|
84b3dda86f | ||
|
|
e8c3f7719e | ||
|
|
ae9fcd19f0 | ||
|
|
5a5d899da0 | ||
|
|
bf863dbc46 | ||
|
|
362468798c | ||
|
|
118291ff5d | ||
|
|
2610994023 | ||
|
|
53b8083989 | ||
|
|
59f2da8400 | ||
|
|
44ba163605 | ||
|
|
8373e4943d | ||
|
|
65b1b10846 | ||
|
|
3409240895 | ||
|
|
3a7212a46e | ||
|
|
24b917c8a1 | ||
|
|
2efa0cc807 | ||
|
|
5f01b80b43 | ||
|
|
b3838e42d1 | ||
|
|
eb2aad684f | ||
|
|
080036d99b | ||
|
|
eafd3db1ab | ||
|
|
1f85a26443 | ||
|
|
27b4ff05b6 | ||
|
|
c59699fa3b | ||
|
|
5fa2f04f19 | ||
|
|
e665f8967e | ||
|
|
cb6829d336 | ||
|
|
2fabccfb08 | ||
|
|
9391cdcd27 | ||
|
|
86084a1870 | ||
|
|
c68e23c85c | ||
|
|
72275b5e74 | ||
|
|
8a26b5a034 | ||
|
|
20cf9e3dbf | ||
|
|
510f4d4f71 | ||
|
|
ec44efbd8d | ||
|
|
1ca4d2bc72 | ||
|
|
9f936798b8 | ||
|
|
4400165ac2 | ||
|
|
29de937efd | ||
|
|
9c9500fe48 | ||
|
|
b440f7a673 | ||
|
|
eabc704b94 | ||
|
|
235168ae74 | ||
|
|
9c71282be7 | ||
|
|
e4c78936cd | ||
|
|
40024f85b8 | ||
|
|
23e0541b01 | ||
|
|
0d045cb82b | ||
|
|
44a3f5cb6a | ||
|
|
3784c69c2f | ||
|
|
2c821dd384 | ||
|
|
1d9c46ad68 | ||
|
|
c68dc66765 | ||
|
|
95cb416bbf | ||
|
|
add93988d1 | ||
|
|
f3fd8cb951 | ||
|
|
f8f6a0d431 | ||
|
|
b261748f35 | ||
|
|
f822059758 | ||
|
|
e882a125ee | ||
|
|
554247cd6a | ||
|
|
7c7b648cf1 | ||
|
|
815079d694 | ||
|
|
4e13efc5de | ||
|
|
83af81148a | ||
|
|
cbf56e58ce | ||
|
|
7128850271 | ||
|
|
4c276327d3 | ||
|
|
1e9aea859d | ||
|
|
b67536d46e | ||
|
|
4dcaef892a | ||
|
|
f2b1ae76b5 | ||
|
|
88a3f06371 | ||
|
|
2bc21e8d37 | ||
|
|
9f552c56d4 | ||
|
|
e3fec9e89d | ||
|
|
0844ab738a | ||
|
|
2b4bd5351e | ||
|
|
ffb69e3ed0 | ||
|
|
5a20bf3669 | ||
|
|
aac7b3d216 | ||
|
|
abe3adff5f | ||
|
|
5e0a6c3b13 | ||
|
|
370d4195f0 | ||
|
|
18c9d7d27f | ||
|
|
80dc792e4c | ||
|
|
e821deecbc | ||
|
|
be33fcad91 | ||
|
|
0d209f09ad | ||
|
|
7830885e02 | ||
|
|
7dc9cf81bc | ||
|
|
0c3c93efb5 | ||
|
|
9e9fecc45a | ||
|
|
fb56b1a52f | ||
|
|
ecd44a1678 | ||
|
|
888874ab45 | ||
|
|
4e98727a7d | ||
|
|
3903d320ec | ||
|
|
16d09c2059 | ||
|
|
6b8a4e5f3c | ||
|
|
79c20ee775 | ||
|
|
05f2e5e522 | ||
|
|
42ca455df2 | ||
|
|
4ad996b1e1 | ||
|
|
95333c0a5c | ||
|
|
09212389e2 | ||
|
|
ed5e137a72 | ||
|
|
5e097d4d49 | ||
|
|
a112354a21 | ||
|
|
7128196f5c | ||
|
|
604017a71d | ||
|
|
8ccfe0f8ff | ||
|
|
1daadd26c5 | ||
|
|
3c7f754d94 | ||
|
|
fa2f8d903d | ||
|
|
f1ffee0453 | ||
|
|
31d5a3eaf4 | ||
|
|
2d4f6b3442 | ||
|
|
87e9d0314a | ||
|
|
339f080a2a | ||
|
|
ebd6235cd3 | ||
|
|
ece83305f8 | ||
|
|
b7a2903b28 | ||
|
|
65c54d2d84 | ||
|
|
de99b00081 | ||
|
|
679e726432 | ||
|
|
6d52dee3d4 | ||
|
|
ec55965085 | ||
|
|
8a63d50e64 | ||
|
|
6604c8c595 | ||
|
|
146772f894 | ||
|
|
b956524379 | ||
|
|
82c2ba94d3 | ||
|
|
96df0a76c4 | ||
|
|
166dca4754 | ||
|
|
5318b06bda | ||
|
|
8c31e362af | ||
|
|
59adeedd90 | ||
|
|
74cd6414be | ||
|
|
57e4ed9c5d | ||
|
|
0bf72ac919 | ||
|
|
94e31f159f | ||
|
|
a7c3e83d98 | ||
|
|
f7816d844a | ||
|
|
6bfb7e6d14 | ||
|
|
5d93b2a292 | ||
|
|
f3e35f228c | ||
|
|
6efe705614 | ||
|
|
7bb3b98f58 | ||
|
|
3d47daa63d | ||
|
|
e22887717f | ||
|
|
01dcc6c162 | ||
|
|
5b12d9ae37 |
No files matched your search
@@ -497,3 +497,4 @@ to do at all), first edit `.gitmodules` to point to the new location, then:
|
||||
The desired output diff is a change in `.gitmodules` to reflect the
|
||||
change in the remote URL, and a change in /<submodule> where you see
|
||||
the desired change in the commit hash.
|
||||
|
||||
+16
-12
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [4.3.0],
|
||||
AC_INIT(mono, [4.2.1],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -3491,10 +3491,11 @@ case "x$libgc" in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes])
|
||||
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
|
||||
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
|
||||
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
|
||||
AC_ARG_WITH(profile4_5, [ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes])
|
||||
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
|
||||
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
|
||||
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=no])
|
||||
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
|
||||
|
||||
OPROFILE=no
|
||||
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to no)],[
|
||||
@@ -3574,6 +3575,7 @@ if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
|
||||
with_profile4_5=no
|
||||
with_monodroid=no
|
||||
with_monotouch=no
|
||||
with_monotouch_watch=no
|
||||
with_xammac=no
|
||||
fi
|
||||
|
||||
@@ -3596,6 +3598,7 @@ libmono_ldflags="$libmono_ldflags $LIBS"
|
||||
AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes])
|
||||
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
|
||||
|
||||
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
|
||||
@@ -4008,13 +4011,14 @@ echo "
|
||||
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
|
||||
|
||||
Libraries:
|
||||
.NET 4.5: $with_profile4_5
|
||||
MonoDroid: $with_monodroid
|
||||
MonoTouch: $with_monotouch
|
||||
Xamarin.Mac: $with_xammac
|
||||
JNI support: $jdk_headers_found
|
||||
libgdiplus: $libgdiplus_msg
|
||||
zlib: $zlib_msg
|
||||
.NET 4.5: $with_profile4_5
|
||||
MonoDroid: $with_monodroid
|
||||
Xamarin.iOS: $with_monotouch
|
||||
Xamarin.WatchOS: $with_monotouch_watch
|
||||
Xamarin.Mac: $with_xammac
|
||||
JNI support: $jdk_headers_found
|
||||
libgdiplus: $libgdiplus_msg
|
||||
zlib: $zlib_msg
|
||||
$disabled
|
||||
"
|
||||
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
|
||||
|
||||
@@ -144,7 +144,8 @@ public enum Lock {
|
||||
AssemblyBindingLock,
|
||||
MarshalLock,
|
||||
ClassesLock,
|
||||
LoaderGlobalDataLock
|
||||
LoaderGlobalDataLock,
|
||||
ThreadsLock,
|
||||
}
|
||||
|
||||
public class SimLock
|
||||
@@ -242,7 +243,24 @@ public class SimLock
|
||||
}
|
||||
|
||||
public override string ToString () {
|
||||
return String.Format ("{0}", kind);
|
||||
switch (kind) {
|
||||
case Lock.LoaderLock:
|
||||
case Lock.IcallLock:
|
||||
case Lock.AssemblyBindingLock:
|
||||
case Lock.MarshalLock:
|
||||
case Lock.ClassesLock:
|
||||
case Lock.LoaderGlobalDataLock:
|
||||
case Lock.ThreadsLock:
|
||||
return String.Format ("{0}", kind);
|
||||
|
||||
case Lock.ImageDataLock:
|
||||
case Lock.DomainLock:
|
||||
case Lock.DomainAssembliesLock:
|
||||
case Lock.DomainJitCodeHashLock:
|
||||
return String.Format ("{0}[{1}]", kind, id);
|
||||
default:
|
||||
return String.Format ("Unknown({0})[{1}]", kind, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,6 +329,10 @@ public class Trace {
|
||||
"add_record",
|
||||
"mono_locks_lock_acquired",
|
||||
"mono_locks_lock_released",
|
||||
"mono_threads_lock",
|
||||
"mono_threads_unlock",
|
||||
"mono_domain_lock",
|
||||
"mono_domain_unlock",
|
||||
};
|
||||
|
||||
public Trace (string[] fields) {
|
||||
|
||||
Vendored
+1
-1
Submodule external/ikvm updated: dab43d5cf4...d6b00edf21.
Vendored
+1
-1
Submodule external/referencesource updated: 42504b8af5...906778312b.
@@ -337,6 +337,10 @@ version
|
||||
.IP \[bu] 2
|
||||
\f[I]thread\f[]: thread information
|
||||
.IP \[bu] 2
|
||||
\f[I]domain\f[]: app domain information
|
||||
.IP \[bu] 2
|
||||
\f[I]context\f[]: remoting context information
|
||||
.IP \[bu] 2
|
||||
\f[I]heapshot\f[]: live heap usage at heap shots
|
||||
.IP \[bu] 2
|
||||
\f[I]counters\f[]: counters samples
|
||||
|
||||
@@ -6,7 +6,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
# Use system resgen as we don't want local System.Windows.Forms dependency
|
||||
RESGEN = resgen2
|
||||
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
@@ -6,7 +6,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
# Use system resgen as we don't want local System.Windows.Forms dependency
|
||||
RESGEN = resgen2
|
||||
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
|
||||
|
||||
# nuttzing!
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
# Use system resgen as we don't want local System.Windows.Forms dependency
|
||||
RESGEN = resgen2
|
||||
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
+1
-1
@@ -46,6 +46,7 @@ mobile_common_dirs := \
|
||||
System.ComponentModel.DataAnnotations \
|
||||
System.ComponentModel.Composition.4.5 \
|
||||
System.Net \
|
||||
System.Net.Http \
|
||||
System.Windows \
|
||||
System.Xml.Serialization \
|
||||
Mono.CSharp \
|
||||
@@ -59,7 +60,6 @@ mobile_static_dirs := \
|
||||
mobile_dynamic_dirs := \
|
||||
$(mobile_common_dirs) \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
System.Net.Http
|
||||
|
||||
xammac_dirs := \
|
||||
$(mobile_dynamic_dirs)
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
BuildItemGroup big;
|
||||
BuildItem bi = new BuildItem (this);
|
||||
bi.finalItemSpec = ((ITaskItem2)taskitem).EvaluatedIncludeEscaped;
|
||||
bi.finalItemSpec = taskitem.ItemSpec;
|
||||
|
||||
foreach (DictionaryEntry de in taskitem.CloneCustomMetadata ()) {
|
||||
bi.unevaluatedMetadata.Add ((string) de.Key, (string) de.Value);
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
for (int i = 0; i < lists.Count; i++) {
|
||||
foreach (object o in lists [i]) {
|
||||
if (o is string)
|
||||
expressionCollection.Add ((string) o);
|
||||
expressionCollection.Add (MSBuildUtils.Unescape ((string) o));
|
||||
else if (!allowItems && o is ItemReference)
|
||||
expressionCollection.Add (((ItemReference) o).OriginalString);
|
||||
else if (!allowMd && o is MetadataReference) {
|
||||
|
||||
+2
-2
@@ -233,11 +233,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
// Trim and Remove empty items
|
||||
List<ITaskItem> toRemove = new List<ITaskItem> ();
|
||||
for (int i = 0; i < finalItems.Count; i ++) {
|
||||
string s = ((ITaskItem2)finalItems [i]).EvaluatedIncludeEscaped.Trim ();
|
||||
string s = finalItems [i].ItemSpec.Trim ();
|
||||
if (s.Length == 0)
|
||||
toRemove.Add (finalItems [i]);
|
||||
else
|
||||
((ITaskItem2)finalItems [i]).EvaluatedIncludeEscaped = s;
|
||||
finalItems [i].ItemSpec = s;
|
||||
}
|
||||
foreach (ITaskItem ti in toRemove)
|
||||
finalItems.Remove (ti);
|
||||
|
||||
@@ -208,9 +208,36 @@ namespace Microsoft.Build.Tasks {
|
||||
if (!TryGetSpecificVersionValue (item, out specific_version))
|
||||
return null;
|
||||
|
||||
var spath_index = 0;
|
||||
foreach (string spath in search_paths) {
|
||||
if (string.IsNullOrEmpty (spath))
|
||||
continue;
|
||||
assembly_resolver.LogSearchMessage ("For searchpath {0}", spath);
|
||||
|
||||
// The first value of search_paths can be the parent assembly directory.
|
||||
// In that case the value would be treated as a directory.
|
||||
// This code checks if we should treat the value as a TargetFramework assembly.
|
||||
// Doing so avoids CopyLocal beeing set to true.
|
||||
if (spath_index++ == 0 && targetFrameworkDirectories != null) {
|
||||
foreach (string fpath in targetFrameworkDirectories) {
|
||||
if (string.IsNullOrEmpty (fpath))
|
||||
continue;
|
||||
if (String.Compare (
|
||||
Path.GetFullPath (spath).TrimEnd (Path.DirectorySeparatorChar),
|
||||
Path.GetFullPath (fpath).TrimEnd (Path.DirectorySeparatorChar),
|
||||
StringComparison.InvariantCulture) != 0)
|
||||
continue;
|
||||
|
||||
resolved = assembly_resolver.FindInTargetFramework (item,
|
||||
fpath, specific_version);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (resolved != null)
|
||||
break;
|
||||
}
|
||||
|
||||
if (String.Compare (spath, "{HintPathFromItem}") == 0) {
|
||||
resolved = assembly_resolver.ResolveHintPathReference (item, specific_version);
|
||||
} else if (String.Compare (spath, "{TargetFrameworkDirectory}") == 0) {
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
<Message Text='Text5' Importance='normal'/>
|
||||
<Message Text='Text6' Importance='high'/>
|
||||
<Message Text='Text7' />
|
||||
<Message Text='%22abc test%22 123 %22def%22' />
|
||||
<Message Text='Text8' Importance='weird_importance'/>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -102,7 +103,8 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text5", MessageImportance.Normal), "A5");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text6", MessageImportance.High), "A6");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text7", MessageImportance.Normal), "A7");
|
||||
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A8");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("\"abc test\" 123 \"def\"", MessageImportance.Normal), "A8");
|
||||
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A9");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")] // this fails due to an xbuild bug, it works on MS.NET
|
||||
public void TestLineWithEscapedSemicolon ()
|
||||
{
|
||||
string[] lines = new string[] { "abc%3Btest%3B%3B", "%3Bdef" };
|
||||
@@ -101,6 +102,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")] // this fails due to an xbuild bug, it works on MS.NET
|
||||
public void TestLineWithEscapedSpace ()
|
||||
{
|
||||
string[] lines = new string[] { " %20%20abc%20test ", " def%20%20" };
|
||||
@@ -110,6 +112,16 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLineWithEscapedQuote ()
|
||||
{
|
||||
string[] lines = new string[] { "%22abc test%22 123 %22def%22" };
|
||||
CreateProjectAndCheck (full_filepath, lines, false, true, delegate () {
|
||||
CheckFileExists (full_filepath, true);
|
||||
CheckLines (full_filepath, new string [] {"\"abc test\" 123 \"def\""});
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNoOverwrite ()
|
||||
{
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Microsoft.Build.Utilities
|
||||
}
|
||||
public override string ToString ()
|
||||
{
|
||||
return ItemSpec;
|
||||
return escapedItemSpec;
|
||||
}
|
||||
|
||||
public string ItemSpec {
|
||||
|
||||
@@ -92,14 +92,12 @@ namespace MonoTests.Mono.Data.Sqlite {
|
||||
Assert.AreEqual(dr["Company.Name"], "Test CO");
|
||||
i += 2;
|
||||
}
|
||||
Assert.IsTrue(dr.FieldCount>0);
|
||||
Assert.IsTrue(dr.FieldCount>0, i.ToString ());
|
||||
}
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8, 2))
|
||||
Assert.IsTrue (false, "Apple fixed bug 27864, this check can now be removed");
|
||||
}
|
||||
} catch (SqliteException ex) {
|
||||
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8, 2)) // Expected Exception on iOS 8.2+, if this does not happen anymore it means apple fixed it
|
||||
// Expected Exception from iOS 8.2 (broken) to 9.0 (fixed)
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8,2) && !BCL.Tests.TestRuntime.CheckSystemVersion (9,0))
|
||||
Assert.That (ex.Message.Contains ("no such column: com.Name"));
|
||||
else
|
||||
throw new AssertionException ("Unexpected Sqlite Error", ex); // This should not happen
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace Mono.Debugger.Soft
|
||||
* with newer runtimes, and vice versa.
|
||||
*/
|
||||
internal const int MAJOR_VERSION = 2;
|
||||
internal const int MINOR_VERSION = 40;
|
||||
internal const int MINOR_VERSION = 41;
|
||||
|
||||
enum WPSuspendPolicy {
|
||||
NONE = 0,
|
||||
@@ -801,6 +801,13 @@ namespace Mono.Debugger.Soft
|
||||
return res;
|
||||
}
|
||||
|
||||
public string ReadUTF16String () {
|
||||
int len = decode_int (packet, ref offset);
|
||||
string res = new String (Encoding.Unicode.GetChars (packet, offset, len));
|
||||
offset += len;
|
||||
return res;
|
||||
}
|
||||
|
||||
public ValueImpl ReadValue () {
|
||||
ElementType etype = (ElementType)ReadByte ();
|
||||
|
||||
@@ -2418,7 +2425,16 @@ namespace Mono.Debugger.Soft
|
||||
* STRINGS
|
||||
*/
|
||||
internal string String_GetValue (long id) {
|
||||
return SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id)).ReadString ();
|
||||
var r = SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id));
|
||||
|
||||
bool is_utf16 = false;
|
||||
if (Version.AtLeast (2, 41))
|
||||
is_utf16 = r.ReadByte () == 1;
|
||||
|
||||
if (is_utf16)
|
||||
return r.ReadUTF16String ();
|
||||
else
|
||||
return r.ReadString ();
|
||||
}
|
||||
|
||||
internal int String_GetLength (long id) {
|
||||
|
||||
@@ -86,6 +86,22 @@ public struct AStruct : ITest2 {
|
||||
public byte k;
|
||||
public IntPtr j;
|
||||
public int l;
|
||||
/*
|
||||
public AStruct () {
|
||||
i = 0;
|
||||
s = null;
|
||||
k = 0;
|
||||
j = IntPtr.Zero;
|
||||
l = 0;
|
||||
}
|
||||
*/
|
||||
public AStruct (int arg) {
|
||||
i = arg;
|
||||
s = null;
|
||||
k = 0;
|
||||
j = IntPtr.Zero;
|
||||
l = 0;
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public int foo (int val) {
|
||||
@@ -582,7 +598,7 @@ public class Tests : TestsBase, ITest2
|
||||
public static void arguments () {
|
||||
arg1 (SByte.MaxValue - 5, Byte.MaxValue - 5, true, Int16.MaxValue - 5, UInt16.MaxValue - 5, 'F', Int32.MaxValue - 5, UInt32.MaxValue - 5, Int64.MaxValue - 5, UInt64.MaxValue - 5, 1.2345f, 6.78910, new IntPtr (Int32.MaxValue - 5), new UIntPtr (UInt32.MaxValue - 5));
|
||||
int i = 42;
|
||||
arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
|
||||
arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object (), '\0'.ToString () + "A");
|
||||
Tests t = new Tests () { field_i = 42, field_s = "S" };
|
||||
t.arg3 ("BLA");
|
||||
}
|
||||
@@ -593,7 +609,7 @@ public class Tests : TestsBase, ITest2
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
|
||||
public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2, string s4) {
|
||||
return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
|
||||
}
|
||||
|
||||
|
||||
@@ -2286,6 +2286,12 @@ public class DebuggerTests
|
||||
v = s.InvokeMethod (e.Thread, m, null);
|
||||
AssertValue (42, v);
|
||||
|
||||
// Pass boxed struct as this
|
||||
var boxed_this = t.NewInstance () as ObjectMirror;
|
||||
m = t.GetMethod ("invoke_return_int");
|
||||
v = boxed_this.InvokeMethod (e.Thread, m, null);
|
||||
AssertValue (0, v);
|
||||
|
||||
// Pass struct as this, receive intptr
|
||||
m = t.GetMethod ("invoke_return_intptr");
|
||||
v = s.InvokeMethod (e.Thread, m, null);
|
||||
@@ -2303,6 +2309,13 @@ public class DebuggerTests
|
||||
v = s.InvokeMethod (e.Thread, m, null);
|
||||
AssertValue (42, v);
|
||||
|
||||
// .ctor
|
||||
s = frame.GetArgument (1) as StructMirror;
|
||||
t = s.Type;
|
||||
m = t.GetMethods ().First (method => method.Name == ".ctor" && method.GetParameters ().Length == 1);
|
||||
v = t.InvokeMethod (e.Thread, m, new Value [] { vm.CreateValue (1) });
|
||||
AssertValue (1, (v as StructMirror)["i"]);
|
||||
|
||||
#if NET_4_5
|
||||
// Invoke a method which changes state
|
||||
s = frame.GetArgument (1) as StructMirror;
|
||||
@@ -3306,6 +3319,20 @@ public class DebuggerTests
|
||||
Assert.AreEqual ("System.Exception", types [0].FullName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void String_GetValue () {
|
||||
// Embedded nulls
|
||||
object val;
|
||||
|
||||
// Reuse this test
|
||||
var e = run_until ("arg2");
|
||||
|
||||
var frame = e.Thread.GetFrames () [0];
|
||||
|
||||
val = frame.GetArgument (6);
|
||||
Assert.AreEqual ('\0'.ToString () + "A", (val as StringMirror).Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void String_GetChars () {
|
||||
object val;
|
||||
|
||||
@@ -6,5 +6,6 @@ Mono.Unix/UnixMarshalTest.cs
|
||||
Mono.Unix/UnixPathTest.cs
|
||||
Mono.Unix/UnixSignalTest.cs
|
||||
Mono.Unix/UnixUserTest.cs
|
||||
Mono.Unix.Android/TestHelper.cs
|
||||
Mono.Unix.Native/RealTimeSignumTests.cs
|
||||
Mono.Unix.Native/StdlibTest.cs
|
||||
@@ -34,7 +34,6 @@ using System.Collections;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.IO;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
using Mono.Posix;
|
||||
|
||||
namespace Mono.Remoting.Channels.Unix
|
||||
{
|
||||
|
||||
@@ -17,10 +17,10 @@ namespace Mono.Unix.Native {
|
||||
//
|
||||
// Non-generated exports
|
||||
//
|
||||
|
||||
#if !MONODROID
|
||||
[DllImport (LIB, EntryPoint="Mono_Posix_FromRealTimeSignum")]
|
||||
private static extern int FromRealTimeSignum (Int32 offset, out Int32 rval);
|
||||
|
||||
#endif
|
||||
// convert a realtime signal to os signal
|
||||
public static int FromRealTimeSignum (RealTimeSignum sig)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,12 @@ using System.Net.Sockets;
|
||||
|
||||
namespace Mono.Unix
|
||||
{
|
||||
internal struct PeerCredData {
|
||||
public int pid;
|
||||
public int uid;
|
||||
public int gid;
|
||||
}
|
||||
|
||||
public class PeerCred
|
||||
{
|
||||
/* Make sure this doesn't clash with anything in
|
||||
@@ -40,14 +46,14 @@ namespace Mono.Unix
|
||||
* runtime
|
||||
*/
|
||||
private const int so_peercred=10001;
|
||||
private Mono.Posix.PeerCredData data;
|
||||
private PeerCredData data;
|
||||
|
||||
public PeerCred (Socket sock) {
|
||||
if (sock.AddressFamily != AddressFamily.Unix) {
|
||||
throw new ArgumentException ("Only Unix sockets are supported", "sock");
|
||||
}
|
||||
|
||||
data = (Mono.Posix.PeerCredData)
|
||||
data = (PeerCredData)
|
||||
sock.GetSocketOption (SocketOptionLevel.Socket, (SocketOptionName)so_peercred);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +176,10 @@ namespace Mono.Unix {
|
||||
else if (typeof(UnicodeEncoding).IsAssignableFrom (encodingType)) {
|
||||
len = GetInt16BufferLength (p);
|
||||
}
|
||||
// Encodings that will always end with a 0x00000000 32-bit word
|
||||
else if (typeof(UTF32Encoding).IsAssignableFrom (encodingType)) {
|
||||
len = GetInt32BufferLength (p);
|
||||
}
|
||||
// Some non-public encoding, such as Latin1 or a DBCS charset.
|
||||
// Look for a sequence of encoding.GetMaxByteCount() bytes that are all
|
||||
// 0, which should be the terminating null.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Mono.Unix.Android
|
||||
{
|
||||
// Another version of this class is used by the Xamarin.Android test suite
|
||||
// It is here to keep the test code #ifdef free as much as possible
|
||||
public class TestHelper
|
||||
{
|
||||
public static bool CanUseRealTimeSignals ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,14 @@
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
#if !MONODROID
|
||||
using NUnit.Framework.SyntaxHelpers;
|
||||
#endif
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Mono.Unix;
|
||||
using Mono.Unix.Android;
|
||||
using Mono.Unix.Native;
|
||||
|
||||
namespace MonoTests.Mono.Unix.Native {
|
||||
@@ -25,6 +28,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[ExpectedException (typeof (ArgumentOutOfRangeException))]
|
||||
public void TestRealTimeOutOfRange ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts = new RealTimeSignum (int.MaxValue);
|
||||
}
|
||||
|
||||
@@ -32,12 +37,16 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[ExpectedException (typeof (ArgumentOutOfRangeException))]
|
||||
public void TestRealTimeSignumNegativeOffset ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts1 = new RealTimeSignum (-1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRTSignalEquality ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts1 = new RealTimeSignum (0);
|
||||
RealTimeSignum rts2 = new RealTimeSignum (0);
|
||||
Assert.That (rts1 == rts2, Is.True);
|
||||
@@ -47,6 +56,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[Test]
|
||||
public void TestRTSignalInequality ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts1 = new RealTimeSignum (0);
|
||||
RealTimeSignum rts2 = new RealTimeSignum (1);
|
||||
Assert.That (rts1 == rts2, Is.False);
|
||||
@@ -56,6 +67,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[Test]
|
||||
public void TestRTSignalGetHashCodeEquality ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts1 = new RealTimeSignum (0);
|
||||
RealTimeSignum rts2 = new RealTimeSignum (0);
|
||||
Assert.That (rts1.GetHashCode (), Is.EqualTo(rts2.GetHashCode ()));
|
||||
@@ -64,6 +77,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[Test]
|
||||
public void TestRTSignalGetHashCodeInequality ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts1 = new RealTimeSignum (0);
|
||||
RealTimeSignum rts2 = new RealTimeSignum (1);
|
||||
Assert.That (rts1.GetHashCode (), Is.Not.EqualTo(rts2.GetHashCode ()));
|
||||
@@ -72,6 +87,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[Test]
|
||||
public void TestIsRTSignalPropertyForRTSignum ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
UnixSignal signal1 = new UnixSignal(new RealTimeSignum (0));
|
||||
Assert.That (signal1.IsRealTimeSignal, Is.True);
|
||||
}
|
||||
@@ -79,6 +96,8 @@ namespace MonoTests.Mono.Unix.Native {
|
||||
[Test]
|
||||
public void TestIsRTSignalPropertyForSignum ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
UnixSignal signal1 = new UnixSignal (Signum.SIGSEGV);
|
||||
Assert.That (signal1.IsRealTimeSignal, Is.False);
|
||||
}
|
||||
|
||||
@@ -226,21 +226,22 @@ namespace MonoTests.System.IO
|
||||
{
|
||||
StdioFileStream fs = null;
|
||||
StdioFileStream fs2 = null;
|
||||
string tempPath = Path.Combine (Path.GetTempPath (), "temp");
|
||||
try {
|
||||
if (!File.Exists ("temp")) {
|
||||
TextWriter tw = File.CreateText ("temp");
|
||||
if (!File.Exists (tempPath)) {
|
||||
TextWriter tw = File.CreateText (tempPath);
|
||||
tw.Write ("FOO");
|
||||
tw.Close ();
|
||||
}
|
||||
fs = new StdioFileStream ("temp", FileMode.Open, FileAccess.Read);
|
||||
fs2 = new StdioFileStream ("temp", FileMode.Open, FileAccess.Read);
|
||||
fs = new StdioFileStream (tempPath, FileMode.Open, FileAccess.Read);
|
||||
fs2 = new StdioFileStream (tempPath, FileMode.Open, FileAccess.Read);
|
||||
} finally {
|
||||
if (fs != null)
|
||||
fs.Close ();
|
||||
if (fs2 != null)
|
||||
fs2.Close ();
|
||||
if (File.Exists ("temp"))
|
||||
File.Delete ("temp");
|
||||
if (File.Exists (tempPath))
|
||||
File.Delete (tempPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,7 +857,8 @@ namespace MonoTests.System.IO
|
||||
[ExpectedException (typeof (NotSupportedException))]
|
||||
public void SetLengthWithClosedBaseStream ()
|
||||
{
|
||||
StdioFileStream fs = new StdioFileStream ("temp", FileMode.Create);
|
||||
string path = TempFolder + Path.DirectorySeparatorChar + "temp";
|
||||
StdioFileStream fs = new StdioFileStream (path, FileMode.Create);
|
||||
BufferedStream bs = new BufferedStream (fs);
|
||||
fs.Close ();
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace MonoTests.Mono.Unix {
|
||||
public class UnixGroupTest
|
||||
{
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // API 21 conditionally has setgrent in the NDK headers, but bionic doesn't export it
|
||||
public void ListAllGroups_ToString ()
|
||||
{
|
||||
try {
|
||||
@@ -41,6 +42,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // API 21 conditionally has setgrent in the NDK headers, but bionic doesn't export it
|
||||
public void ReentrantConstructors ()
|
||||
{
|
||||
var seen = new Dictionary<string, object> ();
|
||||
@@ -65,6 +67,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // API 21 conditionally has setgrent in the NDK headers, but bionic doesn't export it
|
||||
public void NonReentrantSyscalls ()
|
||||
{
|
||||
var seen = new Dictionary<string, object> ();
|
||||
@@ -95,6 +98,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // API 21 conditionally has getgrnam_r in the NDK headers, but bionic doesn't export it
|
||||
public void InvalidGroups_Constructor_Name ()
|
||||
{
|
||||
string[] badGroups = new string[]{"i'm bad", "so am i", "does-not-exist"};
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
@@ -87,6 +88,69 @@ namespace MonoTests.Mono.Unix {
|
||||
string s = UnixMarshal.PtrToString (p);
|
||||
UnixMarshal.FreeHeap (p);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUtf32PtrToString ()
|
||||
{
|
||||
var utf32NativeEndianNoBom = new UTF32Encoding(
|
||||
bigEndian: !BitConverter.IsLittleEndian,
|
||||
byteOrderMark: false,
|
||||
throwOnInvalidCharacters: true
|
||||
);
|
||||
|
||||
// assemble a buffer that contains:
|
||||
// 1. eight garbage bytes
|
||||
// 2. the native-endian UTF-32 string "Hello, World" without BOM
|
||||
// 3. four 0 bytes (as a C wide string terminator)
|
||||
// 4. the native-endian UTF-32 string "broken" without BOM
|
||||
// 5. eight 0 bytes
|
||||
// 6. four garbage bytes
|
||||
var buf = new List<byte>();
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
buf.Add((byte)0x12);
|
||||
buf.Add((byte)0x34);
|
||||
buf.Add((byte)0x56);
|
||||
buf.Add((byte)0x78);
|
||||
}
|
||||
|
||||
buf.AddRange(utf32NativeEndianNoBom.GetBytes("Hello, World"));
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
buf.Add((byte)0x00);
|
||||
}
|
||||
|
||||
buf.AddRange(utf32NativeEndianNoBom.GetBytes("broken"));
|
||||
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
buf.Add((byte)0x00);
|
||||
}
|
||||
|
||||
buf.Add((byte)0x12);
|
||||
buf.Add((byte)0x34);
|
||||
buf.Add((byte)0x56);
|
||||
buf.Add((byte)0x78);
|
||||
|
||||
// get the array version of this
|
||||
var bufArr = buf.ToArray();
|
||||
|
||||
// allocate a buffer that will contain this string
|
||||
IntPtr bufPtr = UnixMarshal.AllocHeap(bufArr.Length);
|
||||
string returned;
|
||||
try
|
||||
{
|
||||
// copy it in
|
||||
Marshal.Copy(bufArr, 0, bufPtr, bufArr.Length);
|
||||
|
||||
// try getting it back
|
||||
returned = UnixMarshal.PtrToString(bufPtr + 8, utf32NativeEndianNoBom);
|
||||
}
|
||||
finally
|
||||
{
|
||||
UnixMarshal.FreeHeap(bufPtr);
|
||||
}
|
||||
|
||||
Assert.AreEqual("Hello, World", returned);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace MonoTests.Mono.Unix
|
||||
Assert.AreEqual ("one", path);
|
||||
|
||||
path = UnixPath.Combine (current, "one");
|
||||
expected = current + DSC + "one";
|
||||
expected = (current == "/" ? String.Empty : current) + DSC + "one";
|
||||
Assert.AreEqual (expected, path);
|
||||
|
||||
path = UnixPath.Combine ("one", current);
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
#if !MONODROID
|
||||
using NUnit.Framework.SyntaxHelpers;
|
||||
#endif
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Mono.Unix;
|
||||
using Mono.Unix.Android;
|
||||
using Mono.Unix.Native;
|
||||
|
||||
#if !MONODROID
|
||||
namespace NUnit.Framework.SyntaxHelpers { class Dummy {} }
|
||||
|
||||
#endif
|
||||
namespace MonoTests.Mono.Unix {
|
||||
|
||||
[TestFixture]
|
||||
@@ -115,6 +118,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Crashes (silently) the runtime in similar fashion to real-time signals
|
||||
public void TestSignumProperty ()
|
||||
{
|
||||
UnixSignal signal1 = new UnixSignal (Signum.SIGSEGV);
|
||||
@@ -125,6 +129,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestRealTimeCstor ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts = new RealTimeSignum (0);
|
||||
using (UnixSignal s = new UnixSignal (rts))
|
||||
{
|
||||
@@ -138,6 +144,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestSignumPropertyThrows ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
UnixSignal signal1 = new UnixSignal (new RealTimeSignum (0));
|
||||
Signum s = signal1.Signum;
|
||||
}
|
||||
@@ -146,6 +154,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestRealTimeSignumProperty ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts = new RealTimeSignum (0);
|
||||
UnixSignal signal1 = new UnixSignal (rts);
|
||||
Assert.That (signal1.RealTimeSignum, Is.EqualTo (rts));
|
||||
@@ -156,6 +166,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestRealTimePropertyThrows ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
UnixSignal signal1 = new UnixSignal (Signum.SIGSEGV);
|
||||
RealTimeSignum s = signal1.RealTimeSignum;
|
||||
}
|
||||
@@ -164,6 +176,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestRaiseRTMINSignal ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
RealTimeSignum rts = new RealTimeSignum (0);
|
||||
using (UnixSignal signal = new UnixSignal (rts))
|
||||
{
|
||||
@@ -178,6 +192,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestRaiseRTMINPlusOneSignal ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
/*this number is a guestimate, but it's ok*/
|
||||
for (int i = 1; i < 10; ++i) {
|
||||
RealTimeSignum rts = new RealTimeSignum (i);
|
||||
@@ -203,6 +219,8 @@ namespace MonoTests.Mono.Unix {
|
||||
[Category ("NotOnMac")]
|
||||
public void TestCanRegisterRTSignalMultipleTimes ()
|
||||
{
|
||||
if (!TestHelper.CanUseRealTimeSignals ())
|
||||
return;
|
||||
/*this number is a guestimate, but it's ok*/
|
||||
for (int i = 1; i < 10; ++i) {
|
||||
RealTimeSignum rts = new RealTimeSignum (i);
|
||||
@@ -375,6 +393,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Android 4.4.4 doesn't have signal(2)
|
||||
public void TestSignalActionInteraction ()
|
||||
{
|
||||
using (UnixSignal a = new UnixSignal (Signum.SIGINT)) {
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace MonoTests.Mono.Unix {
|
||||
public class UnixUserTest
|
||||
{
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // setpwent is missing from bionic
|
||||
public void ListAllUsers_ToString ()
|
||||
{
|
||||
try {
|
||||
@@ -80,6 +81,7 @@ namespace MonoTests.Mono.Unix {
|
||||
|
||||
[Test]
|
||||
[Category ("NotOnMac")]
|
||||
[Category ("AndroidNotWorking")] // setpwent is missing from bionic
|
||||
public void NonReentrantSyscalls ()
|
||||
{
|
||||
ArrayList user_ids = new ArrayList (4);
|
||||
@@ -119,6 +121,7 @@ namespace MonoTests.Mono.Unix {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // API 21 has getpwnam_r in the NDK headers, but bionic doesn't export it
|
||||
public void InvalidUsers_Constructor_Name ()
|
||||
{
|
||||
string[] badUsers = new string[]{"i'm bad", "so am i", "does-not-exist"};
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace MonoTests.System.Security.Cryptography {
|
||||
public class AesManagedTest {
|
||||
|
||||
[Test]
|
||||
#if !MOBILE
|
||||
#if !MONOTOUCH
|
||||
[ExpectedException (typeof (CryptographicException))]
|
||||
#endif
|
||||
public void CFB_NotAllowed ()
|
||||
@@ -61,7 +61,7 @@ namespace MonoTests.System.Security.Cryptography {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if !MOBILE
|
||||
#if !MONOTOUCH
|
||||
[ExpectedException (typeof (CryptographicException))]
|
||||
#endif
|
||||
public void OFB_NotAllowed ()
|
||||
|
||||
@@ -363,6 +363,10 @@ namespace System.Net.Http.Headers
|
||||
first = false;
|
||||
}
|
||||
|
||||
// Return null for empty values list
|
||||
if (first)
|
||||
return null;
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Specialized;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Linq;
|
||||
|
||||
namespace System.Net.Http
|
||||
{
|
||||
@@ -274,7 +275,18 @@ namespace System.Net.Http
|
||||
// Add request headers
|
||||
var headers = wr.Headers;
|
||||
foreach (var header in request.Headers) {
|
||||
headers.AddValue (header.Key, HttpRequestHeaders.GetSingleHeaderString (header.Key, header.Value));
|
||||
var values = header.Value;
|
||||
if (header.Key == "Transfer-Encoding") {
|
||||
// Chunked Transfer-Encoding is never set for HttpWebRequest. It's detected
|
||||
// from ContentLength by HttpWebRequest
|
||||
values = values.Where (l => l != "chunked");
|
||||
}
|
||||
|
||||
var values_formated = HttpRequestHeaders.GetSingleHeaderString (header.Key, values);
|
||||
if (values_formated == null)
|
||||
continue;
|
||||
|
||||
headers.AddValue (header.Key, values_formated);
|
||||
}
|
||||
|
||||
return wr;
|
||||
|
||||
@@ -606,6 +606,62 @@ namespace MonoTests.System.Net.Http
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_Transfer_Encoding_Chunked ()
|
||||
{
|
||||
bool? failed = null;
|
||||
|
||||
var listener = CreateListener (l => {
|
||||
var request = l.Request;
|
||||
|
||||
try {
|
||||
Assert.AreEqual (1, request.Headers.Count, "#1");
|
||||
failed = false;
|
||||
} catch {
|
||||
failed = true;
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
var client = new HttpClient ();
|
||||
client.DefaultRequestHeaders.TransferEncodingChunked = true;
|
||||
|
||||
client.GetAsync (LocalServer).Wait ();
|
||||
|
||||
Assert.AreEqual (false, failed, "#102");
|
||||
} finally {
|
||||
listener.Abort ();
|
||||
listener.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_Transfer_Encoding_Custom ()
|
||||
{
|
||||
bool? failed = null;
|
||||
|
||||
var listener = CreateListener (l => {
|
||||
failed = true;
|
||||
});
|
||||
|
||||
try {
|
||||
var client = new HttpClient ();
|
||||
client.DefaultRequestHeaders.TransferEncoding.Add (new TransferCodingHeaderValue ("chunked2"));
|
||||
|
||||
var request = new HttpRequestMessage (HttpMethod.Get, LocalServer);
|
||||
|
||||
try {
|
||||
client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Wait ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (AggregateException e) {
|
||||
Assert.AreEqual (typeof (ProtocolViolationException), e.InnerException.GetType (), "#2");
|
||||
}
|
||||
Assert.IsNull (failed, "#102");
|
||||
} finally {
|
||||
listener.Abort ();
|
||||
listener.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_Complete_Content ()
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
../../build/common/Consts.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
System.Net.Http/ByteArrayContent.cs
|
||||
System.Net.Http/ClientCertificateOption.cs
|
||||
System.Net.Http/DelegatingHandler.cs
|
||||
System.Net.Http/FormUrlEncodedContent.cs
|
||||
System.Net.Http/HttpClient.cs
|
||||
System.Net.Http/HttpClientHandler.cs
|
||||
System.Net.Http/HttpCompletionOption.cs
|
||||
System.Net.Http/HttpContent.cs
|
||||
System.Net.Http/HttpMessageHandler.cs
|
||||
System.Net.Http/HttpMessageInvoker.cs
|
||||
System.Net.Http/HttpMethod.cs
|
||||
System.Net.Http/HttpRequestException.cs
|
||||
System.Net.Http/HttpRequestMessage.cs
|
||||
System.Net.Http/HttpResponseMessage.cs
|
||||
System.Net.Http/MessageProcessingHandler.cs
|
||||
System.Net.Http/MultipartContent.cs
|
||||
System.Net.Http/MultipartFormDataContent.cs
|
||||
System.Net.Http/StreamContent.cs
|
||||
System.Net.Http/StringContent.cs
|
||||
System.Net.Http.Headers/AuthenticationHeaderValue.cs
|
||||
System.Net.Http.Headers/CacheControlHeaderValue.cs
|
||||
System.Net.Http.Headers/CollectionExtensions.cs
|
||||
System.Net.Http.Headers/CollectionParser.cs
|
||||
System.Net.Http.Headers/ContentDispositionHeaderValue.cs
|
||||
System.Net.Http.Headers/ContentRangeHeaderValue.cs
|
||||
System.Net.Http.Headers/EntityTagHeaderValue.cs
|
||||
System.Net.Http.Headers/HashCodeCalculator.cs
|
||||
System.Net.Http.Headers/HeaderInfo.cs
|
||||
System.Net.Http.Headers/HttpContentHeaders.cs
|
||||
System.Net.Http.Headers/HttpHeaderKind.cs
|
||||
System.Net.Http.Headers/HttpHeaders.cs
|
||||
System.Net.Http.Headers/HttpHeaderValueCollection.cs
|
||||
System.Net.Http.Headers/HttpRequestHeaders.cs
|
||||
System.Net.Http.Headers/HttpResponseHeaders.cs
|
||||
System.Net.Http.Headers/Lexer.cs
|
||||
System.Net.Http.Headers/MediaTypeHeaderValue.cs
|
||||
System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/NameValueHeaderValue.cs
|
||||
System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs
|
||||
System.Net.Http.Headers/Parser.cs
|
||||
System.Net.Http.Headers/ProductHeaderValue.cs
|
||||
System.Net.Http.Headers/ProductInfoHeaderValue.cs
|
||||
System.Net.Http.Headers/QualityValue.cs
|
||||
System.Net.Http.Headers/RangeConditionHeaderValue.cs
|
||||
System.Net.Http.Headers/RangeHeaderValue.cs
|
||||
System.Net.Http.Headers/RangeItemHeaderValue.cs
|
||||
System.Net.Http.Headers/RetryConditionHeaderValue.cs
|
||||
System.Net.Http.Headers/StringWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/TransferCodingHeaderValue.cs
|
||||
System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/ViaHeaderValue.cs
|
||||
System.Net.Http.Headers/WarningHeaderValue.cs
|
||||
@@ -1 +0,0 @@
|
||||
#include monotouch_System.Net.Http.dll.sources
|
||||
@@ -584,10 +584,14 @@ namespace System.ServiceModel.Dispatcher
|
||||
{
|
||||
Message msg;
|
||||
var input = (IInputChannel) result.AsyncState;
|
||||
if (input.EndTryReceive (result, out msg))
|
||||
ProcessInput (input, msg);
|
||||
else
|
||||
try {
|
||||
if (input.EndTryReceive (result, out msg))
|
||||
ProcessInput (input, msg);
|
||||
else
|
||||
input.Close ();
|
||||
} catch (ObjectDisposedException) {
|
||||
input.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessRequest (IReplyChannel reply, RequestContext rc)
|
||||
|
||||
@@ -461,8 +461,6 @@ namespace System.ServiceModel.MonoInternal
|
||||
if (p == parameters)
|
||||
return retval;
|
||||
|
||||
if (p.Length != parameters.Length)
|
||||
throw new InvalidOperationException ();
|
||||
Array.Copy (p, parameters, p.Length);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ System.ServiceModel.Description/WsdlImporterTest.cs
|
||||
System.ServiceModel.Dispatcher/ActionFilterTest.cs
|
||||
System.ServiceModel.Dispatcher/Bug652331Test.cs
|
||||
System.ServiceModel.Dispatcher/Bug652331_2Test.cs
|
||||
System.ServiceModel.Dispatcher/Bug32886Test.cs
|
||||
System.ServiceModel.Dispatcher/ChannelDispatcherTest.cs
|
||||
System.ServiceModel.Dispatcher/DispatchOperationTest.cs
|
||||
System.ServiceModel.Dispatcher/DispatchRuntimeTest.cs
|
||||
|
||||
@@ -0,0 +1,706 @@
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2015 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Description;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
|
||||
using WebServiceMoonlightTest.ServiceReference1;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.ServiceModel.Dispatcher
|
||||
{
|
||||
[TestFixture]
|
||||
public class Bug32886
|
||||
{
|
||||
[Test]
|
||||
public void Bug32886_Test () // test in one of the comment
|
||||
{
|
||||
// Init service
|
||||
int port = NetworkHelpers.FindFreePort ();
|
||||
ServiceHost serviceHost = new ServiceHost (typeof (TempConvertSoapImpl), new Uri ("http://localhost:" + port + "/TempConvertSoap"));
|
||||
serviceHost.AddServiceEndpoint (typeof (TempConvertSoap), new BasicHttpBinding (), string.Empty);
|
||||
|
||||
// Enable metadata exchange (WSDL publishing)
|
||||
var mexBehavior = new ServiceMetadataBehavior ();
|
||||
mexBehavior.HttpGetEnabled = true;
|
||||
serviceHost.Description.Behaviors.Add (mexBehavior);
|
||||
serviceHost.AddServiceEndpoint (typeof (IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding (), "mex");
|
||||
|
||||
serviceHost.Open ();
|
||||
|
||||
try {
|
||||
// client
|
||||
var binding = new BasicHttpBinding ();
|
||||
var remoteAddress = new EndpointAddress ("http://localhost:" + port + "/TempConvertSoap");
|
||||
var client = new TempConvertSoapClient (binding, remoteAddress);
|
||||
|
||||
var wait = new ManualResetEvent (false);
|
||||
client.CelsiusToFahrenheitCompleted += delegate (object o, CelsiusToFahrenheitCompletedEventArgs e) {
|
||||
if (e.Error != null)
|
||||
throw e.Error;
|
||||
Assert.AreEqual ("76.1", e.Result, "#1");
|
||||
wait.Set ();
|
||||
};
|
||||
|
||||
client.CelsiusToFahrenheitAsync ("24.5");
|
||||
if (!wait.WaitOne (TimeSpan.FromSeconds (20)))
|
||||
Assert.Fail ("timeout");
|
||||
} finally {
|
||||
serviceHost.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
class TempConvertSoapImpl : TempConvertSoap
|
||||
{
|
||||
public FahrenheitToCelsiusResponse FarenheitToCelsius (FahrenheitToCelsiusRequest request)
|
||||
{
|
||||
var farenheit = double.Parse (request.Body.Fahrenheit);
|
||||
var celsius = ((farenheit - 32) / 9) * 5;
|
||||
return new FahrenheitToCelsiusResponse (new FahrenheitToCelsiusResponseBody (celsius.ToString ()));
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitResponse CelsiusToFarenheit (CelsiusToFahrenheitRequest request)
|
||||
{
|
||||
var celsius = double.Parse (request.Body.Celsius);
|
||||
var farenheit = ((celsius * 9) / 5) + 32;
|
||||
return new CelsiusToFahrenheitResponse (new CelsiusToFahrenheitResponseBody (farenheit.ToString ()));
|
||||
}
|
||||
|
||||
Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> farenheitToCelsius;
|
||||
Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> celsiusToFarenheit;
|
||||
|
||||
public IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, AsyncCallback callback, object asyncState)
|
||||
{
|
||||
if (farenheitToCelsius == null)
|
||||
farenheitToCelsius = new Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> (FarenheitToCelsius);
|
||||
return farenheitToCelsius.BeginInvoke (request, callback, asyncState);
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (IAsyncResult result)
|
||||
{
|
||||
return farenheitToCelsius.EndInvoke (result);
|
||||
}
|
||||
|
||||
public IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, AsyncCallback callback, object asyncState)
|
||||
{
|
||||
if (celsiusToFarenheit == null)
|
||||
celsiusToFarenheit = new Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> (CelsiusToFarenheit);
|
||||
return celsiusToFarenheit.BeginInvoke (request, callback, asyncState);
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (IAsyncResult result)
|
||||
{
|
||||
return celsiusToFarenheit.EndInvoke (result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// This code was auto-generated by SlSvcUtil, version 5.0.61118.0
|
||||
//
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ServiceModel.ServiceContractAttribute (Namespace = "http://www.w3schools.com/webservices/", ConfigurationName = "TempConvertSoap")]
|
||||
public interface TempConvertSoap
|
||||
{
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute (AsyncPattern = true, Action = "http://www.w3schools.com/webservices/FahrenheitToCelsius", ReplyAction = "*")]
|
||||
System.IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState);
|
||||
|
||||
FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute (AsyncPattern = true, Action = "http://www.w3schools.com/webservices/CelsiusToFahrenheit", ReplyAction = "*")]
|
||||
System.IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState);
|
||||
|
||||
CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result);
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
|
||||
public partial class FahrenheitToCelsiusRequest
|
||||
{
|
||||
|
||||
[System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsius", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
|
||||
public FahrenheitToCelsiusRequestBody Body;
|
||||
|
||||
public FahrenheitToCelsiusRequest ()
|
||||
{
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusRequest (FahrenheitToCelsiusRequestBody Body)
|
||||
{
|
||||
this.Body = Body;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
|
||||
public partial class FahrenheitToCelsiusRequestBody
|
||||
{
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
|
||||
public string Fahrenheit;
|
||||
|
||||
public FahrenheitToCelsiusRequestBody ()
|
||||
{
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusRequestBody (string Fahrenheit)
|
||||
{
|
||||
this.Fahrenheit = Fahrenheit;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
|
||||
public partial class FahrenheitToCelsiusResponse
|
||||
{
|
||||
|
||||
[System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsiusResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
|
||||
public FahrenheitToCelsiusResponseBody Body;
|
||||
|
||||
public FahrenheitToCelsiusResponse ()
|
||||
{
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusResponse (FahrenheitToCelsiusResponseBody Body)
|
||||
{
|
||||
this.Body = Body;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
|
||||
public partial class FahrenheitToCelsiusResponseBody
|
||||
{
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
|
||||
public string FahrenheitToCelsiusResult;
|
||||
|
||||
public FahrenheitToCelsiusResponseBody ()
|
||||
{
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusResponseBody (string FahrenheitToCelsiusResult)
|
||||
{
|
||||
this.FahrenheitToCelsiusResult = FahrenheitToCelsiusResult;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
|
||||
public partial class CelsiusToFahrenheitRequest
|
||||
{
|
||||
|
||||
[System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheit", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
|
||||
public CelsiusToFahrenheitRequestBody Body;
|
||||
|
||||
public CelsiusToFahrenheitRequest ()
|
||||
{
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitRequest (CelsiusToFahrenheitRequestBody Body)
|
||||
{
|
||||
this.Body = Body;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
|
||||
public partial class CelsiusToFahrenheitRequestBody
|
||||
{
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
|
||||
public string Celsius;
|
||||
|
||||
public CelsiusToFahrenheitRequestBody ()
|
||||
{
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitRequestBody (string Celsius)
|
||||
{
|
||||
this.Celsius = Celsius;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
|
||||
public partial class CelsiusToFahrenheitResponse
|
||||
{
|
||||
|
||||
[System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheitResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
|
||||
public CelsiusToFahrenheitResponseBody Body;
|
||||
|
||||
public CelsiusToFahrenheitResponse ()
|
||||
{
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitResponse (CelsiusToFahrenheitResponseBody Body)
|
||||
{
|
||||
this.Body = Body;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
[System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
|
||||
public partial class CelsiusToFahrenheitResponseBody
|
||||
{
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
|
||||
public string CelsiusToFahrenheitResult;
|
||||
|
||||
public CelsiusToFahrenheitResponseBody ()
|
||||
{
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitResponseBody (string CelsiusToFahrenheitResult)
|
||||
{
|
||||
this.CelsiusToFahrenheitResult = CelsiusToFahrenheitResult;
|
||||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
public interface TempConvertSoapChannel : TempConvertSoap, System.ServiceModel.IClientChannel
|
||||
{
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class FahrenheitToCelsiusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
|
||||
{
|
||||
|
||||
private object[] results;
|
||||
|
||||
public FahrenheitToCelsiusCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base (exception, cancelled, userState)
|
||||
{
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public string Result {
|
||||
get {
|
||||
base.RaiseExceptionIfNecessary ();
|
||||
return ((string)(this.results [0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class CelsiusToFahrenheitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
|
||||
{
|
||||
|
||||
private object[] results;
|
||||
|
||||
public CelsiusToFahrenheitCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base (exception, cancelled, userState)
|
||||
{
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public string Result {
|
||||
get {
|
||||
base.RaiseExceptionIfNecessary ();
|
||||
return ((string)(this.results [0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute ()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class TempConvertSoapClient : System.ServiceModel.ClientBase<TempConvertSoap>, TempConvertSoap
|
||||
{
|
||||
|
||||
private BeginOperationDelegate onBeginFahrenheitToCelsiusDelegate;
|
||||
|
||||
private EndOperationDelegate onEndFahrenheitToCelsiusDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onFahrenheitToCelsiusCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginCelsiusToFahrenheitDelegate;
|
||||
|
||||
private EndOperationDelegate onEndCelsiusToFahrenheitDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onCelsiusToFahrenheitCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginOpenDelegate;
|
||||
|
||||
private EndOperationDelegate onEndOpenDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginCloseDelegate;
|
||||
|
||||
private EndOperationDelegate onEndCloseDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
|
||||
|
||||
public TempConvertSoapClient ()
|
||||
{
|
||||
}
|
||||
|
||||
public TempConvertSoapClient (string endpointConfigurationName) :
|
||||
base (endpointConfigurationName)
|
||||
{
|
||||
}
|
||||
|
||||
public TempConvertSoapClient (string endpointConfigurationName, string remoteAddress) :
|
||||
base (endpointConfigurationName, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public TempConvertSoapClient (string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base (endpointConfigurationName, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public TempConvertSoapClient (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base (binding, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public System.Net.CookieContainer CookieContainer {
|
||||
get {
|
||||
System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
|
||||
if ((httpCookieContainerManager != null)) {
|
||||
return httpCookieContainerManager.CookieContainer;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set {
|
||||
System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
|
||||
if ((httpCookieContainerManager != null)) {
|
||||
httpCookieContainerManager.CookieContainer = value;
|
||||
} else {
|
||||
throw new System.InvalidOperationException ("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
|
||||
"ookieContainerBindingElement.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event System.EventHandler<FahrenheitToCelsiusCompletedEventArgs> FahrenheitToCelsiusCompleted;
|
||||
|
||||
public event System.EventHandler<CelsiusToFahrenheitCompletedEventArgs> CelsiusToFahrenheitCompleted;
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
System.IAsyncResult TempConvertSoap.BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return base.Channel.BeginFahrenheitToCelsius (request, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
private System.IAsyncResult BeginFahrenheitToCelsius (string Fahrenheit, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
FahrenheitToCelsiusRequest inValue = new FahrenheitToCelsiusRequest ();
|
||||
inValue.Body = new FahrenheitToCelsiusRequestBody ();
|
||||
inValue.Body.Fahrenheit = Fahrenheit;
|
||||
return ((TempConvertSoap)(this)).BeginFahrenheitToCelsius (inValue, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
FahrenheitToCelsiusResponse TempConvertSoap.EndFahrenheitToCelsius (System.IAsyncResult result)
|
||||
{
|
||||
return base.Channel.EndFahrenheitToCelsius (result);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
private string EndFahrenheitToCelsius (System.IAsyncResult result)
|
||||
{
|
||||
FahrenheitToCelsiusResponse retVal = ((TempConvertSoap)(this)).EndFahrenheitToCelsius (result);
|
||||
return retVal.Body.FahrenheitToCelsiusResult;
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginFahrenheitToCelsius (object[] inValues, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
string Fahrenheit = ((string)(inValues [0]));
|
||||
return this.BeginFahrenheitToCelsius (Fahrenheit, callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndFahrenheitToCelsius (System.IAsyncResult result)
|
||||
{
|
||||
string retVal = this.EndFahrenheitToCelsius (result);
|
||||
return new object[] {
|
||||
retVal
|
||||
};
|
||||
}
|
||||
|
||||
private void OnFahrenheitToCelsiusCompleted (object state)
|
||||
{
|
||||
if ((this.FahrenheitToCelsiusCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.FahrenheitToCelsiusCompleted (this, new FahrenheitToCelsiusCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void FahrenheitToCelsiusAsync (string Fahrenheit)
|
||||
{
|
||||
this.FahrenheitToCelsiusAsync (Fahrenheit, null);
|
||||
}
|
||||
|
||||
public void FahrenheitToCelsiusAsync (string Fahrenheit, object userState)
|
||||
{
|
||||
if ((this.onBeginFahrenheitToCelsiusDelegate == null)) {
|
||||
this.onBeginFahrenheitToCelsiusDelegate = new BeginOperationDelegate (this.OnBeginFahrenheitToCelsius);
|
||||
}
|
||||
if ((this.onEndFahrenheitToCelsiusDelegate == null)) {
|
||||
this.onEndFahrenheitToCelsiusDelegate = new EndOperationDelegate (this.OnEndFahrenheitToCelsius);
|
||||
}
|
||||
if ((this.onFahrenheitToCelsiusCompletedDelegate == null)) {
|
||||
this.onFahrenheitToCelsiusCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnFahrenheitToCelsiusCompleted);
|
||||
}
|
||||
base.InvokeAsync (this.onBeginFahrenheitToCelsiusDelegate, new object[] {
|
||||
Fahrenheit
|
||||
}, this.onEndFahrenheitToCelsiusDelegate, this.onFahrenheitToCelsiusCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
System.IAsyncResult TempConvertSoap.BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return base.Channel.BeginCelsiusToFahrenheit (request, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
private System.IAsyncResult BeginCelsiusToFahrenheit (string Celsius, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
CelsiusToFahrenheitRequest inValue = new CelsiusToFahrenheitRequest ();
|
||||
inValue.Body = new CelsiusToFahrenheitRequestBody ();
|
||||
inValue.Body.Celsius = Celsius;
|
||||
return ((TempConvertSoap)(this)).BeginCelsiusToFahrenheit (inValue, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
CelsiusToFahrenheitResponse TempConvertSoap.EndCelsiusToFahrenheit (System.IAsyncResult result)
|
||||
{
|
||||
return base.Channel.EndCelsiusToFahrenheit (result);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
private string EndCelsiusToFahrenheit (System.IAsyncResult result)
|
||||
{
|
||||
CelsiusToFahrenheitResponse retVal = ((TempConvertSoap)(this)).EndCelsiusToFahrenheit (result);
|
||||
return retVal.Body.CelsiusToFahrenheitResult;
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginCelsiusToFahrenheit (object[] inValues, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
string Celsius = ((string)(inValues [0]));
|
||||
return this.BeginCelsiusToFahrenheit (Celsius, callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndCelsiusToFahrenheit (System.IAsyncResult result)
|
||||
{
|
||||
string retVal = this.EndCelsiusToFahrenheit (result);
|
||||
return new object[] {
|
||||
retVal
|
||||
};
|
||||
}
|
||||
|
||||
private void OnCelsiusToFahrenheitCompleted (object state)
|
||||
{
|
||||
if ((this.CelsiusToFahrenheitCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.CelsiusToFahrenheitCompleted (this, new CelsiusToFahrenheitCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void CelsiusToFahrenheitAsync (string Celsius)
|
||||
{
|
||||
this.CelsiusToFahrenheitAsync (Celsius, null);
|
||||
}
|
||||
|
||||
public void CelsiusToFahrenheitAsync (string Celsius, object userState)
|
||||
{
|
||||
if ((this.onBeginCelsiusToFahrenheitDelegate == null)) {
|
||||
this.onBeginCelsiusToFahrenheitDelegate = new BeginOperationDelegate (this.OnBeginCelsiusToFahrenheit);
|
||||
}
|
||||
if ((this.onEndCelsiusToFahrenheitDelegate == null)) {
|
||||
this.onEndCelsiusToFahrenheitDelegate = new EndOperationDelegate (this.OnEndCelsiusToFahrenheit);
|
||||
}
|
||||
if ((this.onCelsiusToFahrenheitCompletedDelegate == null)) {
|
||||
this.onCelsiusToFahrenheitCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCelsiusToFahrenheitCompleted);
|
||||
}
|
||||
base.InvokeAsync (this.onBeginCelsiusToFahrenheitDelegate, new object[] {
|
||||
Celsius
|
||||
}, this.onEndCelsiusToFahrenheitDelegate, this.onCelsiusToFahrenheitCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginOpen (object[] inValues, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen (callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndOpen (System.IAsyncResult result)
|
||||
{
|
||||
((System.ServiceModel.ICommunicationObject)(this)).EndOpen (result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnOpenCompleted (object state)
|
||||
{
|
||||
if ((this.OpenCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.OpenCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenAsync ()
|
||||
{
|
||||
this.OpenAsync (null);
|
||||
}
|
||||
|
||||
public void OpenAsync (object userState)
|
||||
{
|
||||
if ((this.onBeginOpenDelegate == null)) {
|
||||
this.onBeginOpenDelegate = new BeginOperationDelegate (this.OnBeginOpen);
|
||||
}
|
||||
if ((this.onEndOpenDelegate == null)) {
|
||||
this.onEndOpenDelegate = new EndOperationDelegate (this.OnEndOpen);
|
||||
}
|
||||
if ((this.onOpenCompletedDelegate == null)) {
|
||||
this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnOpenCompleted);
|
||||
}
|
||||
base.InvokeAsync (this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginClose (object[] inValues, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose (callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndClose (System.IAsyncResult result)
|
||||
{
|
||||
((System.ServiceModel.ICommunicationObject)(this)).EndClose (result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnCloseCompleted (object state)
|
||||
{
|
||||
if ((this.CloseCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.CloseCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseAsync ()
|
||||
{
|
||||
this.CloseAsync (null);
|
||||
}
|
||||
|
||||
public void CloseAsync (object userState)
|
||||
{
|
||||
if ((this.onBeginCloseDelegate == null)) {
|
||||
this.onBeginCloseDelegate = new BeginOperationDelegate (this.OnBeginClose);
|
||||
}
|
||||
if ((this.onEndCloseDelegate == null)) {
|
||||
this.onEndCloseDelegate = new EndOperationDelegate (this.OnEndClose);
|
||||
}
|
||||
if ((this.onCloseCompletedDelegate == null)) {
|
||||
this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCloseCompleted);
|
||||
}
|
||||
base.InvokeAsync (this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
protected override TempConvertSoap CreateChannel ()
|
||||
{
|
||||
return new TempConvertSoapClientChannel (this);
|
||||
}
|
||||
|
||||
private class TempConvertSoapClientChannel : ChannelBase<TempConvertSoap>, TempConvertSoap
|
||||
{
|
||||
|
||||
public TempConvertSoapClientChannel (System.ServiceModel.ClientBase<TempConvertSoap> client) :
|
||||
base (client)
|
||||
{
|
||||
}
|
||||
|
||||
public System.IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
object[] _args = new object[1];
|
||||
_args [0] = request;
|
||||
System.IAsyncResult _result = base.BeginInvoke ("FahrenheitToCelsius", _args, callback, asyncState);
|
||||
return _result;
|
||||
}
|
||||
|
||||
public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result)
|
||||
{
|
||||
object[] _args = new object[0];
|
||||
FahrenheitToCelsiusResponse _result = ((FahrenheitToCelsiusResponse)(base.EndInvoke ("FahrenheitToCelsius", _args, result)));
|
||||
return _result;
|
||||
}
|
||||
|
||||
public System.IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
|
||||
{
|
||||
object[] _args = new object[1];
|
||||
_args [0] = request;
|
||||
System.IAsyncResult _result = base.BeginInvoke ("CelsiusToFahrenheit", _args, callback, asyncState);
|
||||
return _result;
|
||||
}
|
||||
|
||||
public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result)
|
||||
{
|
||||
object[] _args = new object[0];
|
||||
CelsiusToFahrenheitResponse _result = ((CelsiusToFahrenheitResponse)(base.EndInvoke ("CelsiusToFahrenheit", _args, result)));
|
||||
return _result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1487,9 +1487,13 @@ namespace System.Diagnostics {
|
||||
}
|
||||
|
||||
public void Close () {
|
||||
RemoveFromIOThreadPool (handle);
|
||||
stream.Close ();
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void RemoveFromIOThreadPool (IntPtr handle);
|
||||
|
||||
void IThreadPoolWorkItem.ExecuteWorkItem()
|
||||
{
|
||||
async_result.Invoke ();
|
||||
|
||||
@@ -28,27 +28,6 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
namespace System.Net.NetworkInformation {
|
||||
public abstract class IPv4InterfaceStatistics {
|
||||
protected IPv4InterfaceStatistics ()
|
||||
{
|
||||
}
|
||||
|
||||
public abstract long BytesReceived { get; }
|
||||
public abstract long BytesSent { get; }
|
||||
public abstract long IncomingPacketsDiscarded { get; }
|
||||
public abstract long IncomingPacketsWithErrors { get; }
|
||||
public abstract long IncomingUnknownProtocolPackets { get; }
|
||||
public abstract long NonUnicastPacketsReceived { get; }
|
||||
public abstract long NonUnicastPacketsSent { get; }
|
||||
public abstract long OutgoingPacketsDiscarded { get; }
|
||||
public abstract long OutgoingPacketsWithErrors { get; }
|
||||
|
||||
[MonoTODO("Not implemented for Linux")]
|
||||
public abstract long OutputQueueLength { get; }
|
||||
public abstract long UnicastPacketsReceived { get; }
|
||||
public abstract long UnicastPacketsSent { get; }
|
||||
}
|
||||
|
||||
class Win32IPv4InterfaceStatistics : IPv4InterfaceStatistics
|
||||
{
|
||||
Win32_MIB_IFROW info;
|
||||
|
||||
@@ -442,8 +442,10 @@ namespace System.Net.NetworkInformation {
|
||||
|
||||
unsafe void OnDataAvailable (object sender, SocketAsyncEventArgs args)
|
||||
{
|
||||
if (nl_sock == null) // Recent changes in Mono cause MaybeCloseSocket to be called before OnDataAvailable
|
||||
return;
|
||||
EventType type;
|
||||
fixed (byte *ptr = args.Buffer) {
|
||||
fixed (byte *ptr = args.Buffer) {
|
||||
type = ReadEvents (nl_sock.Handle, new IntPtr (ptr), args.BytesTransferred, 8192);
|
||||
}
|
||||
nl_sock.ReceiveAsync (nl_args);
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace System.Net
|
||||
lock (this) {
|
||||
idleSince = outIdleSince;
|
||||
|
||||
if (removeList != null) {
|
||||
if (removeList != null && groups != null) {
|
||||
foreach (var group in removeList)
|
||||
if (groups.ContainsKey (group.Name))
|
||||
RemoveConnectionGroup (group);
|
||||
|
||||
@@ -654,7 +654,8 @@ namespace System.Net
|
||||
if (setInternalLength && !no_writestream && writeBuffer != null)
|
||||
request.InternalContentLength = writeBuffer.Length;
|
||||
|
||||
if (!(sendChunked || request.ContentLength > -1 || no_writestream || webdav))
|
||||
bool has_content = !no_writestream && (writeBuffer == null || request.ContentLength > -1);
|
||||
if (!(sendChunked || has_content || no_writestream || webdav))
|
||||
return false;
|
||||
|
||||
headersSent = true;
|
||||
|
||||
@@ -1008,6 +1008,8 @@ ReferenceSources/Win32Exception.cs
|
||||
../../../external/referencesource/System/net/System/Net/WebPermission.cs
|
||||
../../../external/referencesource/System/net/System/Net/WriteStreamClosedEventArgs.cs
|
||||
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/IPInterfaceStatistics.cs
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/ScopeLevel.cs
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/UnicastIPAddressInformation.cs
|
||||
|
||||
../../../external/referencesource/System/sys/system/runtime/versioning/FrameworkName.cs
|
||||
|
||||
@@ -96,6 +96,12 @@ namespace System {
|
||||
set { s_IriParsing = value; }
|
||||
}
|
||||
|
||||
// Do not rename this.
|
||||
// User code might set this to true with reflection.
|
||||
// When set to true an Uri constructed with UriKind.RelativeOrAbsolute
|
||||
// and paths such as "/foo" is assumed relative.
|
||||
private static bool useDotNetRelativeOrAbsolute;
|
||||
|
||||
#if BOOTSTRAP_BASIC
|
||||
private static readonly string hexUpperChars = "0123456789ABCDEF";
|
||||
private static readonly string [] Empty = new string [0];
|
||||
@@ -147,6 +153,8 @@ namespace System {
|
||||
IriParsing = true;
|
||||
else if (iriparsingVar == "false")
|
||||
IriParsing = false;
|
||||
|
||||
useDotNetRelativeOrAbsolute = Environment.GetEnvironmentVariable ("MONO_URI_DOTNETRELATIVEORABSOLUTE") == "true";
|
||||
}
|
||||
|
||||
public Uri (string uriString) : this (uriString, false)
|
||||
@@ -173,12 +181,21 @@ namespace System {
|
||||
// When used instead of UriKind.RelativeOrAbsolute paths such as "/foo" are assumed relative.
|
||||
const UriKind DotNetRelativeOrAbsolute = (UriKind) 300;
|
||||
|
||||
private void ProcessUriKind (string uriString, ref UriKind uriKind)
|
||||
{
|
||||
if (uriString == null)
|
||||
return;
|
||||
|
||||
if (uriKind == DotNetRelativeOrAbsolute ||
|
||||
(uriKind == UriKind.RelativeOrAbsolute && useDotNetRelativeOrAbsolute))
|
||||
uriKind = (uriString.StartsWith ("/", StringComparison.Ordinal))? UriKind.Relative : UriKind.RelativeOrAbsolute;
|
||||
}
|
||||
|
||||
public Uri (string uriString, UriKind uriKind)
|
||||
{
|
||||
source = uriString;
|
||||
|
||||
if (uriString != null && uriKind == DotNetRelativeOrAbsolute)
|
||||
uriKind = (uriString.StartsWith ("/", StringComparison.Ordinal))? UriKind.Relative : UriKind.RelativeOrAbsolute;
|
||||
ProcessUriKind (uriString, ref uriKind);
|
||||
|
||||
ParseUri (uriKind);
|
||||
|
||||
@@ -212,8 +229,7 @@ namespace System {
|
||||
return;
|
||||
}
|
||||
|
||||
if (uriKind == DotNetRelativeOrAbsolute)
|
||||
uriKind = (uriString.StartsWith ("/", StringComparison.Ordinal))? UriKind.Relative : UriKind.RelativeOrAbsolute;
|
||||
ProcessUriKind (uriString, ref uriKind);
|
||||
|
||||
if (uriKind != UriKind.RelativeOrAbsolute &&
|
||||
uriKind != UriKind.Absolute &&
|
||||
|
||||
@@ -263,7 +263,12 @@ namespace System
|
||||
|
||||
builder.Append (scheme);
|
||||
// note: mailto and news use ':', not "://", as their delimiter
|
||||
builder.Append (Uri.GetSchemeDelimiter (scheme));
|
||||
if (UriParser.IsKnownScheme(scheme)) {
|
||||
builder.Append (Uri.GetSchemeDelimiter (scheme));
|
||||
}
|
||||
else {
|
||||
builder.Append (host.Length > 0 ? Uri.SchemeDelimiter : ":");
|
||||
}
|
||||
|
||||
if (username != String.Empty) {
|
||||
builder.Append (username);
|
||||
@@ -280,7 +285,8 @@ namespace System
|
||||
|
||||
if (path != String.Empty &&
|
||||
builder [builder.Length - 1] != '/' &&
|
||||
path.Length > 0 && path [0] != '/')
|
||||
path.Length > 0 && path [0] != '/' &&
|
||||
host.Length > 0)
|
||||
builder.Append ('/');
|
||||
builder.Append (path);
|
||||
builder.Append (query);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MonoTests.System.ComponentModel
|
||||
SynchronizationContext sc1 = new SynchronizationContext ();
|
||||
SynchronizationContext sc2 = new SynchronizationContext ();
|
||||
|
||||
#if MOBILE
|
||||
#if MOBILE && !MONODROID
|
||||
Assert.IsNotNull (SynchronizationContext.Current, "A1");
|
||||
#else
|
||||
Assert.IsNull (SynchronizationContext.Current, "A1");
|
||||
|
||||
@@ -838,9 +838,18 @@ namespace MonoTests.System.Diagnostics
|
||||
}
|
||||
|
||||
|
||||
private ProcessStartInfo GetCrossPlatformStartInfo ()
|
||||
ProcessStartInfo GetCrossPlatformStartInfo ()
|
||||
{
|
||||
return RunningOnUnix ? new ProcessStartInfo ("/bin/ls", "/") : new ProcessStartInfo ("help", "");
|
||||
if (RunningOnUnix) {
|
||||
string path;
|
||||
#if MONODROID
|
||||
path = "/system/bin/ls";
|
||||
#else
|
||||
path = "/bin/ls";
|
||||
#endif
|
||||
return new ProcessStartInfo (path, "/");
|
||||
} else
|
||||
return new ProcessStartInfo ("help", "");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -376,6 +376,7 @@ namespace MonoTests.System.IO.Compression
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // system zlib returns Z_STREAM_ERROR
|
||||
public void Bug28777_EmptyFlush ()
|
||||
{
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
@@ -386,6 +387,7 @@ namespace MonoTests.System.IO.Compression
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // system zlib returns Z_BUF_ERROR
|
||||
public void Bug28777_DoubleFlush ()
|
||||
{
|
||||
byte[] buffer = new byte [4096];
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
@@ -29,18 +31,82 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
Assert.IsTrue (numUnicastAddresses > 0);
|
||||
}
|
||||
|
||||
// Borrowed from IPInterfaceProperties.cs
|
||||
bool HasOnlyDefaultGateway (string iface)
|
||||
{
|
||||
int gwCount = 0;
|
||||
int defaultGwCount = 0;
|
||||
#if MONODROID
|
||||
if (!File.Exists ("/proc/net/route"))
|
||||
return false;
|
||||
try {
|
||||
using (StreamReader reader = new StreamReader ("/proc/net/route")) {
|
||||
string line;
|
||||
reader.ReadLine (); // Ignore first line
|
||||
while ((line = reader.ReadLine ()) != null) {
|
||||
line = line.Trim ();
|
||||
if (line.Length == 0)
|
||||
continue;
|
||||
|
||||
string [] parts = line.Split ('\t');
|
||||
if (parts.Length < 3)
|
||||
continue;
|
||||
string gw_address = parts [2].Trim ();
|
||||
byte [] ipbytes = new byte [4];
|
||||
if (gw_address.Length == 8 && iface.Equals (parts [0], StringComparison.OrdinalIgnoreCase)) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (!Byte.TryParse (gw_address.Substring (i * 2, 2), NumberStyles.HexNumber, null, out ipbytes [3 - i]))
|
||||
continue;
|
||||
}
|
||||
IPAddress ip = new IPAddress (ipbytes);
|
||||
if (ip.Equals (IPAddress.Any))
|
||||
defaultGwCount++;
|
||||
else
|
||||
gwCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
#endif
|
||||
return gwCount == 0 && defaultGwCount > 0;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AtLeastOneGatewayAddress ()
|
||||
{
|
||||
int numGatewayAddresses = 0;
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
|
||||
// On Android (possibly on other systems too) it is possible that no gateway address is available and its lack is NOT an error
|
||||
// Here is a sample of /proc/net/route from Nexus 9 running Android 5.1.1 (IPInterfaceProperties parses that file on Linux)
|
||||
//
|
||||
// Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
|
||||
// wlan0 0001A8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0
|
||||
//
|
||||
// Gateway is set to any address and it is explicitly ignored by the route information parser
|
||||
//
|
||||
// For comparison, here's route contents from an Android 4.4.4 device:
|
||||
//
|
||||
// Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
|
||||
// wlan0 00000000 0101A8C0 0003 0 0 0 00000000 0 0 0
|
||||
// wlan0 00000000 0101A8C0 0003 0 0 203 00000000 0 0 0
|
||||
// wlan0 0001A8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0
|
||||
// wlan0 0001A8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0
|
||||
// wlan0 0001A8C0 00000000 0001 0 0 203 00FFFFFF 0 0 0
|
||||
// wlan0 0101A8C0 00000000 0005 0 0 0 FFFFFFFF 0 0 0
|
||||
//
|
||||
// Obviously, this test fails on the first device and succeeds on the second. For this reason the test is modified to succeed
|
||||
// in case of devices like the first one since it's not a real failure but a shortcoming of the .NET API
|
||||
//
|
||||
foreach (NetworkInterface adapter in adapters)
|
||||
{
|
||||
IPInterfaceProperties adapterProperties = adapter.GetIPProperties ();
|
||||
GatewayIPAddressInformationCollection gatewayAddresses = adapterProperties.GatewayAddresses;
|
||||
numGatewayAddresses += gatewayAddresses.Count;
|
||||
numGatewayAddresses += HasOnlyDefaultGateway (adapter.Name) ? 1 : gatewayAddresses.Count;
|
||||
}
|
||||
|
||||
Assert.IsTrue (numGatewayAddresses > 0);
|
||||
}
|
||||
|
||||
@@ -56,6 +122,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
// The code works as expected when part of a regular app. It fails when executed from within an NUnit test
|
||||
// Might be a problem with the test suite. To investigate.
|
||||
[Category("AndroidNotWorking")]
|
||||
public void AtLeastOneDnsAddress ()
|
||||
{
|
||||
int numDnsAddresses = 0;
|
||||
@@ -66,6 +135,7 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
IPAddressCollection dnsAddresses = adapterProperties.DnsAddresses;
|
||||
numDnsAddresses += dnsAddresses.Count;
|
||||
}
|
||||
Console.WriteLine ("numDnsAddresses == {0}", numDnsAddresses);
|
||||
// reading /etc/resolve.conf does not work on iOS devices (but works on simulator)
|
||||
// ref: https://bugzilla.xamarin.com/show_bug.cgi?id=27707
|
||||
#if !MONOTOUCH
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnCrapStatusCodeTest ()
|
||||
{
|
||||
// On purpose,
|
||||
@@ -64,6 +65,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnWrongUpgradeHeader ()
|
||||
{
|
||||
#pragma warning disable 4014
|
||||
@@ -82,6 +84,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnWrongConnectionHeader ()
|
||||
{
|
||||
#pragma warning disable 4014
|
||||
@@ -102,6 +105,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // The test hangs when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void EchoTest ()
|
||||
{
|
||||
const string Payload = "This is a websocket test";
|
||||
@@ -126,6 +130,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void CloseOutputAsyncTest ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -142,6 +147,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void CloseAsyncTest ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -158,6 +164,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test, ExpectedException (typeof (ArgumentNullException))]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncArgTest_NoArray ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -171,6 +178,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test, ExpectedException (typeof (ArgumentNullException))]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ReceiveAsyncArgTest_NoArray ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -178,6 +186,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ReceiveAsyncWrongState_Closed ()
|
||||
{
|
||||
try {
|
||||
@@ -192,6 +201,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncWrongState_Closed ()
|
||||
{
|
||||
try {
|
||||
@@ -206,6 +216,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncWrongState_CloseSent ()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -476,6 +476,7 @@ namespace MonoTests.System.Net {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails ("reuse1") when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ConnectionReuse ()
|
||||
{
|
||||
var uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace MonoTests.System.Net
|
||||
Assert.AreEqual ("OK", res.StatusCode.ToString (), "#B1");
|
||||
Assert.AreEqual ("OK", res.StatusDescription, "#B2");
|
||||
|
||||
Assert.AreEqual ("text/html; charset=ISO-8859-1", res.Headers.Get ("Content-Type"), "#C1");
|
||||
Assert.IsTrue (res.Headers.Get ("Content-Type").StartsWith ("text/html; charset=", StringComparison.OrdinalIgnoreCase), "#C1");
|
||||
Assert.IsNotNull (res.LastModified, "#C2");
|
||||
Assert.AreEqual (0, res.Cookies.Count, "#C3");
|
||||
|
||||
@@ -123,14 +123,15 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("InetAccess")]
|
||||
//[Category("InetAccess")]
|
||||
[Category ("NotWorking")] // Disabled until a server that meets requirements is found
|
||||
public void Cookies1 ()
|
||||
{
|
||||
// The purpose of this test is to ensure that the cookies we get from a request
|
||||
// are stored in both, the CookieCollection in HttpWebResponse and the CookieContainer
|
||||
// in HttpWebRequest.
|
||||
// If this URL stops sending *one* and only one cookie, replace it.
|
||||
string url = "http://www.elmundo.es";
|
||||
string url = "http://xamarin.com";
|
||||
CookieContainer cookies = new CookieContainer ();
|
||||
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
|
||||
req.KeepAlive = false;
|
||||
@@ -2814,6 +2815,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("MobileNotWorking")]
|
||||
public void BeginWrite_Request_Aborted ()
|
||||
{
|
||||
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ServicePointManagerTest
|
||||
ServicePointManager.MaxServicePoints = 0;
|
||||
ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));
|
||||
Assert.AreEqual (apacheUri, sp.Address, "#1");
|
||||
#if NET_2_1
|
||||
#if NET_2_1 && !MONODROID
|
||||
Assert.AreEqual (10, sp.ConnectionLimit, "#2");
|
||||
#else
|
||||
Assert.AreEqual (2, sp.ConnectionLimit, "#2");
|
||||
|
||||
@@ -53,10 +53,13 @@ public class ServicePointTest
|
||||
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
|
||||
HttpWebResponse res = (HttpWebResponse) req.GetResponse ();
|
||||
|
||||
#if FOUND_SOME_OTHER_URL
|
||||
// URL is no longer found, disabled the test until a more reliable URL is found :P
|
||||
//WriteServicePoint ("google after getting a response", google);
|
||||
ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));
|
||||
Assert.AreEqual (google, google2, "#equals");
|
||||
res.Close ();
|
||||
#endif
|
||||
|
||||
// in both instances property CurrentConnections is 0 according to ms.net.
|
||||
// let's see what it says when we do async operations...
|
||||
@@ -83,10 +86,11 @@ public class ServicePointTest
|
||||
//Console.WriteLine ("ContentLength: " + res2.ContentLength);
|
||||
res2.Close ();
|
||||
|
||||
|
||||
ServicePoint sp2;
|
||||
#if FOUND_SOME_OTHER_URL
|
||||
// unless of course some buffering is taking place.. let's check
|
||||
Uri uri2 = new Uri ("http://freedesktop.org/Software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz");
|
||||
ServicePoint sp2 = ServicePointManager.FindServicePoint (uri2);
|
||||
sp2 = ServicePointManager.FindServicePoint (uri2);
|
||||
req2 = (HttpWebRequest) WebRequest.Create (uri2);
|
||||
async = req2.BeginGetResponse (null, null);
|
||||
//WriteServicePoint ("Large file: after async BeginGetResponse", sp2);
|
||||
@@ -97,6 +101,7 @@ public class ServicePointTest
|
||||
// and so it shows
|
||||
//Console.WriteLine ("ContentLength: " + res2.ContentLength);
|
||||
res2.Close ();
|
||||
#endif
|
||||
|
||||
|
||||
// what's the limit of the cache?
|
||||
@@ -148,6 +153,7 @@ public class ServicePointTest
|
||||
|
||||
[Test]
|
||||
[Category ("InetAccess")]
|
||||
[Category ("AndroidNotWorking")] // #A1 fails
|
||||
public void EndPointBind ()
|
||||
{
|
||||
Uri uri = new Uri ("http://www.go-mono.com/");
|
||||
@@ -163,7 +169,7 @@ public class ServicePointTest
|
||||
};
|
||||
req.GetResponse ().Close ();
|
||||
|
||||
Assert.IsTrue (called);
|
||||
Assert.IsTrue (called, "#A1");
|
||||
|
||||
req = (HttpWebRequest) WebRequest.Create (uri);
|
||||
called = false;
|
||||
@@ -174,7 +180,7 @@ public class ServicePointTest
|
||||
};
|
||||
req.GetResponse ().Close ();
|
||||
|
||||
Assert.IsTrue (called);
|
||||
Assert.IsTrue (called, "#A2");
|
||||
}
|
||||
|
||||
public static void GetRequestStreamCallback (IAsyncResult asynchronousResult)
|
||||
|
||||
@@ -119,6 +119,14 @@ namespace MonoTests.System.Net
|
||||
// ignore interruption of blocking call
|
||||
if (ex.ErrorCode != SOCKET_CLOSED && ex.ErrorCode != SOCKET_INVALID_ARGS)
|
||||
throw;
|
||||
#if MOBILE
|
||||
} catch (InvalidOperationException ex) {
|
||||
// This breaks some tests running on Android. The problem is that the stack trace
|
||||
// doesn't point to where the exception is actually thrown from but the entire process
|
||||
// is aborted because of unhandled exception.
|
||||
Console.WriteLine ("SocketResponder.Listen failed:");
|
||||
Console.WriteLine (ex);
|
||||
#endif
|
||||
} finally {
|
||||
Thread.Sleep (500);
|
||||
if (socket != null)
|
||||
|
||||
@@ -1417,6 +1417,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void UploadValues1 ()
|
||||
{
|
||||
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
|
||||
@@ -1783,6 +1784,7 @@ namespace MonoTests.System.Net
|
||||
|
||||
#if NET_4_5
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void UploadStringAsyncCancelEvent ()
|
||||
{
|
||||
UploadAsyncCancelEventTest (9301, (webClient, uri, cancelEvent) =>
|
||||
@@ -1799,6 +1801,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void UploadDataAsyncCancelEvent ()
|
||||
{
|
||||
UploadAsyncCancelEventTest (9302, (webClient, uri, cancelEvent) =>
|
||||
@@ -1814,6 +1817,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void UploadValuesAsyncCancelEvent ()
|
||||
{
|
||||
UploadAsyncCancelEventTest (9303, (webClient, uri, cancelEvent) =>
|
||||
@@ -1829,6 +1833,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void UploadFileAsyncCancelEvent ()
|
||||
{
|
||||
UploadAsyncCancelEventTest (9304,(webClient, uri, cancelEvent) =>
|
||||
@@ -1847,6 +1852,7 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Test suite hangs if the tests runs as part of the entire BCL suite. Works when only this fixture is ran
|
||||
public void UploadFileAsyncContentType ()
|
||||
{
|
||||
var serverUri = "http://localhost:13370/";
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace MonoTests.System.Net
|
||||
{
|
||||
[Test]
|
||||
[Category("Async")]
|
||||
[Category("AndroidNotWorking")] // Attempts to access the test dll which won't work on Android
|
||||
public void DownloadData ()
|
||||
{
|
||||
WebClient wc;
|
||||
@@ -94,6 +95,7 @@ namespace MonoTests.System.Net
|
||||
|
||||
[Test]
|
||||
[Category("InetAccess")]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void Cancellation ()
|
||||
{
|
||||
WebClient wc = new WebClient ();
|
||||
@@ -121,6 +123,7 @@ namespace MonoTests.System.Net
|
||||
|
||||
[Test]
|
||||
[Category("InetAccess")]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void DownloadMultiple ()
|
||||
{
|
||||
WebClient wc = new WebClient ();
|
||||
@@ -139,6 +142,7 @@ namespace MonoTests.System.Net
|
||||
|
||||
[Test]
|
||||
[Category("InetAccess")]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void DownloadMultiple2 ()
|
||||
{
|
||||
WebClient wc = new WebClient ();
|
||||
@@ -151,6 +155,7 @@ namespace MonoTests.System.Net
|
||||
|
||||
[Test]
|
||||
[Category("InetAccess")]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void DownloadMultiple3 ()
|
||||
{
|
||||
WebClient wc = new WebClient ();
|
||||
|
||||
@@ -316,6 +316,9 @@ namespace MonoTests.System.Net {
|
||||
}
|
||||
|
||||
[Test] //BNC#323452
|
||||
// Throws exception with Status == Timeout. The same code behaves as the test expects when run from a regular app.
|
||||
// Might be an issue with the test suite. To investigate.
|
||||
[Category("AndroidNotWorking")]
|
||||
public void TestFailedConnection ()
|
||||
{
|
||||
try {
|
||||
@@ -326,7 +329,7 @@ namespace MonoTests.System.Net {
|
||||
//#if NET_2_0 e.Message == "Unable to connect to the remote server"
|
||||
//#if NET_1_1 e.Message == "The underlying connection was closed: Unable to connect to the remote server."
|
||||
|
||||
Assert.AreEqual (((WebException)e).Status, WebExceptionStatus.ConnectFailure);
|
||||
Assert.AreEqual (WebExceptionStatus.ConnectFailure, ((WebException)e).Status);
|
||||
|
||||
//#if !NET_1_1 (this is not true in .NET 1.x)
|
||||
Assert.IsNotNull (e.InnerException);
|
||||
@@ -337,6 +340,7 @@ namespace MonoTests.System.Net {
|
||||
}
|
||||
|
||||
[Test] //BNC#323452
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void TestFailedResolution ()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -387,6 +387,13 @@ namespace MonoTests.System
|
||||
// this is what ASP.NET really means (the ?)
|
||||
Assert.AreEqual ("http://192.168.0.21/error404.aspx?aspxerrorpath=/WebResource.axd", ub.Uri.ToString ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NoHostname ()
|
||||
{
|
||||
UriBuilder ub = new UriBuilder ("about", null, -1, "config");
|
||||
Assert.AreEqual ("about:config", ub.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1946,12 +1946,44 @@ namespace MonoTests.System
|
||||
[Test]
|
||||
public void DotNetRelativeOrAbsoluteTest ()
|
||||
{
|
||||
var uri1 = new Uri ("/foo", DotNetRelativeOrAbsolute);
|
||||
Assert.IsFalse (uri1.IsAbsoluteUri);
|
||||
|
||||
Uri uri2;
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri2);
|
||||
Assert.IsFalse (uri2.IsAbsoluteUri);
|
||||
FieldInfo useDotNetRelativeOrAbsoluteField = null;
|
||||
bool useDotNetRelativeOrAbsoluteOld = false;
|
||||
|
||||
if (Type.GetType ("Mono.Runtime") != null) {
|
||||
useDotNetRelativeOrAbsoluteField = typeof (Uri).GetField ("useDotNetRelativeOrAbsolute",
|
||||
BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
|
||||
useDotNetRelativeOrAbsoluteOld = (bool) useDotNetRelativeOrAbsoluteField.GetValue (null);
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, false);
|
||||
}
|
||||
|
||||
try {
|
||||
Uri uri;
|
||||
|
||||
uri = new Uri ("/foo", DotNetRelativeOrAbsolute);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
if (useDotNetRelativeOrAbsoluteField != null) {
|
||||
uri = new Uri ("/foo", UriKind.RelativeOrAbsolute);
|
||||
Assert.IsTrue (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", UriKind.RelativeOrAbsolute, out uri);
|
||||
Assert.IsTrue (uri.IsAbsoluteUri);
|
||||
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, true);
|
||||
}
|
||||
|
||||
uri = new Uri ("/foo", UriKind.RelativeOrAbsolute);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
} finally {
|
||||
if (useDotNetRelativeOrAbsoluteField != null)
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, useDotNetRelativeOrAbsoluteOld);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -725,6 +725,8 @@ ReferenceSources/Win32Exception.cs
|
||||
../../../external/referencesource/System/net/System/Net/WebPermission.cs
|
||||
../../../external/referencesource/System/net/System/Net/WriteStreamClosedEventArgs.cs
|
||||
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/IPInterfaceStatistics.cs
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/ScopeLevel.cs
|
||||
../../../external/referencesource/System/net/System/Net/NetworkInformation/UnicastIPAddressInformation.cs
|
||||
../../../external/referencesource/System/sys/system/threading/Barrier.cs
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace System
|
||||
switch (codePage) {
|
||||
case 1200: return GetResourceString ("Globalization.cp_1200");
|
||||
case 1201: return GetResourceString ("Globalization.cp_1201");
|
||||
case 12000: return GetResourceString ("Globalization.cp_12000");
|
||||
case 12001: return GetResourceString ("Globalization.cp_12001");
|
||||
case 20127: return GetResourceString ("Globalization.cp_20127");
|
||||
case 65000: return GetResourceString ("Globalization.cp_65000");
|
||||
case 65001: return GetResourceString ("Globalization.cp_65001");
|
||||
default: return codePage.ToString (CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace System.Diagnostics {
|
||||
public const int METHODS_TO_SKIP = 0;
|
||||
|
||||
private StackFrame[] frames;
|
||||
readonly StackTrace[] captured_traces;
|
||||
private bool debug_info;
|
||||
|
||||
public StackTrace ()
|
||||
@@ -119,11 +120,6 @@ namespace System.Diagnostics {
|
||||
}
|
||||
|
||||
public StackTrace (Exception e, int skipFrames, bool fNeedFileInfo)
|
||||
: this (e, skipFrames, fNeedFileInfo, false)
|
||||
{
|
||||
}
|
||||
|
||||
internal StackTrace (Exception e, int skipFrames, bool fNeedFileInfo, bool returnNativeFrames)
|
||||
{
|
||||
if (e == null)
|
||||
throw new ArgumentNullException ("e");
|
||||
@@ -132,22 +128,7 @@ namespace System.Diagnostics {
|
||||
|
||||
frames = get_trace (e, skipFrames, fNeedFileInfo);
|
||||
|
||||
if (!returnNativeFrames) {
|
||||
bool resize = false;
|
||||
for (int i = 0; i < frames.Length; ++i)
|
||||
if (frames [i].GetMethod () == null)
|
||||
resize = true;
|
||||
|
||||
if (resize) {
|
||||
var l = new List<StackFrame> ();
|
||||
|
||||
for (int i = 0; i < frames.Length; ++i)
|
||||
if (frames [i].GetMethod () != null)
|
||||
l.Add (frames [i]);
|
||||
|
||||
frames = l.ToArray ();
|
||||
}
|
||||
}
|
||||
captured_traces = e.captured_traces;
|
||||
}
|
||||
|
||||
public StackTrace (StackFrame frame)
|
||||
@@ -189,7 +170,7 @@ namespace System.Diagnostics {
|
||||
return frames;
|
||||
}
|
||||
|
||||
internal bool AddFrames (StringBuilder sb, bool isException = false)
|
||||
bool AddFrames (StringBuilder sb, bool isException = false)
|
||||
{
|
||||
bool printOffset;
|
||||
string debugInfo, indentation;
|
||||
@@ -306,6 +287,21 @@ namespace System.Diagnostics {
|
||||
public override string ToString ()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
//
|
||||
// Add traces captured using ExceptionDispatchInfo
|
||||
//
|
||||
if (captured_traces != null) {
|
||||
foreach (var t in captured_traces) {
|
||||
if (!t.AddFrames (sb, true))
|
||||
continue;
|
||||
|
||||
sb.Append (Environment.NewLine);
|
||||
sb.Append ("--- End of stack trace from previous location where exception was thrown ---");
|
||||
sb.Append (Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
AddFrames (sb);
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
@@ -816,8 +816,15 @@ namespace System.Globalization
|
||||
CultureInfo ci = new CultureInfo ();
|
||||
|
||||
if (!ci.construct_internal_locale_from_name (name)) {
|
||||
int idx = name.IndexOf ('-');
|
||||
if (idx < 1 || !ci.construct_internal_locale_from_name (name.Substring (0, idx)))
|
||||
int idx = name.Length - 1;
|
||||
if (idx > 0) {
|
||||
while ((idx = name.LastIndexOf ('-', idx - 1)) > 0) {
|
||||
if (ci.construct_internal_locale_from_name (name.Substring (0, idx)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx <= 0)
|
||||
throw CreateNotFoundException (src_name);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,12 +69,28 @@ namespace System.Reflection {
|
||||
}
|
||||
}
|
||||
|
||||
public override Module Module {
|
||||
get {
|
||||
return GetRuntimeModule ();
|
||||
}
|
||||
}
|
||||
|
||||
internal RuntimeType GetDeclaringTypeInternal ()
|
||||
{
|
||||
return (RuntimeType) DeclaringType;
|
||||
}
|
||||
|
||||
RuntimeType ReflectedTypeInternal {
|
||||
get {
|
||||
return (RuntimeType) ReflectedType;
|
||||
}
|
||||
}
|
||||
|
||||
internal RuntimeModule GetRuntimeModule ()
|
||||
{
|
||||
return GetDeclaringTypeInternal ().GetRuntimeModule ();
|
||||
}
|
||||
|
||||
#region ISerializable
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
|
||||
@@ -82,12 +82,28 @@ namespace System.Reflection {
|
||||
}
|
||||
}
|
||||
|
||||
public override Module Module {
|
||||
get {
|
||||
return GetRuntimeModule ();
|
||||
}
|
||||
}
|
||||
|
||||
internal RuntimeType GetDeclaringTypeInternal ()
|
||||
{
|
||||
return (RuntimeType) DeclaringType;
|
||||
}
|
||||
|
||||
RuntimeType ReflectedTypeInternal {
|
||||
get {
|
||||
return (RuntimeType) ReflectedType;
|
||||
}
|
||||
}
|
||||
|
||||
internal RuntimeModule GetRuntimeModule ()
|
||||
{
|
||||
return GetDeclaringTypeInternal ().GetRuntimeModule ();
|
||||
}
|
||||
|
||||
#region Object Overrides
|
||||
public override String ToString()
|
||||
{
|
||||
|
||||
@@ -86,6 +86,9 @@ namespace System.Runtime.Remoting.Contexts {
|
||||
|
||||
[MethodImpl (MethodImplOptions.InternalCall)]
|
||||
extern static void RegisterContext (Context ctx);
|
||||
|
||||
[MethodImpl (MethodImplOptions.InternalCall)]
|
||||
extern static void ReleaseContext (Context ctx);
|
||||
|
||||
public Context ()
|
||||
{
|
||||
@@ -97,6 +100,7 @@ namespace System.Runtime.Remoting.Contexts {
|
||||
|
||||
~Context ()
|
||||
{
|
||||
ReleaseContext (this);
|
||||
}
|
||||
|
||||
public static Context DefaultContext {
|
||||
|
||||
@@ -90,7 +90,6 @@ namespace System.Threading {
|
||||
private IntPtr interrupt_on_stop;
|
||||
private IntPtr flags;
|
||||
private IntPtr thread_pinning_ref;
|
||||
private IntPtr async_invoke_method;
|
||||
/*
|
||||
* These fields are used to avoid having to increment corlib versions
|
||||
* when a new field is added to the unmanaged MonoThread structure.
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
//
|
||||
// System.Threading.ThreadPool.cs
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson
|
||||
// Dick Porter ([email protected])
|
||||
// Maurer Dietmar ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc. http://www.ximian.com
|
||||
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
|
||||
namespace System.Threading {
|
||||
|
||||
public static class ThreadPool {
|
||||
|
||||
[Obsolete("This method is obsolete, use BindHandle(SafeHandle) instead")]
|
||||
public static bool BindHandle (IntPtr osHandle)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.BindHandle (osHandle);
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool BindHandle (SafeHandle osHandle)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool) {
|
||||
return Microsoft.ThreadPool.BindHandle (osHandle);
|
||||
} else {
|
||||
if (osHandle == null)
|
||||
throw new ArgumentNullException ("osHandle");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetAvailableThreads (out int workerThreads, out int completionPortThreads)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
|
||||
else
|
||||
GetAvailableThreads_internal (out workerThreads, out completionPortThreads);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern void GetAvailableThreads_internal (out int workerThreads, out int completionPortThreads);
|
||||
|
||||
public static void GetMaxThreads (out int workerThreads, out int completionPortThreads)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
|
||||
else
|
||||
GetMaxThreads_internal (out workerThreads, out completionPortThreads);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern void GetMaxThreads_internal (out int workerThreads, out int completionPortThreads);
|
||||
|
||||
public static void GetMinThreads (out int workerThreads, out int completionPortThreads)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.GetMinThreads (out workerThreads, out completionPortThreads);
|
||||
else
|
||||
GetMinThreads_internal (out workerThreads, out completionPortThreads);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern void GetMinThreads_internal (out int workerThreads, out int completionPortThreads);
|
||||
|
||||
[MonoTODO("The min number of completion port threads is not evaluated.")]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlThread=true)]
|
||||
public static bool SetMinThreads (int workerThreads, int completionPortThreads)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.SetMinThreads (workerThreads, completionPortThreads);
|
||||
else
|
||||
return SetMinThreads_internal (workerThreads, completionPortThreads);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern bool SetMinThreads_internal (int workerThreads, int completionPortThreads);
|
||||
|
||||
[SecurityPermission (SecurityAction.Demand, ControlThread=true)]
|
||||
public static bool SetMaxThreads (int workerThreads, int completionPortThreads)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.SetMaxThreads (workerThreads, completionPortThreads);
|
||||
else
|
||||
return SetMaxThreads_internal (workerThreads, completionPortThreads);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern bool SetMaxThreads_internal (int workerThreads, int completionPortThreads);
|
||||
|
||||
public static bool QueueUserWorkItem (WaitCallback callBack)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.QueueUserWorkItem (callBack, null);
|
||||
else
|
||||
return QueueUserWorkItem (callBack, null);
|
||||
}
|
||||
|
||||
public static bool QueueUserWorkItem (WaitCallback callBack, object state)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool) {
|
||||
return Microsoft.ThreadPool.QueueUserWorkItem (callBack, state);
|
||||
} else {
|
||||
if (callBack == null)
|
||||
throw new ArgumentNullException ("callBack");
|
||||
|
||||
if (callBack.IsTransparentProxy ()) {
|
||||
IAsyncResult ar = callBack.BeginInvoke (state, null, null);
|
||||
if (ar == null)
|
||||
return false;
|
||||
} else {
|
||||
AsyncResult ares = new AsyncResult (callBack, state, !ExecutionContext.IsFlowSuppressed());
|
||||
pool_queue (ares);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern void pool_queue (AsyncResult ares);
|
||||
|
||||
// TODO: It should be interface interface only to avoid extra allocation
|
||||
internal static void QueueWorkItem (WaitCallback callBack, object state)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.QueueUserWorkItem (callBack, state);
|
||||
else
|
||||
pool_queue (new AsyncResult (callBack, state, false));
|
||||
}
|
||||
|
||||
public static RegisteredWaitHandle RegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack,
|
||||
object state,
|
||||
int millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.RegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
else
|
||||
return RegisterWaitForSingleObject (waitObject, callBack, state, (long) millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
}
|
||||
|
||||
public static RegisteredWaitHandle RegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack,
|
||||
object state,
|
||||
long millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool) {
|
||||
return Microsoft.ThreadPool.RegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
} else {
|
||||
if (waitObject == null)
|
||||
throw new ArgumentNullException ("waitObject");
|
||||
|
||||
if (callBack == null)
|
||||
throw new ArgumentNullException ("callBack");
|
||||
|
||||
if (millisecondsTimeOutInterval < -1)
|
||||
throw new ArgumentOutOfRangeException ("timeout", "timeout < -1");
|
||||
|
||||
if (millisecondsTimeOutInterval > Int32.MaxValue)
|
||||
throw new NotSupportedException ("Timeout is too big. Maximum is Int32.MaxValue");
|
||||
|
||||
TimeSpan timeout = new TimeSpan (0, 0, 0, 0, (int) millisecondsTimeOutInterval);
|
||||
|
||||
RegisteredWaitHandle waiter = new RegisteredWaitHandle (waitObject, callBack, state,
|
||||
timeout, executeOnlyOnce);
|
||||
QueueUserWorkItem (new WaitCallback (waiter.Wait), null);
|
||||
return waiter;
|
||||
}
|
||||
}
|
||||
|
||||
public static RegisteredWaitHandle RegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack,
|
||||
object state,
|
||||
TimeSpan timeout,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.RegisterWaitForSingleObject (waitObject, callBack, state, timeout, executeOnlyOnce);
|
||||
else
|
||||
return RegisterWaitForSingleObject (waitObject, callBack, state, (long) timeout.TotalMilliseconds, executeOnlyOnce);
|
||||
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public static RegisteredWaitHandle RegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack,
|
||||
object state,
|
||||
uint millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.RegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
else
|
||||
return RegisterWaitForSingleObject (waitObject, callBack, state, (long) millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
unsafe public static bool UnsafeQueueNativeOverlapped (NativeOverlapped *overlapped)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.UnsafeQueueNativeOverlapped (overlapped);
|
||||
else
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#if !NET_2_1 || MOBILE
|
||||
|
||||
[SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
|
||||
public static bool UnsafeQueueUserWorkItem (WaitCallback callBack, object state)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool) {
|
||||
return Microsoft.ThreadPool.UnsafeQueueUserWorkItem (callBack, state);
|
||||
} else {
|
||||
if (callBack == null)
|
||||
throw new ArgumentNullException ("callBack");
|
||||
|
||||
// no stack propagation here (that's why it's unsafe and requires extra security permissions)
|
||||
if (!callBack.IsTransparentProxy ()) {
|
||||
AsyncResult ares = new AsyncResult (callBack, state, false);
|
||||
pool_queue (ares);
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
if (!ExecutionContext.IsFlowSuppressed ())
|
||||
ExecutionContext.SuppressFlow (); // on current thread only
|
||||
IAsyncResult ar = callBack.BeginInvoke (state, null, null);
|
||||
if (ar == null)
|
||||
return false;
|
||||
} finally {
|
||||
if (ExecutionContext.IsFlowSuppressed ())
|
||||
ExecutionContext.RestoreFlow ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
|
||||
public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack, object state, int millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.UnsafeRegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
else
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
|
||||
public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack, object state, long millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.UnsafeRegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
else
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
|
||||
public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack, object state, TimeSpan timeout,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.UnsafeRegisterWaitForSingleObject (waitObject, callBack, state, timeout, executeOnlyOnce);
|
||||
else
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
[CLSCompliant (false)]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
|
||||
public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject (WaitHandle waitObject,
|
||||
WaitOrTimerCallback callBack, object state, uint millisecondsTimeOutInterval,
|
||||
bool executeOnlyOnce)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.UnsafeRegisterWaitForSingleObject (waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce);
|
||||
else
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#region ReferenceSources
|
||||
// Extracted from ../../../../external/referencesource/mscorlib/system/threading/threadpool.cs
|
||||
internal static void UnsafeQueueCustomWorkItem(IThreadPoolWorkItem workItem, bool forceGlobal)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.UnsafeQueueCustomWorkItem (workItem, forceGlobal);
|
||||
else
|
||||
QueueWorkItem ((obj) => ((IThreadPoolWorkItem)obj).ExecuteWorkItem (), workItem);
|
||||
}
|
||||
|
||||
internal static IEnumerable<IThreadPoolWorkItem> GetQueuedWorkItems()
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.GetQueuedWorkItems ();
|
||||
else
|
||||
return new IThreadPoolWorkItem [0];
|
||||
}
|
||||
|
||||
internal static bool TryPopCustomWorkItem(IThreadPoolWorkItem workItem)
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
return Microsoft.ThreadPool.TryPopCustomWorkItem (workItem);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static void NotifyWorkItemProgress()
|
||||
{
|
||||
if (Microsoft.ThreadPool.UseMicrosoftThreadPool)
|
||||
Microsoft.ThreadPool.NotifyWorkItemProgress ();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace System {
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#pragma warning disable 169
|
||||
private const int mono_corlib_version = 134;
|
||||
private const int mono_corlib_version = 135;
|
||||
#pragma warning restore 169
|
||||
|
||||
[ComVisible (true)]
|
||||
|
||||
@@ -199,26 +199,8 @@ namespace System
|
||||
/* Not thrown yet */
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
// Add traces captured using ExceptionDispatchInfo
|
||||
if (captured_traces != null) {
|
||||
foreach (var t in captured_traces) {
|
||||
if (!t.AddFrames (sb, true))
|
||||
continue;
|
||||
|
||||
sb.Append (Environment.NewLine);
|
||||
sb.Append ("--- End of stack trace from previous location where exception was thrown ---");
|
||||
sb.Append (Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
StackTrace st = new StackTrace (this, 0, true, true);
|
||||
st.AddFrames (sb, true);
|
||||
|
||||
stack_trace = sb.ToString ();
|
||||
|
||||
return stack_trace;
|
||||
StackTrace st = new StackTrace (this, 0, true);
|
||||
return stack_trace = st.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,6 +298,7 @@ namespace System
|
||||
{
|
||||
captured_traces = (StackTrace[]) exceptionDispatchInfo.BinaryStackTraceArray;
|
||||
trace_ips = null;
|
||||
stack_trace = null;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -870,12 +870,12 @@ namespace System
|
||||
}
|
||||
|
||||
// DaylightTime.Start is relative to the Standard time.
|
||||
if (start != DateTime.MinValue)
|
||||
start += BaseUtcOffset;
|
||||
if (!TryAddTicks (start, BaseUtcOffset.Ticks, out start))
|
||||
start = DateTime.MinValue;
|
||||
|
||||
// DaylightTime.End is relative to the DST time.
|
||||
if (end != DateTime.MinValue)
|
||||
end += BaseUtcOffset + delta;
|
||||
if (!TryAddTicks (end, BaseUtcOffset.Ticks + delta.Ticks, out end))
|
||||
end = DateTime.MinValue;
|
||||
} else {
|
||||
AdjustmentRule first = null, last = null;
|
||||
|
||||
|
||||
@@ -171,6 +171,21 @@ namespace MonoTests.System.Globalization
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("");
|
||||
Assert.AreEqual (CultureInfo.InvariantCulture, ci, "#5");
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("zh-hant");
|
||||
Assert.AreEqual ("zh-HK", ci.Name, "#6");
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("zh-hans");
|
||||
Assert.AreEqual ("zh-CN", ci.Name, "#7");
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("zh-hans-CN");
|
||||
Assert.AreEqual ("zh-CN", ci.Name, "#8");
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("zh-hant-US");
|
||||
Assert.AreEqual ("zh-HK", ci.Name, "#9");
|
||||
|
||||
ci = CultureInfo.CreateSpecificCulture ("az-CyrlM-BR");
|
||||
Assert.AreEqual ("az-Latn-AZ", ci.Name, "#10");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -87,12 +87,13 @@ namespace MonoTests.System.IO
|
||||
[Test]
|
||||
public void CtorFileNotFoundException_Mode_Open ()
|
||||
{
|
||||
const string file_name = "thisfileshouldnotexist.test";
|
||||
// absolute path
|
||||
string path = TempFolder + DSC + "thisfileshouldnotexists.test";
|
||||
string path = TempFolder + DSC + file_name;
|
||||
DeleteFile (path);
|
||||
FileStream stream = null;
|
||||
try {
|
||||
stream = new FileStream (TempFolder + DSC + "thisfileshouldnotexists.test", FileMode.Open);
|
||||
stream = new FileStream (TempFolder + DSC + file_name, FileMode.Open);
|
||||
Assert.Fail ("#A1");
|
||||
} catch (FileNotFoundException ex) {
|
||||
Assert.AreEqual (typeof (FileNotFoundException), ex.GetType (), "#A2");
|
||||
@@ -111,14 +112,18 @@ namespace MonoTests.System.IO
|
||||
// relative path
|
||||
string orignalCurrentDir = Directory.GetCurrentDirectory ();
|
||||
Directory.SetCurrentDirectory (TempFolder);
|
||||
|
||||
// If TempFolder is a symlink, Mono will follow it and ex.FileName below will contain
|
||||
// the real directory name, not that of the TempFolder symlink and the test will fail
|
||||
// (happens e.g. on Android M)
|
||||
string realTempDir = Directory.GetCurrentDirectory ();
|
||||
path = realTempDir + DSC + file_name;
|
||||
|
||||
try {
|
||||
stream = new FileStream ("thisfileshouldnotexists.test", FileMode.Open);
|
||||
stream = new FileStream (file_name, FileMode.Open);
|
||||
Assert.Fail ("#B1");
|
||||
} catch (FileNotFoundException ex) {
|
||||
Assert.AreEqual (typeof (FileNotFoundException), ex.GetType (), "#B2");
|
||||
// under OSX 'var' is a symlink to 'private/var'
|
||||
if (MacOSX)
|
||||
path = "/private" + path;
|
||||
Assert.AreEqual (path, ex.FileName, "#B3");
|
||||
Assert.IsNull (ex.InnerException, "#B4");
|
||||
Assert.IsNotNull (ex.Message, "#B5");
|
||||
@@ -135,8 +140,9 @@ namespace MonoTests.System.IO
|
||||
[Test]
|
||||
public void CtorFileNotFoundException_Mode_Truncate ()
|
||||
{
|
||||
const string file_name = "thisfileshouldNOTexist.test";
|
||||
// absolute path
|
||||
string path = TempFolder + DSC + "thisfileshouldNOTexists.test";
|
||||
string path = TempFolder + DSC + file_name;
|
||||
DeleteFile (path);
|
||||
FileStream stream = null;
|
||||
try {
|
||||
@@ -159,14 +165,18 @@ namespace MonoTests.System.IO
|
||||
// relative path
|
||||
string orignalCurrentDir = Directory.GetCurrentDirectory ();
|
||||
Directory.SetCurrentDirectory (TempFolder);
|
||||
|
||||
// If TempFolder is a symlink, Mono will follow it and ex.FileName below will contain
|
||||
// the real directory name, not that of the TempFolder symlink and the test will fail
|
||||
// (happens e.g. on Android M)
|
||||
string realTempDir = Directory.GetCurrentDirectory ();
|
||||
path = realTempDir + DSC + file_name;
|
||||
|
||||
try {
|
||||
stream = new FileStream ("thisfileshouldNOTexists.test", FileMode.Truncate);
|
||||
stream = new FileStream (file_name, FileMode.Truncate);
|
||||
Assert.Fail ("#B1");
|
||||
} catch (FileNotFoundException ex) {
|
||||
Assert.AreEqual (typeof (FileNotFoundException), ex.GetType (), "#B2");
|
||||
// under OSX 'var' is a symlink to 'private/var'
|
||||
if (MacOSX)
|
||||
path = "/private" + path;
|
||||
Assert.AreEqual (path, ex.FileName, "#B3");
|
||||
Assert.IsNull (ex.InnerException, "#B4");
|
||||
Assert.IsNotNull (ex.Message, "#B5");
|
||||
@@ -183,8 +193,9 @@ namespace MonoTests.System.IO
|
||||
[Test]
|
||||
public void CtorIOException1 ()
|
||||
{
|
||||
const string file_name = "thisfileshouldexists.test";
|
||||
// absolute path
|
||||
string path = TempFolder + DSC + "thisfileshouldexists.test";
|
||||
string path = TempFolder + DSC + file_name;
|
||||
FileStream stream = null;
|
||||
DeleteFile (path);
|
||||
try {
|
||||
@@ -209,11 +220,18 @@ namespace MonoTests.System.IO
|
||||
// relative path
|
||||
string orignalCurrentDir = Directory.GetCurrentDirectory ();
|
||||
Directory.SetCurrentDirectory (TempFolder);
|
||||
|
||||
// If TempFolder is a symlink, Mono will follow it and ex.FileName below will contain
|
||||
// the real directory name, not that of the TempFolder symlink and the test will fail
|
||||
// (happens e.g. on Android M)
|
||||
string realTempDir = Directory.GetCurrentDirectory ();
|
||||
path = realTempDir + DSC + file_name;
|
||||
|
||||
try {
|
||||
stream = new FileStream ("thisfileshouldexists.test", FileMode.CreateNew);
|
||||
stream = new FileStream (file_name, FileMode.CreateNew);
|
||||
stream.Close ();
|
||||
stream = null;
|
||||
stream = new FileStream ("thisfileshouldexists.test", FileMode.CreateNew);
|
||||
stream = new FileStream (file_name, FileMode.CreateNew);
|
||||
Assert.Fail ("#B1");
|
||||
} catch (IOException ex) {
|
||||
Assert.AreEqual (typeof (IOException), ex.GetType (), "#B2");
|
||||
@@ -327,8 +345,14 @@ namespace MonoTests.System.IO
|
||||
{
|
||||
string orignalCurrentDir = Directory.GetCurrentDirectory ();
|
||||
Directory.SetCurrentDirectory (TempFolder);
|
||||
|
||||
// If TempFolder is a symlink, Mono will follow it and ex.FileName below will contain
|
||||
// the real directory name, not that of the TempFolder symlink and the test will fail
|
||||
// (happens e.g. on Android M)
|
||||
string realTempDir = Directory.GetCurrentDirectory ();
|
||||
|
||||
string relativePath = "DirectoryDoesNotExist" + Path.DirectorySeparatorChar + "file.txt";
|
||||
string fullPath = Path.Combine (TempFolder, relativePath);
|
||||
string fullPath = Path.Combine (realTempDir, relativePath);
|
||||
try {
|
||||
new FileStream (relativePath, FileMode.Open);
|
||||
Assert.Fail ("#A1");
|
||||
|
||||
@@ -2537,6 +2537,7 @@ namespace MonoTests.System.IO
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // locks with offsets bigger than Int32.Max don't work on Android
|
||||
public void Lock_Large ()
|
||||
{
|
||||
// note: already worked without HAVE_LARGE_FILE_SUPPORT
|
||||
|
||||
@@ -173,9 +173,10 @@ namespace MonoTests.System.IO
|
||||
Assert.AreEqual ("one", testPath, "Combine #03");
|
||||
|
||||
string current = Directory.GetCurrentDirectory ();
|
||||
bool currentIsDSC = current.Length == 1 && current [0] == DSC;
|
||||
testPath = Path.Combine (current, "one");
|
||||
|
||||
string expected = current + DSC + "one";
|
||||
string expected = (currentIsDSC ? String.Empty : current) + DSC + "one";
|
||||
Assert.AreEqual (expected, testPath, "Combine #04");
|
||||
|
||||
testPath = Path.Combine ("one", current);
|
||||
@@ -484,9 +485,9 @@ namespace MonoTests.System.IO
|
||||
public void GetFullPath ()
|
||||
{
|
||||
string current = Directory.GetCurrentDirectory ();
|
||||
|
||||
bool currentIsDSC = current.Length == 1 && current [0] == DSC;
|
||||
string testFullPath = Path.GetFullPath ("foo.txt");
|
||||
string expected = current + DSC + "foo.txt";
|
||||
string expected = (currentIsDSC ? String.Empty : current) + DSC + "foo.txt";
|
||||
Assert.AreEqual (expected, testFullPath, "GetFullPath #01");
|
||||
|
||||
testFullPath = Path.GetFullPath ("a//./.././foo.txt");
|
||||
|
||||
@@ -410,6 +410,7 @@ public class AssemblyBuilderTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // DefineResource doesn't allow path in its fileName parameter and the test attempts to write to / in effect
|
||||
public void TestDefineResource ()
|
||||
{
|
||||
ab.DefineResource ("foo", "FOO", "foo.txt", ResourceAttributes.Public);
|
||||
@@ -586,6 +587,7 @@ public class AssemblyBuilderTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.Compilerservices.SymbolWriter assembly
|
||||
public void TestDefineDynamicModule ()
|
||||
{
|
||||
ab.DefineDynamicModule ("foo", "foo.dll");
|
||||
@@ -1829,9 +1831,13 @@ public class AssemblyBuilderTest
|
||||
fullName);
|
||||
newDomain.DoCallBack (new CrossAppDomainDelegate (helper.Test));
|
||||
} finally {
|
||||
#if !MONODROID
|
||||
// RUNTIME: crash
|
||||
// AppDomain unloading crashes the runtime on Android
|
||||
if (newDomain != null) {
|
||||
AppDomain.Unload (newDomain);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -830,6 +830,7 @@ public class ConstructorBuilderTest
|
||||
|
||||
// Same as in MethodBuilderTest
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // No declarative security in the mobile profile
|
||||
public void AddDeclarativeSecurity_Complete ()
|
||||
{
|
||||
ConstructorBuilder cb = genClass.DefineConstructor (
|
||||
@@ -851,6 +852,7 @@ public class ConstructorBuilderTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // No declarative security in the mobile profile
|
||||
public void AddDeclarativeSecurity_PSet_Null ()
|
||||
{
|
||||
ConstructorBuilder cb = genClass.DefineConstructor (
|
||||
@@ -867,6 +869,7 @@ public class ConstructorBuilderTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // No declarative security in the mobile profile
|
||||
public void AddDeclarativeSecurity_Action_Invalid ()
|
||||
{
|
||||
ConstructorBuilder cb = genClass.DefineConstructor (
|
||||
@@ -892,6 +895,7 @@ public class ConstructorBuilderTest
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // No declarative security in the mobile profile
|
||||
public void AddDeclarativeSecurity_Action_Duplicate ()
|
||||
{
|
||||
ConstructorBuilder cb = genClass.DefineConstructor (
|
||||
|
||||
@@ -12,6 +12,8 @@ using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -477,6 +479,106 @@ namespace MonoTests.System.Reflection.Emit
|
||||
public string Name;
|
||||
}
|
||||
|
||||
class ExceptionHandling_Test_Support
|
||||
{
|
||||
public static Exception Caught;
|
||||
public static string CaughtStackTrace;
|
||||
|
||||
public static void ThrowMe ()
|
||||
{
|
||||
Caught = null;
|
||||
CaughtStackTrace = null;
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
public static void Handler (Exception e)
|
||||
{
|
||||
Caught = e;
|
||||
CaughtStackTrace = e.StackTrace.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ExceptionHandling ()
|
||||
{
|
||||
var method = new DynamicMethod ("", typeof(void), new[] { typeof(int) }, typeof (DynamicMethodTest));
|
||||
var ig = method.GetILGenerator ();
|
||||
|
||||
ig.BeginExceptionBlock();
|
||||
ig.Emit(OpCodes.Call, typeof(ExceptionHandling_Test_Support).GetMethod("ThrowMe"));
|
||||
|
||||
ig.BeginCatchBlock(typeof(Exception));
|
||||
ig.Emit(OpCodes.Call, typeof(ExceptionHandling_Test_Support).GetMethod("Handler"));
|
||||
ig.EndExceptionBlock();
|
||||
|
||||
ig.Emit(OpCodes.Ret);
|
||||
|
||||
var invoke = (Action<int>) method.CreateDelegate (typeof(Action<int>));
|
||||
invoke (456324);
|
||||
|
||||
Assert.IsNotNull (ExceptionHandling_Test_Support.Caught, "#1");
|
||||
Assert.AreEqual (2, ExceptionHandling_Test_Support.CaughtStackTrace.Split (new[] { Environment.NewLine }, StringSplitOptions.None).Length, "#2");
|
||||
|
||||
var st = new StackTrace (ExceptionHandling_Test_Support.Caught, 0, true);
|
||||
|
||||
// Caught stack trace when dynamic method is gone
|
||||
Assert.AreEqual (ExceptionHandling_Test_Support.CaughtStackTrace, st.ToString (), "#3");
|
||||
|
||||
// Catch handler stack trace inside dynamic method match
|
||||
Assert.AreEqual (ExceptionHandling_Test_Support.Caught.StackTrace, st.ToString (), "#4");
|
||||
}
|
||||
|
||||
class ExceptionHandlingWithExceptionDispatchInfo_Test_Support
|
||||
{
|
||||
public static Exception Caught;
|
||||
public static string CaughtStackTrace;
|
||||
|
||||
public static void ThrowMe ()
|
||||
{
|
||||
Caught = null;
|
||||
CaughtStackTrace = null;
|
||||
|
||||
Exception e;
|
||||
try {
|
||||
throw new Exception("test");
|
||||
} catch (Exception e2) {
|
||||
e = e2;
|
||||
}
|
||||
|
||||
var edi = ExceptionDispatchInfo.Capture(e);
|
||||
|
||||
edi.Throw();
|
||||
}
|
||||
|
||||
public static void Handler (Exception e)
|
||||
{
|
||||
var split = e.StackTrace.Split (new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
Assert.AreEqual (5, split.Length, "#1");
|
||||
Assert.IsTrue (split [1].Contains ("---"), "#2");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ExceptionHandlingWithExceptionDispatchInfo ()
|
||||
{
|
||||
var method = new DynamicMethod ("", typeof(void), new[] { typeof(int) }, typeof (DynamicMethodTest));
|
||||
var ig = method.GetILGenerator ();
|
||||
|
||||
ig.BeginExceptionBlock();
|
||||
ig.Emit(OpCodes.Call, typeof(ExceptionHandlingWithExceptionDispatchInfo_Test_Support).GetMethod("ThrowMe"));
|
||||
|
||||
ig.BeginCatchBlock(typeof(Exception));
|
||||
ig.Emit(OpCodes.Call, typeof(ExceptionHandlingWithExceptionDispatchInfo_Test_Support).GetMethod("Handler"));
|
||||
ig.EndExceptionBlock();
|
||||
|
||||
ig.Emit(OpCodes.Ret);
|
||||
|
||||
var invoke = (Action<int>) method.CreateDelegate (typeof(Action<int>));
|
||||
invoke (444);
|
||||
}
|
||||
|
||||
#if !MONODROID
|
||||
// RUNTIME: crash
|
||||
[Test]
|
||||
public void TypedRef ()
|
||||
{
|
||||
@@ -508,6 +610,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
{
|
||||
Assert.AreEqual (typeof (TypedRefTarget), TypedReference.GetTargetType (tr));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_Name_Null ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -152,6 +153,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_Name_Empty ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -169,6 +171,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_Name_NullChar ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -188,6 +191,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_InterfaceNotAbstract ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -224,6 +228,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_Parent_Interface ()
|
||||
{
|
||||
TypeBuilder tb;
|
||||
@@ -241,6 +246,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DefineType_TypeSize ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -252,6 +258,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void DuplicateTypeName () {
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
@@ -267,6 +274,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter assembly
|
||||
public void DuplicateSymbolDocument ()
|
||||
{
|
||||
AssemblyBuilder ab = genAssembly ();
|
||||
|
||||
@@ -1182,6 +1182,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails with System.MethodAccessException : Method `t17:.ctor ()' is inaccessible from method `t18:.ctor ()'
|
||||
public void DefineDefaultConstructor_Parent_DefaultCtorInaccessible ()
|
||||
{
|
||||
TypeBuilder tb;
|
||||
@@ -8434,6 +8435,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Not available in the 2.1 profile
|
||||
public void TestAddDeclarativeSecurityAlreadyCreated ()
|
||||
{
|
||||
TypeBuilder tb = module.DefineType (genTypeName ());
|
||||
@@ -8452,6 +8454,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Not available in the 2.1 profile
|
||||
public void TestAddDeclarativeSecurityNullPermissionSet ()
|
||||
{
|
||||
TypeBuilder tb = module.DefineType (genTypeName ());
|
||||
@@ -8468,6 +8471,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Not available in the 2.1 profile
|
||||
public void TestAddDeclarativeSecurityInvalidAction ()
|
||||
{
|
||||
TypeBuilder tb = module.DefineType (genTypeName ());
|
||||
@@ -8488,6 +8492,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Not available in the 2.1 profile
|
||||
public void TestAddDeclarativeSecurityDuplicateAction ()
|
||||
{
|
||||
TypeBuilder tb = module.DefineType (genTypeName ());
|
||||
@@ -10878,6 +10883,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
//Test for #572660
|
||||
[Test]
|
||||
[Category ("MobileNotWorking")] // Mono.CompilerServices.SymbolWriter not available in XA
|
||||
public void CircularArrayType()
|
||||
{
|
||||
var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.RunAndSave);
|
||||
@@ -11025,6 +11031,10 @@ namespace MonoTests.System.Reflection.Emit
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")]
|
||||
// It's not possible to save the assembly in the current directory on Android and AssemblyBuilder.DefineDynamicModule will not
|
||||
// allow a full path to the assembly to be passed to it. Trying to change the current directory before saving will not work either as
|
||||
// FileStream will then prepend / to the file name (perhaps it's another bug) and write access to the filesystem root is, obviously, denied
|
||||
public void Ldfld_Encoding_10122 () {
|
||||
Build2<Example<int>> ();
|
||||
}
|
||||
|
||||
@@ -1112,6 +1112,7 @@ public class AssemblyNameTest {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Accessing assemblies by asm.Location is not supported
|
||||
public void GetAssemblyName_CodeBase ()
|
||||
{
|
||||
Assembly execAssembly = Assembly.GetExecutingAssembly ();
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace MonoTests.System.Reflection
|
||||
// note: only available in default appdomain
|
||||
// http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
|
||||
// Not sure we should emulate this behavior.
|
||||
#if !MONODROID
|
||||
string fname = AppDomain.CurrentDomain.FriendlyName;
|
||||
if (fname.EndsWith (".dll")) { // nunit-console
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
@@ -131,10 +132,15 @@ namespace MonoTests.System.Reflection
|
||||
Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
|
||||
}
|
||||
#else
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MONOTOUCH // Reflection.Emit is not supported.
|
||||
[Test]
|
||||
[Category("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter
|
||||
public void GetModules_MissingFile ()
|
||||
{
|
||||
AssemblyName newName = new AssemblyName ();
|
||||
@@ -184,7 +190,10 @@ namespace MonoTests.System.Reflection
|
||||
public void Corlib_test ()
|
||||
{
|
||||
Assembly corlib_test = Assembly.GetExecutingAssembly ();
|
||||
#if MOBILE
|
||||
#if MONODROID
|
||||
Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
|
||||
Assert.IsNull (corlib_test.Evidence, "Evidence");
|
||||
#elif MOBILE
|
||||
Assert.IsNotNull (corlib_test.EntryPoint, "EntryPoint");
|
||||
Assert.IsNull (corlib_test.Evidence, "Evidence");
|
||||
#else
|
||||
@@ -238,6 +247,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
|
||||
public void GetFiles_False ()
|
||||
{
|
||||
Assembly corlib = typeof (int).Assembly;
|
||||
@@ -250,6 +260,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
|
||||
public void GetFiles_True ()
|
||||
{
|
||||
Assembly corlib = typeof (int).Assembly;
|
||||
@@ -387,7 +398,7 @@ namespace MonoTests.System.Reflection
|
||||
[Test]
|
||||
public void LoadWithPartialName ()
|
||||
{
|
||||
string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "corlib_plattest", "mscorlibtests" };
|
||||
string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "corlib_plattest", "mscorlibtests", "BclTests" };
|
||||
|
||||
foreach (string s in names)
|
||||
if (Assembly.LoadWithPartialName (s) != null)
|
||||
@@ -540,6 +551,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("MobileNotWorking")]
|
||||
public void bug78465 ()
|
||||
{
|
||||
string assemblyFileName = Path.Combine (
|
||||
@@ -577,6 +589,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("MobileNotWorking")]
|
||||
public void bug78468 ()
|
||||
{
|
||||
string assemblyFileNameA = Path.Combine (Path.GetTempPath (),
|
||||
@@ -659,6 +672,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be directly as files
|
||||
public void ReflectionOnlyLoadFrom ()
|
||||
{
|
||||
string loc = typeof (AssemblyTest).Assembly.Location;
|
||||
@@ -830,6 +844,7 @@ namespace MonoTests.System.Reflection
|
||||
|
||||
|
||||
[Test] // bug #79715
|
||||
[Category("MobileNotWorking")]
|
||||
public void Load_PartialVersion ()
|
||||
{
|
||||
string tempDir = Path.Combine (Path.GetTempPath (),
|
||||
|
||||
@@ -140,5 +140,14 @@ namespace MonoTests.System.Reflection
|
||||
var ctor = typeof (Gen<>).GetConstructor (Type.EmptyTypes);
|
||||
Assert.IsTrue (ctor.ContainsGenericParameters);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConstructorInfoModule ()
|
||||
{
|
||||
Type type = typeof (Foo);
|
||||
ConstructorInfo co = type.GetConstructors ()[0];
|
||||
|
||||
Assert.AreEqual (type.Module, co.Module);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,15 @@ namespace MonoTests.System.Reflection
|
||||
} catch (InvalidOperationException) {}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EventInfoModule ()
|
||||
{
|
||||
Type type = typeof (TestClass);
|
||||
EventInfo ev = type.GetEvent ("pub");
|
||||
|
||||
Assert.AreEqual (type.Module, ev.Module);
|
||||
}
|
||||
|
||||
#pragma warning disable 67
|
||||
public class PrivateEvent
|
||||
{
|
||||
|
||||
@@ -400,6 +400,15 @@ namespace MonoTests.System.Reflection
|
||||
//Assert.IsTrue (pi.IsRetval, "#3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodInfoModule ()
|
||||
{
|
||||
Type type = typeof (MethodInfoTest);
|
||||
MethodInfo me = type.GetMethod ("return_parameter_test");
|
||||
|
||||
Assert.AreEqual (type.Module, me.Module);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InvokeOnRefOnlyAssembly ()
|
||||
{
|
||||
|
||||
@@ -193,19 +193,19 @@ public class ModuleTest
|
||||
|
||||
try {
|
||||
module.ResolveMethod (1234);
|
||||
Assert.Fail ();
|
||||
Assert.Fail ("1234");
|
||||
} catch (ArgumentException) {
|
||||
}
|
||||
|
||||
try {
|
||||
module.ResolveMethod (t.MetadataToken);
|
||||
Assert.Fail ();
|
||||
Assert.Fail ("MetadataToken");
|
||||
} catch (ArgumentException) {
|
||||
}
|
||||
|
||||
try {
|
||||
module.ResolveMethod (t.GetMethod ("ResolveMethod").MetadataToken + 10000);
|
||||
Assert.Fail ();
|
||||
module.ResolveMethod (t.GetMethod ("ResolveMethod").MetadataToken + 100000);
|
||||
Assert.Fail ("GetMethod");
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
}
|
||||
}
|
||||
@@ -330,6 +330,7 @@ public class ModuleTest
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Mono.CompilerServices.SymbolWriter not available for Xamarin.Android
|
||||
public void GetTypes ()
|
||||
{
|
||||
AssemblyName newName = new AssemblyName ();
|
||||
|
||||
@@ -68,10 +68,10 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
Assert.AreEqual ("type", inst.Name, "#1");
|
||||
Assert.AreEqual ("foo", inst.Namespace, "#2");
|
||||
#if NET_4_0
|
||||
#if NET_4_0 && !MOBILE
|
||||
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", inst.FullName, "#3");
|
||||
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
|
||||
#elif NET_2_1
|
||||
#elif NET_2_1 || MOBILE
|
||||
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", inst.FullName, "#3");
|
||||
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
|
||||
#else
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace MonoTests.System.Reflection
|
||||
{
|
||||
Type type = typeof (TestClass);
|
||||
PropertyInfo property = type.GetProperty ("ReadOnlyProperty");
|
||||
Assert.IsNotNull (property.Module, "#0");
|
||||
|
||||
MethodInfo [] methods = property.GetAccessors (true);
|
||||
Assert.AreEqual (1, methods.Length, "#A1");
|
||||
|
||||
+20
-1
@@ -30,6 +30,7 @@ using System;
|
||||
using NUnit.Framework;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MonoTests.System.Runtime.ExceptionServices
|
||||
{
|
||||
@@ -150,7 +151,25 @@ namespace MonoTests.System.Runtime.ExceptionServices
|
||||
Assert.IsTrue (split [1].Contains ("---"), "#2");
|
||||
Assert.IsTrue (split [4].Contains ("---"), "#3");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StackTraceUserCopy ()
|
||||
{
|
||||
try {
|
||||
try {
|
||||
throw new NotImplementedException ();
|
||||
} catch (Exception e) {
|
||||
var edi = ExceptionDispatchInfo.Capture (e);
|
||||
edi.Throw();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
var st = new StackTrace (ex, true);
|
||||
var split = st.ToString ().Split (new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
Assert.AreEqual (4, split.Length, "#1");
|
||||
Assert.IsTrue (split [1].Contains ("---"), "#2");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
[Test]
|
||||
[Category("MobileNotWorking")] // SIGSEGV, probably on AppDomain.Unload
|
||||
public void WeakHandleWorksOnNonRootDomain ()
|
||||
{
|
||||
//Console.WriteLine("current app domain: " + AppDomain.CurrentDomain.Id);
|
||||
|
||||
@@ -74,7 +74,11 @@ namespace MonoTests.System.Runtime.InteropServices {
|
||||
{
|
||||
string dirname = RuntimeEnvironment.GetRuntimeDirectory ();
|
||||
Assert.IsNotNull (dirname, "GetRuntimeDirectory");
|
||||
#if MONODROID
|
||||
Assert.IsTrue (dirname.Length == 0, "directory name empty");
|
||||
#else
|
||||
Assert.IsTrue (Directory.Exists (dirname), "Exists");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -48,7 +48,10 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
protected override void Dispose (bool manual)
|
||||
{
|
||||
disposed = true;
|
||||
#if !MONODROID
|
||||
// Bombs on Android (ObjectDisposedException)
|
||||
base.Dispose (manual);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +80,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void BadDispose2 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
@@ -87,6 +91,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void BadDispose3 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
@@ -115,6 +120,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void GoodDispose ()
|
||||
{
|
||||
int dummyHandle = 0xDEAD;
|
||||
@@ -232,6 +238,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void ReleaseAfterDispose1 ()
|
||||
{
|
||||
int dummyHandle = 0xDEAD;
|
||||
@@ -260,6 +267,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void ReleaseAfterDispose2 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle (true);
|
||||
@@ -278,6 +286,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Not until Dispose runtime crasher in FakeSafeHandle is fixed
|
||||
public void NoReleaseUnowned ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle (false);
|
||||
|
||||
Loaded 100 of 264 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user