mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
126
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c74e612279 | ||
|
|
5d8d728709 | ||
|
|
1ba6b7920b | ||
|
|
69db8dd538 | ||
|
|
cbd0f8dae6 | ||
|
|
ae2e58faa4 | ||
|
|
d6d9b1ae83 | ||
|
|
ab8a3912c0 | ||
|
|
7b7d32bedc | ||
|
|
c887be36d2 | ||
|
|
cdad88da7b | ||
|
|
0935e38357 | ||
|
|
0d5c493022 | ||
|
|
3a4ccc0796 | ||
|
|
fed6c32e36 | ||
|
|
2b87f361c2 | ||
|
|
c1dd76aec2 | ||
|
|
ab1ca6f689 | ||
|
|
4de3932df4 | ||
|
|
00bb13f6a5 | ||
|
|
c38a877b2e | ||
|
|
c55c4a72d8 | ||
|
|
55c27b7f53 | ||
|
|
486b49025b | ||
|
|
845c8aed57 | ||
|
|
7fffb9c388 | ||
|
|
30fb9e2618 | ||
|
|
3581d0d32a | ||
|
|
b4f3a19ad8 | ||
|
|
ff4967bdf5 | ||
|
|
16db9f5d02 | ||
|
|
c620a32251 | ||
|
|
c2b27112b4 | ||
|
|
5d4a9b0207 | ||
|
|
b0d8d4ef4e | ||
|
|
3b834d2a46 | ||
|
|
098b1bdddb | ||
|
|
8ce2b6b548 | ||
|
|
00698f7408 | ||
|
|
9a9caf7494 | ||
|
|
143c6c2209 | ||
|
|
c6f235cd88 | ||
|
|
c8e62dada8 | ||
|
|
6d20855af2 | ||
|
|
c3af5bc992 | ||
|
|
2ada13b646 | ||
|
|
44c5a48b97 | ||
|
|
8ec4b50c19 | ||
|
|
7450e5985f | ||
|
|
49fbaad9d3 | ||
|
|
567eead66e | ||
|
|
ed6134ef61 | ||
|
|
a314396709 | ||
|
|
3b4b25dadc | ||
|
|
765d709d24 | ||
|
|
42c253731a | ||
|
|
a5d2e11456 | ||
|
|
8a2fd1e276 | ||
|
|
c044190b79 | ||
|
|
65c1997913 | ||
|
|
856aa24078 | ||
|
|
bd693bbc41 | ||
|
|
9c4da07fc1 | ||
|
|
d27243324f | ||
|
|
6f824e0b6f | ||
|
|
e3da710362 | ||
|
|
cc612cb4d0 | ||
|
|
dd63bc4cda | ||
|
|
c8c225f066 | ||
|
|
6e3d2eb291 | ||
|
|
a12ee3f98d | ||
|
|
feba93a5de | ||
|
|
9958261a8a | ||
|
|
8db00dcc40 | ||
|
|
b7c654d26d | ||
|
|
3002249dab | ||
|
|
840801ecb9 | ||
|
|
4a655c66f7 | ||
|
|
f4a3cbdaed | ||
|
|
e8b9107c3f | ||
|
|
edec9a54af | ||
|
|
5ac529a182 | ||
|
|
d6c6e7b6de | ||
|
|
48cc848a43 | ||
|
|
d8e3d0e959 | ||
|
|
6b97b22c3b | ||
|
|
a33fb26f89 | ||
|
|
6767d24b3f | ||
|
|
1301b2697c | ||
|
|
0453803999 | ||
|
|
c59dc39170 | ||
|
|
0c9216e5a4 | ||
|
|
4ef57bc080 | ||
|
|
b728d181e0 | ||
|
|
06ec2cc12e | ||
|
|
e0789c921c | ||
|
|
a35eef3a6a | ||
|
|
726c4a3f18 | ||
|
|
c0025d2188 | ||
|
|
745f4356c2 | ||
|
|
f5c88fb0fc | ||
|
|
e7e3420219 | ||
|
|
b1ee8a55ff | ||
|
|
13038ab9eb | ||
|
|
7192da2671 | ||
|
|
a8c94d1d17 | ||
|
|
cd7496d658 | ||
|
|
0d21061d41 | ||
|
|
150fa242fb | ||
|
|
fe1a1784f4 | ||
|
|
ae9f1d7f7a | ||
|
|
c88dea2f39 | ||
|
|
e06fe98fa0 | ||
|
|
3ebd1cfd57 | ||
|
|
c937b46879 | ||
|
|
b05d49ffaa | ||
|
|
1b8ba5d892 | ||
|
|
e07d3c2fe3 | ||
|
|
87033ea0ac | ||
|
|
9df06f7f5d | ||
|
|
f3106df8ba | ||
|
|
2c9e57560e | ||
|
|
9ecc046d41 | ||
|
|
0c9641f7dc | ||
|
|
e35814198d | ||
|
|
48e3e32add |
No files matched your search
+3
-1
@@ -161,7 +161,9 @@ if test -d $srcdir/eglib; then
|
||||
fi
|
||||
|
||||
|
||||
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
|
||||
|
||||
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
|
||||
+14
-2
@@ -3257,11 +3257,23 @@ dnl
|
||||
dnl Simple Generational checks (sgen)
|
||||
dnl
|
||||
SGEN_DEFINES=
|
||||
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
|
||||
AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
|
||||
AC_ARG_WITH(sgen-default-concurrent, [ --with-sgen-default-concurrent=yes,no Use Concurrent GC, default=no],[],[with_sgen_default_concurrent=no])
|
||||
if test x$buildsgen = xyes; then
|
||||
AC_DEFINE(HAVE_MOVING_COLLECTOR, 1, [Moving collector])
|
||||
SGEN_DEFINES="-DHAVE_SGEN_GC"
|
||||
gc_msg="sgen and $gc_msg"
|
||||
|
||||
conc_gc_msg=""
|
||||
if test x$with_sgen_default_concurrent != xno; then
|
||||
AC_DEFINE(HAVE_CONC_GC_AS_DEFAULT, 1, [Defaults to concurrent GC])
|
||||
conc_gc_msg=" (concurrent by default)"
|
||||
fi
|
||||
|
||||
if test "x$gc_msg" = "x"; then
|
||||
gc_msg="sgen$conc_gc_msg"
|
||||
else
|
||||
gc_msg="sgen$conc_gc_msg and $gc_msg"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(SGEN_DEFINES)
|
||||
AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
|
||||
|
||||
Vendored
+1
-1
Submodule external/ikvm updated: 00252c18fc...163b37483c.
@@ -18,7 +18,7 @@ endif
|
||||
|
||||
MCS = $(with_mono_path) $(INTERNAL_GMCS)
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/$(PROFILE)
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:$(topdir)/class/lib/$(PROFILE)
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
@@ -13,7 +13,7 @@ profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
||||
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
NO_TEST = yes
|
||||
|
||||
@@ -23,7 +23,6 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
|
||||
@@ -21,7 +21,6 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MOBILE,MOBILE_STATIC,MOBILE_LEGACY \
|
||||
-d:FULL_AOT_RUNTIME \
|
||||
-d:DISABLE_REMOTING \
|
||||
|
||||
@@ -21,7 +21,6 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MOBILE,MOBILE_LEGACY \
|
||||
-d:MOBILE_DYNAMIC \
|
||||
-d:MONODROID \
|
||||
|
||||
@@ -23,7 +23,6 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:NET_4_5 \
|
||||
-d:MOBILE,MOBILE_LEGACY \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MONOTOUCH \
|
||||
-d:DISABLE_REMOTING \
|
||||
-d:DISABLE_COM \
|
||||
|
||||
@@ -11,7 +11,7 @@ profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
FRAMEWORK_VERSION = 4.5
|
||||
XBUILD_VERSION = 4.0
|
||||
@@ -19,7 +19,6 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MOBILE \
|
||||
-d:MOBILE_DYNAMIC \
|
||||
-d:XAMMAC \
|
||||
|
||||
@@ -38,7 +38,7 @@ test_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll.sources)
|
||||
endif
|
||||
|
||||
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
|
||||
test_sourcefile_excludes = $(test_lib).excludes
|
||||
test_sourcefile_excludes = $(test_lib).exclude.sources
|
||||
|
||||
test_pdb = $(test_lib:.dll=.pdb)
|
||||
test_response = $(depsdir)/$(test_lib).response
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventOpcode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSource))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceSettings))]
|
||||
//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventSourceException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
|
||||
//[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace MonoTests.Mono.Data.Sqlite
|
||||
}
|
||||
}
|
||||
|
||||
void AddParameter (System.Data.Common.DbCommand cm, string name, object value)
|
||||
void AddParameter (global::System.Data.Common.DbCommand cm, string name, object value)
|
||||
{
|
||||
var param = cm.CreateParameter ();
|
||||
param.ParameterName = ":" + name;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MonoTests.Mono.Data.Sqlite
|
||||
textP.Value=builder.ToString();
|
||||
floatP.Value=Convert.ToInt64(random.Next(999));
|
||||
integerP.Value=random.Next(999);
|
||||
blobP.Value=System.Text.Encoding.UTF8.GetBytes("\u05D0\u05D1\u05D2" + builder.ToString());
|
||||
blobP.Value=global::System.Text.Encoding.UTF8.GetBytes("\u05D0\u05D1\u05D2" + builder.ToString());
|
||||
|
||||
SqliteCommand selectCmd = new SqliteCommand("SELECT * from t1", _conn);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace MonoTests.Mono.Data.Sqlite
|
||||
|
||||
object compareValue;
|
||||
if (blobP.Value is byte[])
|
||||
compareValue = System.Text.Encoding.UTF8.GetString ((byte[])blobP.Value);
|
||||
compareValue = global::System.Text.Encoding.UTF8.GetString ((byte[])blobP.Value);
|
||||
else
|
||||
compareValue = blobP.Value;
|
||||
Assert.AreEqual(reader["b"], compareValue);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include monodroid_Mono.Data.Sqlite_test.dll.new-exclude.sources
|
||||
@@ -0,0 +1,2 @@
|
||||
SqliteDataReaderTest.cs
|
||||
SqliteParameterUnitTests.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include Mono.Data.Sqlite_test.dll.sources
|
||||
@@ -419,6 +419,9 @@ public class Tests : TestsBase, ITest2
|
||||
ss_step_through ();
|
||||
ss_non_user_code ();
|
||||
ss_recursive (1);
|
||||
ss_recursive2 (1);
|
||||
ss_recursive2 (1);
|
||||
ss_recursive_chaotic ();
|
||||
ss_fp_clobber ();
|
||||
}
|
||||
|
||||
@@ -568,6 +571,92 @@ public class Tests : TestsBase, ITest2
|
||||
ss_recursive (n + 1);
|
||||
}
|
||||
|
||||
// Breakpoint will be placed here
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive2_trap ()
|
||||
{
|
||||
}
|
||||
|
||||
public static void ss_recursive2_at (string s)
|
||||
{
|
||||
// Console.WriteLine (s);
|
||||
}
|
||||
|
||||
// This method is used both for a step over and step out test.
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive2 (int x)
|
||||
{
|
||||
ss_recursive2_at ( "ss_recursive2 in " + x);
|
||||
if (x < 5) {
|
||||
int next = x + 1;
|
||||
ss_recursive2_at ("ss_recursive2 descend " + x);
|
||||
ss_recursive2_trap ();
|
||||
ss_recursive2 (next);
|
||||
}
|
||||
ss_recursive2_at ("ss_recursive2 out " + x);
|
||||
}
|
||||
|
||||
// Breakpoint will be placed here
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic_trap ()
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic_at (bool exiting, string at, int n)
|
||||
{
|
||||
// string indent = "";
|
||||
// for (int count = 5 - n; count > 0; count--)
|
||||
// indent += "\t";
|
||||
// Console.WriteLine (indent + (exiting ? "<--" : "-->") + " " + at + " " + n);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic_fizz (int n)
|
||||
{
|
||||
ss_recursive_chaotic_at (false, "fizz", n);
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
ss_recursive_chaotic_buzz (next);
|
||||
ss_recursive_chaotic_fizzbuzz (next);
|
||||
} else {
|
||||
ss_recursive_chaotic_trap ();
|
||||
}
|
||||
ss_recursive_chaotic_at (true, "fizz", n);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic_buzz (int n)
|
||||
{
|
||||
ss_recursive_chaotic_at (false, "buzz", n);
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
ss_recursive_chaotic_fizz (next);
|
||||
ss_recursive_chaotic_fizzbuzz (next);
|
||||
}
|
||||
ss_recursive_chaotic_at (true, "buzz", n);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic_fizzbuzz (int n)
|
||||
{
|
||||
ss_recursive_chaotic_at (false, "fizzbuzz", n);
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
ss_recursive_chaotic_fizz (next);
|
||||
ss_recursive_chaotic_buzz (next);
|
||||
ss_recursive_chaotic_fizzbuzz (next);
|
||||
}
|
||||
ss_recursive_chaotic_at (true, "fizzbuzz", n);
|
||||
}
|
||||
|
||||
// Call a complex tree of recursive calls that has tripped up "step out" in the past.
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_recursive_chaotic ()
|
||||
{
|
||||
ss_recursive_chaotic_fizz (5);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void ss_fp_clobber () {
|
||||
double v = ss_fp_clobber_1 (5.0);
|
||||
|
||||
@@ -42,6 +42,17 @@ public class DebuggerTests
|
||||
public static string runtime = Environment.GetEnvironmentVariable ("DBG_RUNTIME");
|
||||
public static string agent_args = Environment.GetEnvironmentVariable ("DBG_AGENT_ARGS");
|
||||
|
||||
// Not currently used, but can be useful when debugging individual tests.
|
||||
void StackTraceDump (Event e)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var frame in e.Thread.GetFrames ())
|
||||
{
|
||||
i++;
|
||||
Console.WriteLine ("Frame " + i + ", " + frame.Method.Name);
|
||||
}
|
||||
}
|
||||
|
||||
Event GetNextEvent () {
|
||||
var es = vm.GetNextEventSet ();
|
||||
Assert.AreEqual (1, es.Events.Length);
|
||||
@@ -124,6 +135,140 @@ public class DebuggerTests
|
||||
return (e as BreakpointEvent);
|
||||
}
|
||||
|
||||
class ReusableBreakpoint {
|
||||
DebuggerTests owner;
|
||||
public string method_name;
|
||||
public BreakpointEventRequest req;
|
||||
public BreakpointEvent lastEvent = null;
|
||||
public ReusableBreakpoint (DebuggerTests owner, string method_name)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.method_name = method_name;
|
||||
MethodMirror m = owner.entry_point.DeclaringType.GetMethod (method_name);
|
||||
Assert.IsNotNull (m);
|
||||
req = owner.vm.SetBreakpoint (m, m.ILOffsets [0]);
|
||||
}
|
||||
|
||||
public void Continue ()
|
||||
{
|
||||
bool survived = false;
|
||||
|
||||
try {
|
||||
Event e = null;
|
||||
|
||||
while (true) {
|
||||
owner.vm.Resume ();
|
||||
e = owner.GetNextEvent ();
|
||||
if (e is BreakpointEvent)
|
||||
break;
|
||||
}
|
||||
|
||||
Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
|
||||
Assert.AreEqual (method_name, (e as BreakpointEvent).Method.Name);
|
||||
|
||||
lastEvent = e as BreakpointEvent;
|
||||
|
||||
survived = true;
|
||||
} finally {
|
||||
if (!survived) { // Ensure cleanup if we triggered an assert
|
||||
Disable ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Disable ()
|
||||
{
|
||||
req.Disable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* One of the tests executes a complex tree of recursive functions.
|
||||
The only good way to specify how its behavior should appear from this side
|
||||
is to just run the function tree once over here and record what it does. */
|
||||
public struct RecursiveChaoticPoint
|
||||
{
|
||||
public bool breakpoint;
|
||||
public string name;
|
||||
public int depth;
|
||||
|
||||
public RecursiveChaoticPoint (bool breakpoint, string name, int depth)
|
||||
{
|
||||
this.breakpoint = breakpoint;
|
||||
this.name = name;
|
||||
this.depth = depth;
|
||||
}
|
||||
}
|
||||
|
||||
// The breakpoint is placed here in dtest-app.cs
|
||||
public static void ss_recursive_chaotic_trap (int n, List<RecursiveChaoticPoint> trace, ref bool didLast, ref bool didAny)
|
||||
{
|
||||
// Depth is calculated as:
|
||||
// Main + single_stepping + ss_recursive_chaotic + (n is 5 at outermost frame and 0 at innermost frame) + ss_recursive_chaotic_trap
|
||||
trace.Add (new RecursiveChaoticPoint (true, "ss_recursive_chaotic_trap", 5 - n + 5));
|
||||
didLast = true;
|
||||
}
|
||||
|
||||
public static void ss_recursive_chaotic_at (string at, int n, List<RecursiveChaoticPoint> trace, ref bool didLast, ref bool didAny)
|
||||
{
|
||||
// This will be called after every return from a function. The other function will return whether "step out" is currently active, and it will be passed in here as didLast.
|
||||
if (didLast) {
|
||||
// Depth is calculated as:
|
||||
// Main + single_stepping + ss_recursive_chaotic + (n is 5 at outermost frame and 0 at innermost frame)
|
||||
trace.Add (new RecursiveChaoticPoint (false, "ss_recursive_chaotic_" + at, 5 - n + 4));
|
||||
didAny = true;
|
||||
didLast = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ss_recursive_chaotic_fizz (int n, List<RecursiveChaoticPoint> trace)
|
||||
{
|
||||
bool didLast = false, didAny = false;
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
didLast = ss_recursive_chaotic_buzz (next, trace);
|
||||
ss_recursive_chaotic_at ("fizz", n, trace, ref didLast, ref didAny);
|
||||
didLast = ss_recursive_chaotic_fizzbuzz (next, trace);
|
||||
ss_recursive_chaotic_at ("fizz", n, trace, ref didLast, ref didAny);
|
||||
} else {
|
||||
ss_recursive_chaotic_trap (n, trace, ref didLast, ref didAny);
|
||||
ss_recursive_chaotic_at ("fizz", n, trace, ref didLast, ref didAny);
|
||||
}
|
||||
return didAny;
|
||||
}
|
||||
|
||||
public static bool ss_recursive_chaotic_buzz (int n, List<RecursiveChaoticPoint> trace)
|
||||
{
|
||||
bool didLast = false, didAny = false;
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
didLast = ss_recursive_chaotic_fizz (next, trace);
|
||||
ss_recursive_chaotic_at ("buzz", n, trace, ref didLast, ref didAny);
|
||||
didLast = ss_recursive_chaotic_fizzbuzz (next, trace);
|
||||
ss_recursive_chaotic_at ("buzz", n, trace, ref didLast, ref didAny);
|
||||
}
|
||||
return didAny;
|
||||
}
|
||||
|
||||
public static bool ss_recursive_chaotic_fizzbuzz (int n, List<RecursiveChaoticPoint> trace)
|
||||
{
|
||||
bool didLast = false, didAny = false;
|
||||
if (n > 0) {
|
||||
int next = n - 1;
|
||||
didLast = ss_recursive_chaotic_fizz (next, trace);
|
||||
ss_recursive_chaotic_at ("fizzbuzz", n, trace, ref didLast, ref didAny);
|
||||
didLast = ss_recursive_chaotic_buzz (next, trace);
|
||||
ss_recursive_chaotic_at ("fizzbuzz", n, trace, ref didLast, ref didAny);
|
||||
didLast = ss_recursive_chaotic_fizzbuzz (next, trace);
|
||||
ss_recursive_chaotic_at ("fizzbuzz", n, trace, ref didLast, ref didAny);
|
||||
}
|
||||
return didAny;
|
||||
}
|
||||
|
||||
public static void trace_ss_recursive_chaotic (List<RecursiveChaoticPoint> trace)
|
||||
{
|
||||
ss_recursive_chaotic_fizz (5, trace);
|
||||
}
|
||||
|
||||
Event single_step (ThreadMirror t) {
|
||||
var req = vm.CreateStepRequest (t);
|
||||
req.Enable ();
|
||||
@@ -372,11 +517,28 @@ public class DebuggerTests
|
||||
Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
|
||||
}
|
||||
|
||||
// Assert we have stepped to a location
|
||||
void assert_location (Event e, string method) {
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual (method, (e as StepEvent).Method.Name);
|
||||
}
|
||||
|
||||
// Assert we have breakpointed at a location
|
||||
void assert_location_at_breakpoint (Event e, string method) {
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (method, (e as BreakpointEvent).Method.Name);
|
||||
}
|
||||
|
||||
// Assert we have stepped to or breakpointed at a location
|
||||
void assert_location_allow_breakpoint (Event e, string method) {
|
||||
if (e is StepEvent)
|
||||
Assert.AreEqual (method, (e as StepEvent).Method.Name);
|
||||
else if (e is BreakpointEvent)
|
||||
Assert.AreEqual (method, (e as BreakpointEvent).Method.Name);
|
||||
else
|
||||
Assert.Fail ("Neither step nor breakpoint event");
|
||||
}
|
||||
|
||||
StepEventRequest create_step (Event e) {
|
||||
var req = vm.CreateStepRequest (e.Thread);
|
||||
step_req = req;
|
||||
@@ -624,6 +786,95 @@ public class DebuggerTests
|
||||
AssertValue (1, f.GetValue (f.Method.GetLocal ("n")));
|
||||
req.Disable ();
|
||||
|
||||
// Check that step-over stops correctly when inner frames with recursive functions contain breakpoints
|
||||
e = run_until ("ss_recursive2");
|
||||
ReusableBreakpoint breakpoint = new ReusableBreakpoint (this, "ss_recursive2_trap");
|
||||
try {
|
||||
breakpoint.Continue ();
|
||||
e = breakpoint.lastEvent;
|
||||
req = create_step (e);
|
||||
for (int c = 1; c <= 4; c++) {
|
||||
// The first five times we try to step over this function, the breakpoint will stop us
|
||||
assert_location_at_breakpoint (e, "ss_recursive2_trap");
|
||||
|
||||
req.Disable ();
|
||||
req = create_step (e);
|
||||
req.Size = StepSize.Line;
|
||||
|
||||
e = step_out ();
|
||||
assert_location (e, "ss_recursive2");
|
||||
|
||||
// Stack should consist of Main + single_stepping + (1 ss_recursive2 frame per loop iteration)
|
||||
Assert.AreEqual (c+2, e.Thread.GetFrames ().Length);
|
||||
e = step_over_or_breakpoint ();
|
||||
}
|
||||
// At this point we should have escaped the breakpoints and this will be a normal step stop
|
||||
assert_location (e, "ss_recursive2");
|
||||
Assert.AreEqual (6, e.Thread.GetFrames ().Length);
|
||||
} finally {
|
||||
req.Disable ();
|
||||
breakpoint.Disable ();
|
||||
}
|
||||
|
||||
// Check that step-out stops correctly when inner frames with recursive functions contain breakpoints
|
||||
e = run_until ("ss_recursive2");
|
||||
breakpoint = new ReusableBreakpoint (this, "ss_recursive2_trap");
|
||||
try {
|
||||
breakpoint.Continue ();
|
||||
e = breakpoint.lastEvent;
|
||||
req = create_step (e);
|
||||
for (int c = 1; c <= 4; c++) {
|
||||
// The first five times we try to step over this function, the breakpoint will stop us
|
||||
assert_location_at_breakpoint (e, "ss_recursive2_trap");
|
||||
|
||||
req.Disable ();
|
||||
req = create_step (e);
|
||||
req.Size = StepSize.Line;
|
||||
|
||||
e = step_out ();
|
||||
assert_location (e, "ss_recursive2");
|
||||
|
||||
// Stack should consist of Main + single_stepping + (1 ss_recursive2 frame per loop iteration)
|
||||
Assert.AreEqual (c+2, e.Thread.GetFrames ().Length);
|
||||
e = step_out_or_breakpoint ();
|
||||
}
|
||||
for (int c = 3; c >= 1; c--) {
|
||||
assert_location (e, "ss_recursive2");
|
||||
Assert.AreEqual (c + 2, e.Thread.GetFrames ().Length);
|
||||
|
||||
e = step_out ();
|
||||
}
|
||||
} finally {
|
||||
req.Disable ();
|
||||
breakpoint.Disable ();
|
||||
}
|
||||
|
||||
// Test step out with a really complicated call tree
|
||||
List<RecursiveChaoticPoint> trace = new List<RecursiveChaoticPoint>();
|
||||
trace_ss_recursive_chaotic (trace);
|
||||
e = run_until ("ss_recursive_chaotic");
|
||||
try {
|
||||
breakpoint = new ReusableBreakpoint (this, "ss_recursive_chaotic_trap");
|
||||
breakpoint.Continue ();
|
||||
e = breakpoint.lastEvent;
|
||||
foreach (RecursiveChaoticPoint point in trace)
|
||||
{
|
||||
if (point.breakpoint)
|
||||
assert_location_at_breakpoint (e, point.name);
|
||||
else
|
||||
assert_location (e, point.name);
|
||||
Assert.AreEqual (point.depth, e.Thread.GetFrames ().Length);
|
||||
|
||||
req.Disable ();
|
||||
req = create_step (e);
|
||||
req.Size = StepSize.Line;
|
||||
e = step_out_or_breakpoint ();
|
||||
}
|
||||
} finally {
|
||||
req.Disable ();
|
||||
breakpoint.Disable ();
|
||||
}
|
||||
|
||||
// Check that single stepping doesn't clobber fp values
|
||||
e = run_until ("ss_fp_clobber");
|
||||
req = create_step (e);
|
||||
@@ -1625,6 +1876,27 @@ public class DebuggerTests
|
||||
return step_once ();
|
||||
}
|
||||
|
||||
Event step_once_or_breakpoint () {
|
||||
vm.Resume ();
|
||||
var e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent || e is BreakpointEvent);
|
||||
return e;
|
||||
}
|
||||
|
||||
Event step_over_or_breakpoint () {
|
||||
step_req.Disable ();
|
||||
step_req.Depth = StepDepth.Over;
|
||||
step_req.Enable ();
|
||||
return step_once_or_breakpoint ();
|
||||
}
|
||||
|
||||
Event step_out_or_breakpoint () {
|
||||
step_req.Disable ();
|
||||
step_req.Depth = StepDepth.Out;
|
||||
step_req.Enable ();
|
||||
return step_once_or_breakpoint ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Locals () {
|
||||
var be = run_until ("locals1");
|
||||
|
||||
@@ -1001,7 +1001,7 @@ namespace MonoTests.Mono.Unix {
|
||||
|
||||
Assert.AreEqual (end.Length, bytes.Length, prefix + ": byte length");
|
||||
|
||||
for (int i = 0; i < Math.Min (bytes.Length, end.Length); ++i)
|
||||
for (int i = 0; i < global::System.Math.Min (bytes.Length, end.Length); ++i)
|
||||
Assert.AreEqual (end [i], bytes [i], prefix + ": byte " + i);
|
||||
|
||||
int cc = unix.GetCharCount (end, 0, end.Length);
|
||||
@@ -1012,7 +1012,7 @@ namespace MonoTests.Mono.Unix {
|
||||
|
||||
Assert.AreEqual (start.Length, r, prefix + ": chars length");
|
||||
|
||||
for (int i = 0; i < Math.Min (r, start.Length); ++i) {
|
||||
for (int i = 0; i < global::System.Math.Min (r, start.Length); ++i) {
|
||||
Assert.AreEqual (start [i], chars [i], prefix + ": char " + i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#include monodroid_Mono.Posix_test.dll.new-exclude.sources
|
||||
Mono.Unix.Android/TestHelper.cs
|
||||
@@ -0,0 +1,3 @@
|
||||
Mono.Unix.Native/SocketTest.cs
|
||||
Mono.Unix/UnixEndPointTest.cs
|
||||
Mono.Unix/UnixListenerTest.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include Mono.Posix_test.dll.sources
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
# These fail because of reliance on full NUnit framework
|
||||
Mono.Math/ArithmeticBigTest.cs
|
||||
Mono.Math/BigIntegerSetTest.cs
|
||||
Mono.Math/BitwiseTest.cs
|
||||
Mono.Math/GcdBigTest.cs
|
||||
Mono.Math/ModInverseBigTest.cs
|
||||
Mono.Math/ModRingTest.cs
|
||||
Mono.Math/PrimeGenerationTest.cs
|
||||
Mono.Math/PrimeTestingTest.cs
|
||||
Mono.Math/SearchGeneratorTest.cs
|
||||
Mono.Security.Authenticode/PrivateKeyTest.cs
|
||||
Mono.Security.Cryptography/CryptoConvertTest.cs
|
||||
Mono.Security.Cryptography/DiffieHellmanManagedTest.cs
|
||||
Mono.Security.Cryptography/PKCS8Test.cs
|
||||
Mono.Security.Protocol.Ntlm/ChallengeResponseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/MessageBaseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/Type1MessageTest.cs
|
||||
Mono.Security.Protocol.Ntlm/Type2MessageTest.cs
|
||||
Mono.Security.Protocol.Ntlm/Type3MessageTest.cs
|
||||
Mono.Security/StrongNameTest.cs
|
||||
@@ -0,0 +1,2 @@
|
||||
#include monodroid_Mono.Security_test.dll.build-failure-exclude.sources
|
||||
#include monodroid_Mono.Data.Sqlite_test.dll.new-exclude.sources
|
||||
@@ -0,0 +1,14 @@
|
||||
Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs
|
||||
Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs
|
||||
Mono.Security/PKCS7Test.cs
|
||||
Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtensionTest.cs
|
||||
Mono.Security.X509.Extensions/BasicConstraintsExtensionTest.cs
|
||||
Mono.Security.X509.Extensions/ExtendedKeyUsageExtensionTest.cs
|
||||
Mono.Security.X509.Extensions/KeyUsageExtensionTest.cs
|
||||
Mono.Security.X509.Extensions/SubjectAltNameExtensionTest.cs
|
||||
Mono.Security.X509.Extensions/SubjectKeyIdentifierExtensionTest.cs
|
||||
Mono.Security.X509/PKCS12Test.cs
|
||||
Mono.Security.X509/X501NameTest.cs
|
||||
Mono.Security.X509/X509CertificateTest.cs
|
||||
Mono.Security.X509/X509CrlTest.cs
|
||||
Mono.Security.X509/X520AttributesTest.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include Mono.Security_test.dll.sources
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
#include monodroid_System.ComponentModel.DataAnnotations_test.dll.new-exclude.sources
|
||||
../../System.Web.DynamicData/Test/Common/AssertExtensions.cs
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProviderTests.cs
|
||||
System.ComponentModel.DataAnnotations/CompareAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/FileExtensionsAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/PhoneAttributeTest.cs
|
||||
+1
@@ -0,0 +1 @@
|
||||
#include System.ComponentModel.DataAnnotations_test.dll.sources
|
||||
@@ -379,7 +379,9 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
|
||||
[Test]
|
||||
public void CreateViewStreamAlignToPageSize ()
|
||||
{
|
||||
#if MONOTOUCH
|
||||
#if __WATCHOS__
|
||||
int pageSize = 4096;
|
||||
#elif MONOTOUCH
|
||||
// iOS bugs on ARM64 - bnc #27667 - apple #
|
||||
int pageSize = (IntPtr.Size == 4) ? Environment.SystemPageSize : 4096;
|
||||
#else
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
#include mobile_static_System.Core_test.dll.exclude.sources
|
||||
#include monodroid_System.Core_test.dll.new-exclude.sources
|
||||
@@ -0,0 +1,5 @@
|
||||
../../corlib/Test/System.Security.Cryptography/HashAlgorithmTest.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA1Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA256Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA384Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA512Test.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include System.Core_test.dll.sources
|
||||
@@ -1158,6 +1158,9 @@ namespace MonoTests.System.Data
|
||||
Assert.AreEqual (-1, evProp.NewIndex, "#10");
|
||||
Assert.AreEqual (-1, evProp.OldIndex, "#11");
|
||||
Assert.AreEqual (ListChangedType.Reset, evProp.lstType, "#12");
|
||||
|
||||
// Keep the view alive otherwise we might miss events
|
||||
GC.KeepAlive (view);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
File renamed without changes.
@@ -100,7 +100,7 @@ namespace System.Net.Http
|
||||
|
||||
public CookieContainer CookieContainer {
|
||||
get {
|
||||
return cookies;
|
||||
return cookies ?? (cookies = new CookieContainer ());
|
||||
}
|
||||
set {
|
||||
EnsureModifiability ();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// TypeForwarders.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.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.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: TypeForwardedTo(typeof(Matrix3x2))]
|
||||
[assembly: TypeForwardedTo(typeof(Matrix4x4))]
|
||||
[assembly: TypeForwardedTo(typeof(Plane))]
|
||||
[assembly: TypeForwardedTo(typeof(Quaternion))]
|
||||
[assembly: TypeForwardedTo(typeof(Vector2))]
|
||||
[assembly: TypeForwardedTo(typeof(Vector3))]
|
||||
[assembly: TypeForwardedTo(typeof(Vector4))]
|
||||
@@ -3,7 +3,7 @@ SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = System.Numerics.Vectors.dll
|
||||
LIB_REFS = System
|
||||
LIB_REFS = System System.Numerics
|
||||
LIB_MCS_FLAGS =
|
||||
|
||||
EXTRA_DISTFILES =
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/SR.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
Assembly/TypeForwarders.cs
|
||||
@@ -4,7 +4,7 @@ include ../../build/rules.make
|
||||
|
||||
LIBRARY = System.Numerics.dll
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = /unsafe -d:MONO
|
||||
LIB_MCS_FLAGS = /unsafe -nowarn:414
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
|
||||
TXT_RESOURCE_STRINGS = ../referencesource/System.Numerics/System.Numerics.txt
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace System
|
||||
{
|
||||
partial class Environment
|
||||
{
|
||||
internal static string GetResourceString (string key)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
internal static string GetResourceString (string key, CultureInfo culture)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
internal static string GetResourceString (string key, params object[] values)
|
||||
{
|
||||
return string.Format (CultureInfo.InvariantCulture, key, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,22 @@
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/SR.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
ReferenceSources/Environment.cs
|
||||
ReferenceSources/SR.cs
|
||||
../referencesource/System.Numerics/System/Numerics/BigInteger.cs
|
||||
../referencesource/System.Numerics/System/Numerics/BigIntegerBuilder.cs
|
||||
../referencesource/System.Numerics/System/Numerics/BigNumber.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Complex.cs
|
||||
../referencesource/System.Numerics/System/Numerics/NumericsHelpers.cs
|
||||
../referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs
|
||||
../referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Matrix3x2.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Matrix4x4.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Plane.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Quaternion.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector2.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector3.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector4.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs
|
||||
../referencesource/System.Numerics/System/Numerics/Vector_Operations.cs
|
||||
@@ -56,10 +56,7 @@ EXTRA_DISTFILES = \
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(the_libdir_base)$(LIBRARY): $(system_web_deps) $(system_design_deps) t
|
||||
|
||||
t:
|
||||
echo $(plaindesign)
|
||||
$(the_libdir_base)$(LIBRARY): $(system_web_deps) $(system_design_deps)
|
||||
|
||||
$(plainweb):
|
||||
(cd ../System.Web; $(MAKE) $@)
|
||||
|
||||
@@ -214,6 +214,9 @@ namespace System.Web.Services.Protocols {
|
||||
OutputMembersMapping = soapImporter.ImportMembersMapping (ResponseName, ResponseNamespace, out_members, hasWrappingElem, writeAccessors);
|
||||
}
|
||||
|
||||
InputMembersMapping.SetKey(RequestName);
|
||||
OutputMembersMapping.SetKey(ResponseName);
|
||||
|
||||
requestSerializerId = parent.RegisterSerializer (InputMembersMapping);
|
||||
responseSerializerId = parent.RegisterSerializer (OutputMembersMapping);
|
||||
|
||||
@@ -254,6 +257,8 @@ namespace System.Web.Services.Protocols {
|
||||
else
|
||||
InputHeaderMembersMapping = soapImporter.ImportMembersMapping ("", RequestNamespace, members, false, false);
|
||||
|
||||
InputHeaderMembersMapping.SetKey(RequestName + ":InHeaders");
|
||||
|
||||
requestHeadersSerializerId = parent.RegisterSerializer (InputHeaderMembersMapping);
|
||||
}
|
||||
|
||||
@@ -265,7 +270,9 @@ namespace System.Web.Services.Protocols {
|
||||
OutputHeaderMembersMapping = xmlImporter.ImportMembersMapping ("", RequestNamespace, members, false);
|
||||
else
|
||||
OutputHeaderMembersMapping = soapImporter.ImportMembersMapping ("", RequestNamespace, members, false, false);
|
||||
|
||||
|
||||
OutputHeaderMembersMapping.SetKey(ResponseName + ":OutHeaders");
|
||||
|
||||
responseHeadersSerializerId = parent.RegisterSerializer (OutputHeaderMembersMapping);
|
||||
}
|
||||
|
||||
|
||||
+39
@@ -243,5 +243,44 @@ namespace MonoTests.System.Web.Services.Protocols
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RequestHeader : SoapHeader
|
||||
{
|
||||
}
|
||||
|
||||
public class ResponseHeader : SoapHeader
|
||||
{
|
||||
}
|
||||
|
||||
[WebServiceBindingAttribute(Name = "ServiceWithHeaders", Namespace = "https://example.com")]
|
||||
public class ServiceWithHeaders : SoapHttpClientProtocol
|
||||
{
|
||||
public RequestHeader RequestHeader { get; set; }
|
||||
public ResponseHeader ResponseHeader { get; set; }
|
||||
|
||||
[SoapHeaderAttribute("ResponseHeader", Direction = SoapHeaderDirection.Out)]
|
||||
[SoapHeaderAttribute("RequestHeader")]
|
||||
[SoapDocumentMethodAttribute("", RequestNamespace = "https://example.com", ResponseNamespace = "https://example.com", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
|
||||
public int method1()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
[SoapHeaderAttribute("ResponseHeader", Direction = SoapHeaderDirection.Out)]
|
||||
[SoapHeaderAttribute("RequestHeader")]
|
||||
[SoapDocumentMethodAttribute("", RequestNamespace = "https://example.com", ResponseNamespace = "https://example.com", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
|
||||
public int method2()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // Covers #41564
|
||||
public void ServiceWithHeader () {
|
||||
var service = new ServiceWithHeaders ();
|
||||
Assert.IsNotNull (service);
|
||||
// Should not throw an exception
|
||||
// XAMMAC specific bug
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -284,7 +284,7 @@ namespace System.Web.UI.WebControls {
|
||||
}
|
||||
|
||||
[Browsable (true)]
|
||||
public virtual new string SkinID
|
||||
public override string SkinID
|
||||
{
|
||||
get { return base.SkinID; }
|
||||
set { base.SkinID = value; }
|
||||
|
||||
@@ -51,17 +51,17 @@ namespace MonoTests.System.Xml
|
||||
public void CreateEvidenceForUrl_Basic ()
|
||||
{
|
||||
Evidence e = XmlSecureResolver.CreateEvidenceForUrl (null);
|
||||
#if DISABLE_CAS_USE
|
||||
Assert.IsNull (e);
|
||||
#else
|
||||
#if FEATURE_MONO_CAS
|
||||
Assert.AreEqual (0, e.Count, "null");
|
||||
#else
|
||||
Assert.IsNull (e);
|
||||
#endif
|
||||
|
||||
e = XmlSecureResolver.CreateEvidenceForUrl (String.Empty);
|
||||
#if DISABLE_CAS_USE
|
||||
Assert.IsNull (e);
|
||||
#else
|
||||
#if FEATURE_MONO_CAS
|
||||
Assert.AreEqual (0, e.Count, "String.Empty");
|
||||
#else
|
||||
Assert.IsNull (e);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +215,10 @@ namespace Mono.CSharp
|
||||
mcs.StartInfo.RedirectStandardOutput=true;
|
||||
mcs.StartInfo.RedirectStandardError=true;
|
||||
mcs.ErrorDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
|
||||
|
||||
// Use same text decoder as mcs and not user set values in Console
|
||||
mcs.StartInfo.StandardOutputEncoding =
|
||||
mcs.StartInfo.StandardErrorEncoding = Encoding.UTF8;
|
||||
|
||||
try {
|
||||
mcs.Start();
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Mono.Net.Security.Private
|
||||
}
|
||||
|
||||
public int KeyExchangeStrength {
|
||||
get { return KeyExchangeStrength; }
|
||||
get { return Impl.KeyExchangeStrength; }
|
||||
}
|
||||
|
||||
public bool CanRead {
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace System.Net.NetworkInformation {
|
||||
Win32_IP_ADAPTER_UNICAST_ADDRESS a;
|
||||
for (IntPtr p = ptr; p != IntPtr.Zero; p = a.Next) {
|
||||
a = (Win32_IP_ADAPTER_UNICAST_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_UNICAST_ADDRESS));
|
||||
c.Add (new Win32UnicastIPAddressInformation (ifIndex, a));
|
||||
c.InternalAdd (new Win32UnicastIPAddressInformation (ifIndex, a));
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -39,8 +39,11 @@ namespace System.Net.NetworkInformation
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
class Win32_FIXED_INFO
|
||||
{
|
||||
// Can't have unresolvable pinvokes on ios
|
||||
#if !MOBILE
|
||||
[DllImport ("iphlpapi.dll", SetLastError = true)]
|
||||
static extern int GetNetworkParams (byte [] bytes, ref int size);
|
||||
#endif
|
||||
|
||||
static Win32_FIXED_INFO fixed_info;
|
||||
|
||||
@@ -54,6 +57,7 @@ namespace System.Net.NetworkInformation
|
||||
|
||||
static Win32_FIXED_INFO GetInstance ()
|
||||
{
|
||||
#if !MOBILE
|
||||
int len = 0;
|
||||
byte [] bytes = null;
|
||||
GetNetworkParams (null, ref len);
|
||||
@@ -66,6 +70,9 @@ namespace System.Net.NetworkInformation
|
||||
}
|
||||
}
|
||||
return info;
|
||||
#else
|
||||
throw new NotImplementedException ();
|
||||
#endif
|
||||
}
|
||||
|
||||
const int MAX_HOSTNAME_LEN = 128;
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
@@ -16,6 +18,8 @@ namespace System.Net.Sockets {
|
||||
sealed class SafeSocketHandle : SafeHandleZeroOrMinusOneIsInvalid {
|
||||
|
||||
List<Thread> blocking_threads;
|
||||
Dictionary<Thread, StackTrace> threads_stacktraces;
|
||||
|
||||
bool in_cleanup;
|
||||
|
||||
const int SOCKET_CLOSED = 10004;
|
||||
@@ -26,6 +30,9 @@ namespace System.Net.Sockets {
|
||||
public SafeSocketHandle (IntPtr preexistingHandle, bool ownsHandle) : base (ownsHandle)
|
||||
{
|
||||
SetHandle (preexistingHandle);
|
||||
|
||||
if (THROW_ON_ABORT_RETRIES)
|
||||
threads_stacktraces = new Dictionary<Thread, StackTrace> ();
|
||||
}
|
||||
|
||||
// This is just for marshalling
|
||||
@@ -48,8 +55,17 @@ namespace System.Net.Sockets {
|
||||
int abort_attempts = 0;
|
||||
while (blocking_threads.Count > 0) {
|
||||
if (abort_attempts++ >= ABORT_RETRIES) {
|
||||
if (THROW_ON_ABORT_RETRIES)
|
||||
throw new Exception ("Could not abort registered blocking threads before closing socket.");
|
||||
if (THROW_ON_ABORT_RETRIES) {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.AppendLine ("Could not abort registered blocking threads before closing socket.");
|
||||
foreach (var thread in blocking_threads) {
|
||||
sb.AppendLine ("Thread StackTrace:");
|
||||
sb.AppendLine (threads_stacktraces[thread].ToString ());
|
||||
}
|
||||
sb.AppendLine ();
|
||||
|
||||
throw new Exception (sb.ToString ());
|
||||
}
|
||||
|
||||
// Attempts to close the socket safely failed.
|
||||
// We give up, and close the socket with pending blocking system calls.
|
||||
@@ -94,6 +110,8 @@ namespace System.Net.Sockets {
|
||||
/* We must use a finally block here to make this atomic. */
|
||||
lock (blocking_threads) {
|
||||
blocking_threads.Add (Thread.CurrentThread);
|
||||
if (THROW_ON_ABORT_RETRIES)
|
||||
threads_stacktraces.Add (Thread.CurrentThread, new StackTrace (true));
|
||||
}
|
||||
if (release)
|
||||
DangerousRelease ();
|
||||
@@ -110,6 +128,9 @@ namespace System.Net.Sockets {
|
||||
//If this NRE, we're in deep problems because Register Must have
|
||||
lock (blocking_threads) {
|
||||
blocking_threads.Remove (Thread.CurrentThread);
|
||||
if (THROW_ON_ABORT_RETRIES)
|
||||
threads_stacktraces.Remove (Thread.CurrentThread);
|
||||
|
||||
if (in_cleanup && blocking_threads.Count == 0)
|
||||
Monitor.Pulse (blocking_threads);
|
||||
}
|
||||
|
||||
@@ -1328,7 +1328,7 @@ namespace System.Net.Sockets
|
||||
if (e.RemoteEndPoint == null)
|
||||
throw new ArgumentNullException ("remoteEP");
|
||||
|
||||
InitSocketAsyncEventArgs (e, ConnectAsyncCallback, e, SocketOperation.Connect);
|
||||
InitSocketAsyncEventArgs (e, null, e, SocketOperation.Connect);
|
||||
|
||||
try {
|
||||
IPAddress [] addresses;
|
||||
@@ -3176,7 +3176,7 @@ namespace System.Net.Sockets
|
||||
{
|
||||
ThrowIfDisposedAndClosed ();
|
||||
|
||||
if (optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse ())
|
||||
if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocol_type))
|
||||
throw new SocketException ((int) SocketError.OperationNotSupported, "Operating system sockets do not support ReuseAddress.\nIf your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.");
|
||||
|
||||
int error;
|
||||
@@ -3479,7 +3479,7 @@ namespace System.Net.Sockets
|
||||
internal static extern void cancel_blocking_socket_operation (Thread thread);
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
internal static extern bool SupportsPortReuse ();
|
||||
internal static extern bool SupportsPortReuse (ProtocolType proto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,8 @@ namespace System.Net {
|
||||
SocketAsyncEventArgs args = new SocketAsyncEventArgs ();
|
||||
args.UserToken = this;
|
||||
args.Completed += OnAccept;
|
||||
Accept (sock, args);
|
||||
Socket dummy = null;
|
||||
Accept (sock, args, ref dummy);
|
||||
prefixes = new Hashtable ();
|
||||
unregistered = new Dictionary<HttpConnection, HttpConnection> ();
|
||||
}
|
||||
@@ -82,9 +83,21 @@ namespace System.Net {
|
||||
get { return listener; }
|
||||
}
|
||||
|
||||
static void Accept (Socket socket, SocketAsyncEventArgs e) {
|
||||
static void Accept (Socket socket, SocketAsyncEventArgs e, ref Socket accepted) {
|
||||
e.AcceptSocket = null;
|
||||
var asyn = socket.AcceptAsync(e);
|
||||
bool asyn;
|
||||
try {
|
||||
asyn = socket.AcceptAsync(e);
|
||||
} catch {
|
||||
if (accepted != null) {
|
||||
try {
|
||||
accepted.Close ();
|
||||
} catch {
|
||||
}
|
||||
accepted = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!asyn) {
|
||||
ProcessAccept(e);
|
||||
}
|
||||
@@ -100,7 +113,7 @@ namespace System.Net {
|
||||
EndPointListener epl = (EndPointListener) args.UserToken;
|
||||
|
||||
|
||||
Accept (epl.sock, args);
|
||||
Accept (epl.sock, args, ref accepted);
|
||||
if (accepted == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -115,6 +115,12 @@ namespace System.Net
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SupportsHeaders {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public string StatusDescription {
|
||||
get {
|
||||
return statusDescription;
|
||||
|
||||
@@ -244,6 +244,12 @@ namespace System.Net
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SupportsHeaders {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods
|
||||
|
||||
public string GetResponseHeader (string headerName)
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace System.Net
|
||||
{
|
||||
public class ServicePoint
|
||||
{
|
||||
Uri uri;
|
||||
readonly Uri uri;
|
||||
int connectionLimit;
|
||||
int maxIdleTime;
|
||||
int currentConnections;
|
||||
@@ -345,15 +345,31 @@ namespace System.Net
|
||||
lock (hostE) {
|
||||
string uriHost = uri.Host;
|
||||
|
||||
if (host == null || HasTimedOut) {
|
||||
lastDnsResolve = DateTime.UtcNow;
|
||||
if (host == null) {
|
||||
// Cannot do DNS resolution on literal IP addresses
|
||||
if (uri.HostNameType == UriHostNameType.IPv6 || uri.HostNameType == UriHostNameType.IPv4) {
|
||||
|
||||
try {
|
||||
host = Dns.GetHostEntry (uriHost);
|
||||
}
|
||||
catch (Exception) {
|
||||
return null;
|
||||
if (uri.HostNameType == UriHostNameType.IPv6) {
|
||||
// Remove square brackets
|
||||
uriHost = uriHost.Substring (1, uriHost.Length - 2);
|
||||
}
|
||||
|
||||
// Creates IPHostEntry
|
||||
host = new IPHostEntry();
|
||||
host.AddressList = new IPAddress[] { IPAddress.Parse (uriHost) };
|
||||
return host;
|
||||
}
|
||||
} else {
|
||||
if (!HasTimedOut)
|
||||
return host;
|
||||
}
|
||||
|
||||
lastDnsResolve = DateTime.UtcNow;
|
||||
|
||||
try {
|
||||
host = Dns.GetHostEntry (uriHost);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// Copyright 2013-2014 Xamarin Inc.
|
||||
//
|
||||
|
||||
#if MOBILE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -29,3 +31,5 @@ namespace System.Net {
|
||||
public static CipherSuitesCallback ServerCipherSuitesCallback { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,6 +16,8 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using Microsoft.CSharp;
|
||||
using NUnit.Framework;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
|
||||
namespace MonoTests.Microsoft.CSharp
|
||||
{
|
||||
@@ -566,6 +568,39 @@ namespace MonoTests.Microsoft.CSharp
|
||||
AssertCompileResults (results, true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EncodingMismatch ()
|
||||
{
|
||||
var source = @"
|
||||
#warning Trigger Some Warning
|
||||
public class MyClass {
|
||||
public static string MyMethod () { return ""data""; }
|
||||
}";
|
||||
|
||||
var p = new CompilerParameters () {
|
||||
GenerateInMemory = false,
|
||||
GenerateExecutable = false,
|
||||
IncludeDebugInformation = true,
|
||||
TreatWarningsAsErrors = false,
|
||||
TempFiles = new TempFileCollection (_tempDir, true),
|
||||
};
|
||||
|
||||
var prov = new CSharpCodeProvider ();
|
||||
CompilerResults results;
|
||||
|
||||
var prev = Console.OutputEncoding;
|
||||
try {
|
||||
Console.OutputEncoding = Encoding.Unicode;
|
||||
|
||||
results = prov.CompileAssemblyFromSource (p, source);
|
||||
} finally {
|
||||
Console.OutputEncoding = prev;
|
||||
}
|
||||
|
||||
Assert.IsNotNull (results.Errors);
|
||||
Assert.IsTrue (results.Output.Cast<string>().ToArray ()[1].Contains ("Trigger Some Warning"));
|
||||
}
|
||||
|
||||
private static string CreateTempDirectory ()
|
||||
{
|
||||
// create a uniquely named zero-byte file
|
||||
|
||||
@@ -7,9 +7,11 @@ using System.Threading;
|
||||
namespace MonoTests.System.Net.NetworkInformation
|
||||
{
|
||||
[TestFixture]
|
||||
public class PingTest
|
||||
public partial class PingTest
|
||||
{
|
||||
[Test]
|
||||
partial void AndroidShouldPingWork (ref bool shouldWork);
|
||||
|
||||
[Test]
|
||||
public void PingFail()
|
||||
{
|
||||
#if MONOTOUCH
|
||||
@@ -26,8 +28,13 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
#if MONOTOUCH
|
||||
Assert.Ignore ("Ping implementation is broken on MT (requires sudo access)");
|
||||
#else
|
||||
var p = new Ping ().Send ("127.0.0.1");
|
||||
Assert.AreEqual(IPStatus.Success, p.Status);
|
||||
bool shouldWork = true;
|
||||
AndroidShouldPingWork (ref shouldWork);
|
||||
if (shouldWork) {
|
||||
var p = new Ping ().Send ("127.0.0.1");
|
||||
Assert.AreEqual(IPStatus.Success, p.Status);
|
||||
} else
|
||||
Assert.Ignore ("Ping will not work on this Android device");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -106,11 +106,11 @@ namespace MonoTests.System.Net.Sockets
|
||||
bool res = clientSocket.SendAsync (e);
|
||||
if (res) {
|
||||
if (!m.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
Assert.Fail ("Timeout #1");
|
||||
}
|
||||
|
||||
if (!mainEvent.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
Assert.Fail ("Timeout #2");
|
||||
if (error != null)
|
||||
throw error;
|
||||
|
||||
@@ -124,13 +124,13 @@ namespace MonoTests.System.Net.Sockets
|
||||
res = clientSocket.SendAsync (e);
|
||||
if (res) {
|
||||
if (!m.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
Assert.Fail ("Timeout #3");
|
||||
}
|
||||
|
||||
if (!mainEvent.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
Assert.Fail ("Timeout #4");
|
||||
if (error != null)
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ using System.Collections;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using NUnit.Framework;
|
||||
@@ -4228,7 +4229,22 @@ namespace MonoTests.System.Net.Sockets
|
||||
[Test]
|
||||
public void SendAsyncFile ()
|
||||
{
|
||||
Socket serverSocket = StartSocketServer ();
|
||||
Socket serverSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
serverSocket.Bind (new IPEndPoint (IPAddress.Loopback, 0));
|
||||
serverSocket.Listen (1);
|
||||
|
||||
var mReceived = new ManualResetEvent (false);
|
||||
|
||||
serverSocket.BeginAccept (AsyncCall => {
|
||||
byte[] bytes = new byte [1024];
|
||||
|
||||
Socket listener = (Socket)AsyncCall.AsyncState;
|
||||
Socket client = listener.EndAccept (AsyncCall);
|
||||
client.Receive (bytes, bytes.Length, 0);
|
||||
client.Close ();
|
||||
mReceived.Set ();
|
||||
}, serverSocket);
|
||||
|
||||
Socket clientSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
clientSocket.Connect (serverSocket.LocalEndPoint);
|
||||
@@ -4246,18 +4262,19 @@ namespace MonoTests.System.Net.Sockets
|
||||
sw.Write (buffer);
|
||||
}
|
||||
|
||||
var m = new ManualResetEvent (false);
|
||||
var mSent = new ManualResetEvent (false);
|
||||
|
||||
// Async Send File to server
|
||||
clientSocket.BeginSendFile(temp, (ar) => {
|
||||
Socket client = (Socket) ar.AsyncState;
|
||||
client.EndSendFile (ar);
|
||||
m.Set ();
|
||||
mSent.Set ();
|
||||
}, clientSocket);
|
||||
|
||||
if (!m.WaitOne (1500))
|
||||
if (!mSent.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
if (!mReceived.WaitOne (1500))
|
||||
throw new TimeoutException ();
|
||||
m.Reset ();
|
||||
} finally {
|
||||
if (File.Exists (temp))
|
||||
File.Delete (temp);
|
||||
@@ -4317,30 +4334,6 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
}
|
||||
|
||||
Socket StartSocketServer ()
|
||||
{
|
||||
|
||||
Socket listenSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
listenSocket.Bind (new IPEndPoint (IPAddress.Loopback, NetworkHelpers.FindFreePort ()));
|
||||
listenSocket.Listen (1);
|
||||
|
||||
listenSocket.BeginAccept (new AsyncCallback (ReceiveCallback), listenSocket);
|
||||
|
||||
return listenSocket;
|
||||
}
|
||||
|
||||
public static void ReceiveCallback (IAsyncResult AsyncCall)
|
||||
{
|
||||
byte[] bytes = new byte [1024];
|
||||
|
||||
Socket listener = (Socket)AsyncCall.AsyncState;
|
||||
Socket client = listener.EndAccept (AsyncCall);
|
||||
|
||||
client.Receive (bytes, bytes.Length, 0);
|
||||
client.Close ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UdpMulticasTimeToLive ()
|
||||
{
|
||||
@@ -4353,6 +4346,23 @@ namespace MonoTests.System.Net.Sockets
|
||||
socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 19);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // Covers 41616
|
||||
public void ConnectAsyncUnhandledEx ()
|
||||
{
|
||||
var mre = new ManualResetEvent (false);
|
||||
|
||||
var endPoint = new IPEndPoint(0,0);
|
||||
var socket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Unspecified);
|
||||
|
||||
var socketArgs = new SocketAsyncEventArgs();
|
||||
socketArgs.RemoteEndPoint = endPoint;
|
||||
socketArgs.Completed += (sender, e) => mre.Set ();
|
||||
|
||||
socket.ConnectAsync (socketArgs);
|
||||
|
||||
Assert.IsTrue (mre.WaitOne (1000), "ConnectedAsync timeout");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
@@ -194,15 +195,22 @@ namespace MonoTests.System.Net
|
||||
[Test]
|
||||
public void HttpRequestIsLocal ()
|
||||
{
|
||||
var ips = new List<IPAddress> (Dns.GetHostAddresses (Dns.GetHostName ()));
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
var ips = new List<IPAddress> ();
|
||||
ips.Add (IPAddress.Loopback);
|
||||
foreach (var adapter in NetworkInterface.GetAllNetworkInterfaces ()) {
|
||||
foreach (var ip in adapter.GetIPProperties ().UnicastAddresses) {
|
||||
ips.Add (ip.Address);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var ip in ips) {
|
||||
if (ip.AddressFamily != AddressFamily.InterNetwork)
|
||||
continue;
|
||||
|
||||
HttpListener listener = HttpListener2Test.CreateAndStartListener (
|
||||
"http://" + ip + ":9000/HttpRequestIsLocal/");
|
||||
NetworkStream ns = HttpListener2Test.CreateNS (ip, 9000);
|
||||
"http://" + ip + ":" + port + "/HttpRequestIsLocal/");
|
||||
NetworkStream ns = HttpListener2Test.CreateNS (ip, port);
|
||||
HttpListener2Test.Send (ns, "GET /HttpRequestIsLocal/ HTTP/1.0\r\n\r\n");
|
||||
HttpListenerContext ctx = listener.GetContext ();
|
||||
HttpListenerRequest request = ctx.Request;
|
||||
|
||||
@@ -219,7 +219,7 @@ public class ServicePointTest
|
||||
|
||||
ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;
|
||||
|
||||
uri = new Uri ("http://www.google.com/");
|
||||
uri = new Uri ("http://localhost/");
|
||||
sp = ServicePointManager.FindServicePoint (uri);
|
||||
|
||||
hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace MonoTests.System.Timers
|
||||
public class TimerTest
|
||||
{
|
||||
Timer timer;
|
||||
int _elapsedCount;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp ()
|
||||
@@ -287,19 +286,46 @@ namespace MonoTests.System.Timers
|
||||
Assert.IsFalse (timer.Enabled, "#3");
|
||||
}
|
||||
|
||||
[Test] // bug #325368
|
||||
[Test] // bug https://bugzilla.novell.com/show_bug.cgi?id=325368
|
||||
public void EnabledInElapsed ()
|
||||
{
|
||||
_elapsedCount = 0;
|
||||
var elapsedCount = 0;
|
||||
var mre = new ST.ManualResetEventSlim ();
|
||||
timer = new Timer (50);
|
||||
timer.AutoReset = false;
|
||||
timer.Elapsed += new ElapsedEventHandler (EnabledInElapsed_Elapsed);
|
||||
timer.Elapsed += (s, e) =>
|
||||
{
|
||||
elapsedCount++;
|
||||
if (elapsedCount == 1)
|
||||
timer.Enabled = true;
|
||||
else if (elapsedCount == 2)
|
||||
mre.Set ();
|
||||
};
|
||||
timer.Start ();
|
||||
|
||||
ST.Thread.Sleep (200);
|
||||
Assert.IsTrue (mre.Wait (1000), "#1 re-enabling timer in Elapsed didn't work");
|
||||
Assert.AreEqual (2, elapsedCount, "#2 wrong elapsedCount");
|
||||
timer.Stop ();
|
||||
}
|
||||
|
||||
Assert.IsTrue (_elapsedCount == 2, "#1 loss of events");
|
||||
[Test]
|
||||
public void AutoResetEventFalseStopsFiringElapsed ()
|
||||
{
|
||||
var elapsedCount = 0;
|
||||
var mre = new ST.ManualResetEventSlim ();
|
||||
timer = new Timer (50);
|
||||
timer.AutoReset = false;
|
||||
timer.Elapsed += (s, e) =>
|
||||
{
|
||||
elapsedCount++;
|
||||
if (elapsedCount > 1)
|
||||
mre.Set ();
|
||||
};
|
||||
timer.Start ();
|
||||
|
||||
Assert.IsFalse (mre.Wait (1000), "#1 AutoReset=false didn't stop firing Elapsed, elapsedCount=" + elapsedCount);
|
||||
Assert.AreEqual (1, elapsedCount, "#2 wrong elapsedCount");
|
||||
timer.Stop ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -308,14 +334,6 @@ namespace MonoTests.System.Timers
|
||||
Assert.IsTrue (new RaceTest (true).Success, "#1");
|
||||
Assert.IsTrue (new RaceTest (false).Success, "#2");
|
||||
}
|
||||
|
||||
void EnabledInElapsed_Elapsed (object sender, ElapsedEventArgs e)
|
||||
{
|
||||
_elapsedCount++;
|
||||
Timer t = sender as Timer;
|
||||
if (_elapsedCount == 1)
|
||||
t.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
class RaceTest
|
||||
|
||||
@@ -2064,5 +2064,13 @@ namespace MonoTests.System
|
||||
|
||||
Assert.AreEqual ("http://localhost/foo", res.ToString ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImplicitUnixFileWithUnicode ()
|
||||
{
|
||||
string value = "/Library/Frameworks/System.Runtim…ee";
|
||||
Uri uri;
|
||||
Assert.IsTrue (Uri.TryCreate (value, UriKind.Absolute, out uri));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,7 @@ System.Net/ICredentialPolicy.cs
|
||||
System.Net/IPv6Address.cs
|
||||
System.Net/IPv6Address.cs
|
||||
System.Net/IWebConnectionState.cs
|
||||
System.Net/IWebProxyScript.cs
|
||||
System.Net/ListenerAsyncResult.cs
|
||||
System.Net/ListenerPrefix.cs
|
||||
System.Net/MacProxy.cs
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,83 @@
|
||||
#include mobile_static_System_test.dll.exclude.sources
|
||||
#include monodroid_System_test.dll.new-exclude.sources
|
||||
Microsoft.Win32/IntranetZoneCredentialPolicyCas.cs
|
||||
Microsoft.Win32/IntranetZoneCredentialPolicyTest.cs
|
||||
Microsoft.Win32/PowerModeChangedEventArgsCas.cs
|
||||
Microsoft.Win32/SessionEndedEventArgsCas.cs
|
||||
Microsoft.Win32/SessionEndingEventArgsCas.cs
|
||||
Microsoft.Win32/SessionSwitchEventArgsCas.cs
|
||||
Microsoft.Win32/SessionSwitchEventArgsTest.cs
|
||||
Microsoft.Win32/SystemEventsCas.cs
|
||||
Microsoft.Win32/TimerElapsedEventArgsCas.cs
|
||||
Microsoft.Win32/UserPreferenceChangedEventArgsCas.cs
|
||||
Microsoft.Win32/UserPreferenceChangingEventArgsCas.cs
|
||||
System.Collections.Concurrent/CollectionStressTestHelper.cs
|
||||
System.Collections.Specialized/BitVector32Cas.cs
|
||||
System.Collections.Specialized/CollectionsUtilCas.cs
|
||||
System.Collections.Specialized/HybridDictionaryCas.cs
|
||||
System.Collections.Specialized/ListDictionaryCas.cs
|
||||
System.Collections.Specialized/NameObjectCollectionBaseCas.cs
|
||||
System.Collections.Specialized/NameValueCollectionCas.cs
|
||||
System.Collections.Specialized/OrderedDictionaryCas.cs
|
||||
System.Collections.Specialized/StringCollectionCas.cs
|
||||
System.Collections.Specialized/StringDictionaryCas.cs
|
||||
System.ComponentModel.Design.Serialization/InstanceDescriptorCas.cs
|
||||
System/FileStyleUriParserCas.cs
|
||||
System/FtpStyleUriParserCas.cs
|
||||
System/GenericUriParserCas.cs
|
||||
System/GopherStyleUriParserCas.cs
|
||||
System/HttpStyleUriParserCas.cs
|
||||
System.IO.Compression/DeflateStreamCas.cs
|
||||
System.IO.Compression/GZipStreamCas.cs
|
||||
System/LdapStyleUriParserCas.cs
|
||||
System.Net/DnsCas.cs
|
||||
System.Net/FileWebRequestCas.cs
|
||||
System.Net/HttpListener2Test.cs
|
||||
System.Net/HttpListenerRequestTest.cs
|
||||
System.Net/HttpWebRequestCas.cs
|
||||
System/NetPipeStyleUriParserCas.cs
|
||||
System.Net.Sockets/NetworkStreamCas.cs
|
||||
System.Net.Sockets/SocketCas.cs
|
||||
System.Net.Sockets/TcpClientCas.cs
|
||||
System/NetTcpStyleUriParserCas.cs
|
||||
System/NewsStyleUriParserCas.cs
|
||||
System.Security.Cryptography.X509Certificates/PublicKeyCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X500DistinguishedNameCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtensionCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509CertificateCollectionCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509ChainCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509ChainPolicyCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtensionCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509ExtensionCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509KeyUsageExtensionCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509StoreCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtensionCas.cs
|
||||
System.Security.Permissions/ResourcePermissionBaseCas.cs
|
||||
System.Security.Permissions/ResourcePermissionBaseEntryCas.cs
|
||||
System.Security.Permissions/ResourcePermissionBaseEntryTest.cs
|
||||
System.Security.Permissions/ResourcePermissionBaseTest.cs
|
||||
System.Security.Permissions/StorePermissionAttributeCas.cs
|
||||
System.Security.Permissions/StorePermissionAttributeTest.cs
|
||||
System.Security.Permissions/StorePermissionCas.cs
|
||||
System.Security.Permissions/StorePermissionTest.cs
|
||||
System.Text.RegularExpressions/CaptureCas.cs
|
||||
System.Text.RegularExpressions/CaptureCollectionCas.cs
|
||||
System.Text.RegularExpressions/GroupCas.cs
|
||||
System.Text.RegularExpressions/GroupCollectionCas.cs
|
||||
System.Text.RegularExpressions/MatchCas.cs
|
||||
System.Text.RegularExpressions/MatchCollectionCas.cs
|
||||
System.Text.RegularExpressions/RegexCas.cs
|
||||
System.Text.RegularExpressions/RegexCompilationInfoCas.cs
|
||||
System.Text.RegularExpressions/RegexRunnerCas.cs
|
||||
System.Text.RegularExpressions/RegexRunnerFactoryCas.cs
|
||||
System.Threading/SemaphoreCas.cs
|
||||
System.Threading/SemaphoreFullExceptionCas.cs
|
||||
System.Threading/ThreadExceptionEventArgsCas.cs
|
||||
System.Timers/ElapsedEventArgsCas.cs
|
||||
System.Timers/TimerCas.cs
|
||||
System.Timers/TimersDescriptionAttributeCas.cs
|
||||
System/UriBuilderCas.cs
|
||||
System/UriCas.cs
|
||||
System/UriFormatExceptionCas.cs
|
||||
System/UriParserCas.cs
|
||||
System/UriTypeConverterCas.cs
|
||||
@@ -0,0 +1,2 @@
|
||||
System.Net/HttpWebRequestTest.cs
|
||||
System.Net.Sockets/SocketAcceptAsyncTest.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include System_test.dll.sources
|
||||
@@ -432,7 +432,11 @@ namespace MonoTests.System.IO.Packaging {
|
||||
using (var archive = new ZipArchive(stream))
|
||||
{
|
||||
foreach (var entry in archive.Entries)
|
||||
Assert.AreEqual (entry.LastWriteTime.Year, DateTime.Now.Year);
|
||||
{
|
||||
Assert.AreEqual (DateTime.Now.Year, entry.LastWriteTime.Year);
|
||||
Assert.AreEqual (DateTime.Now.Month, entry.LastWriteTime.Month);
|
||||
Assert.AreEqual (DateTime.Now.Day, entry.LastWriteTime.Day);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ namespace zipsharp
|
||||
minute = (uint) time.Minute;
|
||||
hour = (uint) time.Hour;
|
||||
day = (uint) time.Day;
|
||||
month = (uint) time.Month;
|
||||
month = (uint) time.Month - 1;
|
||||
year = (uint) time.Year;
|
||||
}
|
||||
|
||||
public DateTime Date
|
||||
{
|
||||
get { return new DateTime ((int) year, (int) month, (int) day, (int) hour, (int) minute, (int) second); }
|
||||
get { return new DateTime ((int) year, (int) month + 1, (int) day, (int) hour, (int) minute, (int) second); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,9 +128,11 @@ namespace System.Reflection {
|
||||
|
||||
if (!suppressSecurityChecks)
|
||||
{
|
||||
#if FEATURE_MONO_CAS
|
||||
#pragma warning disable 618
|
||||
new SecurityPermission(SecurityPermissionFlag.ControlEvidence).Demand();
|
||||
#pragma warning restore 618
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ namespace System.Runtime.Remoting.Contexts
|
||||
bool _bReEntrant;
|
||||
int _flavor;
|
||||
|
||||
[NonSerialized]
|
||||
bool _locked;
|
||||
[NonSerialized]
|
||||
int _lockCount;
|
||||
|
||||
@@ -90,32 +88,26 @@ namespace System.Runtime.Remoting.Contexts
|
||||
{
|
||||
get
|
||||
{
|
||||
return _locked;
|
||||
return _lockCount > 0;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
_mutex.WaitOne ();
|
||||
AcquireLock ();
|
||||
lock (this)
|
||||
{
|
||||
_lockCount++;
|
||||
if (_lockCount > 1)
|
||||
ReleaseLock (); // Thread already had the lock
|
||||
|
||||
_ownerThread = Thread.CurrentThread;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
while (_lockCount > 0 && _ownerThread == Thread.CurrentThread)
|
||||
{
|
||||
_lockCount--;
|
||||
_mutex.ReleaseMutex ();
|
||||
_ownerThread = null;
|
||||
while (_lockCount > 0 && _ownerThread == Thread.CurrentThread) {
|
||||
ReleaseLock ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +132,9 @@ namespace System.Runtime.Remoting.Contexts
|
||||
if (_lockCount > 0 && _ownerThread == Thread.CurrentThread) {
|
||||
_lockCount--;
|
||||
_mutex.ReleaseMutex ();
|
||||
_ownerThread = null;
|
||||
if (_lockCount == 0) {
|
||||
_ownerThread = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,11 @@ namespace System.Security {
|
||||
{
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public void Assert ()
|
||||
{
|
||||
new PermissionSet (this).Assert ();
|
||||
@@ -60,6 +64,9 @@ namespace System.Security {
|
||||
|
||||
public abstract IPermission Copy ();
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#endif
|
||||
public void Demand ()
|
||||
{
|
||||
// note: here we're sure it's a CAS demand
|
||||
@@ -70,7 +77,11 @@ namespace System.Security {
|
||||
new PermissionSet (this).CasOnlyDemand (3);
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public void Deny ()
|
||||
{
|
||||
new PermissionSet (this).Deny ();
|
||||
@@ -114,13 +125,21 @@ namespace System.Security {
|
||||
return null;
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public void PermitOnly ()
|
||||
{
|
||||
new PermissionSet (this).PermitOnly ();
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public static void RevertAll ()
|
||||
{
|
||||
if (!SecurityManager.SecurityEnabled)
|
||||
@@ -128,7 +147,11 @@ namespace System.Security {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public static void RevertAssert ()
|
||||
{
|
||||
if (!SecurityManager.SecurityEnabled)
|
||||
@@ -136,7 +159,11 @@ namespace System.Security {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public static void RevertDeny ()
|
||||
{
|
||||
if (!SecurityManager.SecurityEnabled)
|
||||
@@ -144,7 +171,11 @@ namespace System.Security {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
[Conditional ("FEATURE_MONO_CAS")]
|
||||
#else
|
||||
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
|
||||
#endif
|
||||
public static void RevertPermitOnly ()
|
||||
{
|
||||
if (!SecurityManager.SecurityEnabled)
|
||||
@@ -233,5 +264,28 @@ namespace System.Security {
|
||||
msg = String.Format (msg, target.GetType (), expected);
|
||||
throw new ArgumentException (msg, "target");
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
// Workaround for CS0629
|
||||
void IStackWalk.Assert ()
|
||||
{
|
||||
}
|
||||
|
||||
void IStackWalk.Deny ()
|
||||
{
|
||||
}
|
||||
|
||||
void IStackWalk.PermitOnly ()
|
||||
{
|
||||
}
|
||||
|
||||
void IStackWalk.Demand ()
|
||||
{
|
||||
}
|
||||
|
||||
void IPermission.Demand ()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace System {
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#pragma warning disable 169
|
||||
private const int mono_corlib_version = 148;
|
||||
private const int mono_corlib_version = 149;
|
||||
#pragma warning restore 169
|
||||
|
||||
[ComVisible (true)]
|
||||
|
||||
@@ -873,7 +873,7 @@ namespace System
|
||||
return true;
|
||||
|
||||
// We might be in the dateTime previous year's DST period
|
||||
return IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
|
||||
return dateTime.Year > 1 && IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
|
||||
}
|
||||
|
||||
bool IsInDSTForYear (AdjustmentRule rule, DateTime dateTime, int year)
|
||||
@@ -1221,8 +1221,10 @@ namespace System
|
||||
|
||||
try {
|
||||
return ParseTZBuffer (id, buffer, length);
|
||||
} catch (InvalidTimeZoneException) {
|
||||
throw;
|
||||
} catch (Exception e) {
|
||||
throw new InvalidTimeZoneException (e.Message);
|
||||
throw new InvalidTimeZoneException ("Time zone information file contains invalid data", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1279,7 +1281,7 @@ namespace System
|
||||
if (time_types.Count == 0)
|
||||
throw new InvalidTimeZoneException ();
|
||||
|
||||
if (time_types.Count == 1 && ((TimeType)time_types[0]).IsDst)
|
||||
if (time_types.Count == 1 && time_types[0].IsDst)
|
||||
throw new InvalidTimeZoneException ();
|
||||
|
||||
TimeSpan baseUtcOffset = new TimeSpan (0);
|
||||
@@ -1360,8 +1362,8 @@ namespace System
|
||||
|
||||
TimeZoneInfo tz;
|
||||
if (adjustmentRules.Count == 0 && !storeTransition) {
|
||||
TimeType t = (TimeType)time_types [0];
|
||||
if (standardDisplayName == null) {
|
||||
var t = time_types [0];
|
||||
standardDisplayName = t.Name;
|
||||
baseUtcOffset = new TimeSpan (0, 0, t.Offset);
|
||||
}
|
||||
@@ -1405,6 +1407,20 @@ namespace System
|
||||
var types = new Dictionary<int, TimeType> (count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
int offset = ReadBigEndianInt32 (buffer, index + 6 * i);
|
||||
|
||||
//
|
||||
// The official tz database contains timezone with GMT offsets
|
||||
// not only in whole hours/minutes but in seconds. This happens for years
|
||||
// before 1901. For example
|
||||
//
|
||||
// NAME GMTOFF RULES FORMAT UNTIL
|
||||
// Europe/Madrid -0:14:44 - LMT 1901 Jan 1 0:00s
|
||||
//
|
||||
// .NET as of 4.6.2 cannot handle that and uses hours/minutes only, so
|
||||
// we remove seconds to not crash later
|
||||
//
|
||||
offset = (offset / 60) * 60;
|
||||
|
||||
byte is_dst = buffer [index + 6 * i + 4];
|
||||
byte abbrev = buffer [index + 6 * i + 5];
|
||||
types.Add (i, new TimeType (offset, (is_dst != 0), abbreviations [(int)abbrev]));
|
||||
@@ -1460,7 +1476,7 @@ namespace System
|
||||
#endregion
|
||||
}
|
||||
|
||||
struct TimeType {
|
||||
class TimeType {
|
||||
public readonly int Offset;
|
||||
public readonly bool IsDst;
|
||||
public string Name;
|
||||
|
||||
@@ -182,7 +182,10 @@ 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
|
||||
#if __WATCHOS__
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
|
||||
#elif !MONODROID
|
||||
string fname = AppDomain.CurrentDomain.FriendlyName;
|
||||
if (fname.EndsWith (".dll")) { // nunit-console
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
@@ -249,7 +252,7 @@ namespace MonoTests.System.Reflection
|
||||
public void Corlib_test ()
|
||||
{
|
||||
Assembly corlib_test = Assembly.GetExecutingAssembly ();
|
||||
#if MONODROID || MOBILE_STATIC
|
||||
#if MONODROID || MOBILE_STATIC || __WATCHOS__
|
||||
Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
|
||||
Assert.IsNull (corlib_test.Evidence, "Evidence");
|
||||
#elif MOBILE
|
||||
|
||||
+17
@@ -71,6 +71,23 @@ namespace MonoTests.System.Runtime.Remoting.Contexts {
|
||||
Assert.IsFalse (sa.Locked, "Locked");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SetLocked()
|
||||
{
|
||||
SynchronizationAttribute sa = new SynchronizationAttribute(SynchronizationAttribute.REQUIRES_NEW);
|
||||
sa.Locked = true;
|
||||
Assert.IsTrue(sa.Locked, "Locked");
|
||||
sa.Locked = false;
|
||||
Assert.IsFalse(sa.Locked, "Locked");
|
||||
|
||||
sa.Locked = true;
|
||||
Assert.IsTrue(sa.Locked, "Locked");
|
||||
sa.Locked = true;
|
||||
Assert.IsTrue(sa.Locked, "Locked");
|
||||
sa.Locked = false;
|
||||
Assert.IsFalse(sa.Locked, "Locked");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SerializationRoundtrip ()
|
||||
{
|
||||
|
||||
@@ -220,6 +220,7 @@ namespace MonoTests.System.Runtime.Remoting
|
||||
public void TestLocked1 ()
|
||||
{
|
||||
sincob.Lock (false);
|
||||
|
||||
Thread tr = new Thread (new ThreadStart (FirstSyncThread));
|
||||
tr.Start ();
|
||||
Thread.Sleep (200);
|
||||
@@ -331,6 +332,21 @@ namespace MonoTests.System.Runtime.Remoting
|
||||
Assert.IsTrue (!otResult, "Concurrency detected in CallbackThread");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSynchronizationReleasedOnMultipleAcquire ()
|
||||
{
|
||||
|
||||
otResult = notreentrant.TestCallback ();
|
||||
|
||||
Thread tr = new Thread (new ThreadStart (CallbackThread));
|
||||
tr.Start();
|
||||
|
||||
bool terminated = tr.Join(2000);
|
||||
Assert.IsTrue(terminated, "Thread didn't get lock of context bound object.");
|
||||
|
||||
Assert.IsTrue (!otResult, "Concurrency detected in CallbackThread");
|
||||
}
|
||||
|
||||
void CallbackThread ()
|
||||
{
|
||||
otResult = notreentrant.TestCallback ();
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// (C) 2004 Motus Technologies Inc. (http://www.motus.com)
|
||||
//
|
||||
|
||||
#if FEATURE_MONO_CAS
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Security;
|
||||
@@ -89,3 +91,5 @@ namespace MonoTests.System.Security {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if FEATURE_MONO_CAS
|
||||
|
||||
using System;
|
||||
using System.Security;
|
||||
@@ -168,3 +168,4 @@ namespace MonoCasTests.System.Threading {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -156,9 +156,13 @@ namespace MonoTests.System
|
||||
public void GetCommandLineArgs ()
|
||||
{
|
||||
string[] args = Environment.GetCommandLineArgs ();
|
||||
#if !__WATCHOS__
|
||||
Assert.IsNotNull (args, "not null");
|
||||
Assert.IsTrue (((args.Length > 0) && (args.Length < 256)), "reasonable");
|
||||
Assert.IsNotNull (args [0], "application");
|
||||
#else
|
||||
Assert.AreEqual (0, args.Length, "length");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !NET_2_1
|
||||
|
||||
@@ -923,18 +923,18 @@ namespace MonoTests.System
|
||||
"Canada/Newfoundland",
|
||||
"Europe/Moscow",
|
||||
"Europe/Riga",
|
||||
"N/A", // testing that the test doesn't fail with inexistent TZs
|
||||
};
|
||||
foreach (var tz in subMinuteDSTs) {
|
||||
try {
|
||||
TimeZoneInfo.FindSystemTimeZoneById (tz);
|
||||
} catch (TimeZoneNotFoundException) {
|
||||
// ok;
|
||||
} catch (Exception ex) {
|
||||
Assert.Fail (string.Format ("Failed to load TZ {0}: {1}", tz, ex.ToString ()));
|
||||
}
|
||||
TimeZoneInfo.FindSystemTimeZoneById (tz);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (TimeZoneNotFoundException))]
|
||||
public void InvalidName ()
|
||||
{
|
||||
TimeZoneInfo.FindSystemTimeZoneById ("N/A");
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
@@ -1158,6 +1158,22 @@ namespace MonoTests.System
|
||||
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset), "dst2End_with_dstOffset+baseUtcOffset#exact");
|
||||
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst2End_with_dstOffset+baseUtcOffset#after");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DTS_WithMinimalDate ()
|
||||
{
|
||||
TimeZoneInfo.TransitionTime startTransition, endTransition;
|
||||
startTransition = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 4, 0, 0),
|
||||
10, 2, DayOfWeek.Sunday);
|
||||
endTransition = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 3, 0, 0),
|
||||
3, 2, DayOfWeek.Sunday);
|
||||
|
||||
var ctz = TimeZoneInfo.CreateCustomTimeZone ("test", TimeSpan.FromHours (-5), "display", "sdisplay", "dst", new [] {
|
||||
TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (DateTime.MinValue, DateTime.MaxValue.Date, TimeSpan.FromHours (-1), startTransition, endTransition) });
|
||||
|
||||
var offset = ctz.GetUtcOffset (DateTime.MinValue);
|
||||
Assert.AreEqual (TimeSpan.FromHours (-5), offset); // TODO: Wrong it should be -6
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
|
||||
@@ -326,6 +326,16 @@ public class TimeZoneTest {
|
||||
Assert.IsTrue (tzi.SupportsDaylightSavingTime, "SupportsDaylightSavingTime");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OldEraToLocalTime ()
|
||||
{
|
||||
TimeSpan offset = TimeSpan.Zero;
|
||||
var dto = new DateTimeOffset (new DateTime (1900, 1, 1).Ticks, offset);
|
||||
|
||||
// Should never throw
|
||||
dto.ToLocalTime ();
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
// On device we cannot read the OS file system to look for /etc/localtime
|
||||
// and /usr/share/zoneinfo - so we must initialize the BCL TimeZoneInfo
|
||||
|
||||
@@ -456,6 +456,65 @@ namespace MonoTests.System
|
||||
|
||||
}
|
||||
|
||||
class GetProperties_Overrides_Input
|
||||
{
|
||||
public class TestClass : BaseClass<object>
|
||||
{
|
||||
public override object TestProperty { get; set; }
|
||||
}
|
||||
|
||||
public abstract class BaseClass<T>
|
||||
{
|
||||
public virtual T TestProperty { get; set; }
|
||||
}
|
||||
|
||||
public class TestClass_Indexer : BaseClass_Indexer<object>
|
||||
{
|
||||
public override object this[int arg] { set { } }
|
||||
}
|
||||
|
||||
public abstract class BaseClass_Indexer<T>
|
||||
{
|
||||
public virtual T this[int arg] { set { } }
|
||||
}
|
||||
|
||||
public interface IB : IA<object>
|
||||
{
|
||||
new object TestProperty { get; set; }
|
||||
}
|
||||
|
||||
public interface IA<T>
|
||||
{
|
||||
T TestProperty { get; set; }
|
||||
}
|
||||
|
||||
public class TestClass_HiddenProperty : BaseClass_HiddenProperty
|
||||
{
|
||||
public new virtual string Prop { set { } }
|
||||
}
|
||||
|
||||
public class BaseClass_HiddenProperty
|
||||
{
|
||||
public virtual string Prop { set { } }
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetProperties_Overrides ()
|
||||
{
|
||||
Assert.AreEqual (1, typeof (GetProperties_Overrides_Input.IB).GetProperties().Length);
|
||||
|
||||
var prop = typeof (GetProperties_Overrides_Input.TestClass).GetProperty ("TestProperty");
|
||||
Assert.AreEqual (typeof (GetProperties_Overrides_Input.TestClass), prop.DeclaringType);
|
||||
|
||||
var prop_2 = typeof (GetProperties_Overrides_Input.TestClass_HiddenProperty).GetProperty ("Prop");
|
||||
Assert.AreEqual (typeof (GetProperties_Overrides_Input.TestClass_HiddenProperty), prop_2.DeclaringType);
|
||||
|
||||
Assert.AreEqual (1, typeof (GetProperties_Overrides_Input.TestClass).GetProperties().Length);
|
||||
Assert.AreEqual (1, typeof (GetProperties_Overrides_Input.TestClass_Indexer).GetProperties().Length);
|
||||
Assert.AreEqual (1, typeof (GetProperties_Overrides_Input.TestClass_HiddenProperty).GetProperties().Length);
|
||||
}
|
||||
|
||||
[Test] // GetProperties (BindingFlags)
|
||||
public void GetProperties_Flags ()
|
||||
{
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
System/Object.cs
|
||||
System/ValueType.cs
|
||||
System/Enum.cs
|
||||
System/Delegate.cs
|
||||
System/MulticastDelegate.cs
|
||||
System.Runtime.CompilerServices/RuntimeHelpers.cs
|
||||
System/Decimal.cs
|
||||
System/DecimalFormatter.cs
|
||||
File renamed without changes.
@@ -0,0 +1,53 @@
|
||||
#include monodroid_corlib_test.dll.new-exclude.sources
|
||||
Microsoft.Win32/RegistryKeyTest.cs
|
||||
System/ActivatorCas.cs
|
||||
System/AppDomainCas.cs
|
||||
System/BadImageFormatExceptionCas.cs
|
||||
System/ConsoleCas.cs
|
||||
System.Diagnostics/StackFrameCas.cs
|
||||
System.Diagnostics/StackTraceCas.cs
|
||||
System/EnvironmentCas.cs
|
||||
System/ExceptionCas.cs
|
||||
System.IO/DirectoryCas.cs
|
||||
System.IO/FileLoadExceptionCas.cs
|
||||
System.IO/FileNotFoundExceptionCas.cs
|
||||
System.IO/FileStreamCas.cs
|
||||
System.IO.IsolatedStorage/IsolatedStorageFileCas.cs
|
||||
System.IO.IsolatedStorage/IsolatedStorageFileStreamCas.cs
|
||||
System.IO/PathCas.cs
|
||||
System.IO/StreamCas.cs
|
||||
System/MarshalByRefObjectCas.cs
|
||||
System.Reflection/AssemblyCas.cs
|
||||
System.Reflection/AssemblyNameCas.cs
|
||||
System.Reflection.Emit/MethodRentalCas.cs
|
||||
System.Reflection/ModuleCas.cs
|
||||
System.Reflection/StrongNameKeyPairCas.cs
|
||||
System.Reflection/VisibilityTest.cs
|
||||
System.Resources/ResourceReaderCas.cs
|
||||
System.Resources/ResourceSetCas.cs
|
||||
System.Runtime.CompilerServices/RuntimeWrappedExceptionCas.cs
|
||||
System.Runtime.InteropServices/RuntimeEnvironmentCas.cs
|
||||
System/RuntimeMethodHandleCas.cs
|
||||
System.Runtime.Serialization.Formatters.Binary/BinaryFormatterCas.cs
|
||||
System.Runtime.Versioning/ResourceConsumptionAttributeCas.cs
|
||||
System.Runtime.Versioning/ResourceExposureAttributeCas.cs
|
||||
System.Runtime.Versioning/VersioningHelperCas.cs
|
||||
System.Security.AccessControl/DirectorySecurityTest.cs
|
||||
System.Security.AccessControl/EventWaitHandleSecurityTest.cs
|
||||
System.Security.AccessControl/FileSecurityTest.cs
|
||||
System.Security/CodeAccessPermissionCas.cs
|
||||
System.Security.Cryptography/CryptoAPITransformCas.cs
|
||||
System.Security.Cryptography/CryptoConfigCas.cs
|
||||
System.Security.Cryptography.X509Certificates/X509CertificateCas.cs
|
||||
System.Security/PermissionSetCas.cs
|
||||
System.Security.Policy/ApplicationSecurityManagerCas.cs
|
||||
System.Security/SecureStringCas.cs
|
||||
System.Security/SecurityContextCas.cs
|
||||
System.Security/SecurityExceptionCas.cs
|
||||
System.Security/SecurityManagerCas.cs
|
||||
System.Threading/CompressedStackCas.cs
|
||||
System.Threading/ExecutionContextCas.cs
|
||||
System.Threading/MutexCas.cs
|
||||
System.Threading/ThreadCas.cs
|
||||
System.Threading/WaitHandleCas.cs
|
||||
System/TypedReferenceCas.cs
|
||||
@@ -0,0 +1,28 @@
|
||||
System/DateTimeOffsetTestCoreFx.cs
|
||||
System.Diagnostics.Contracts/ContractAssertTest.cs
|
||||
System.Diagnostics.Contracts/ContractCollectionMethodsTest.cs
|
||||
System.Diagnostics.Contracts/ContractHelperTest.cs
|
||||
System.Diagnostics.Contracts/ContractMustUseRewriterTest.cs
|
||||
System.IO/DirectoryTest.cs
|
||||
System.Reflection.Emit/MethodBuilderTestIL.cs
|
||||
System.Security.AccessControl/AuthorizationRuleTest.cs
|
||||
System.Security.AccessControl/CommonAceTest.cs
|
||||
System.Security.AccessControl/CommonAclTest.cs
|
||||
System.Security.AccessControl/CommonObjectSecurityTest.cs
|
||||
System.Security.AccessControl/CommonSecurityDescriptorTest.cs
|
||||
System.Security.AccessControl/CryptoKeyAccessRuleTest.cs
|
||||
System.Security.AccessControl/DirectoryObjectSecurityTest.cs
|
||||
System.Security.AccessControl/DiscretionaryAclTest.cs
|
||||
System.Security.AccessControl/MutexAccessRuleTest.cs
|
||||
System.Security.AccessControl/MutexSecurityTest.cs
|
||||
System.Security.AccessControl/ObjectAceTest.cs
|
||||
System.Security.AccessControl/ObjectSecurityTest.cs
|
||||
System.Security.AccessControl/ObjectSecurity_TTest.cs
|
||||
System.Security.AccessControl/RawAclTest.cs
|
||||
System.Security.AccessControl/RawSecurityDescriptorTest.cs
|
||||
System.Security.AccessControl/RegistrySecurityTest.cs
|
||||
System.Security.AccessControl/SystemAclTest.cs
|
||||
System.Security.Claims/ClaimsIdentityTest.cs
|
||||
System.Security.Claims/ClaimsPrincipalTest.cs
|
||||
System.Security/CodeAccessPermissionTest.cs
|
||||
System/TimeZoneTest.cs
|
||||
@@ -0,0 +1 @@
|
||||
#include corlib_test.dll.sources
|
||||
@@ -37,7 +37,7 @@ namespace System.Windows.Forms
|
||||
/// </devdoc>
|
||||
internal static class SecurityUtils {
|
||||
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
private static volatile ReflectionPermission memberAccessPermission = null;
|
||||
private static volatile ReflectionPermission restrictedMemberAccessPermission = null;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace System.Windows.Forms
|
||||
#endif
|
||||
|
||||
private static void DemandReflectionAccess(Type type) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
try {
|
||||
MemberAccessPermission.Demand();
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace System.Windows.Forms
|
||||
|
||||
[SecuritySafeCritical]
|
||||
private static void DemandGrantSet(Assembly assembly) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
PermissionSet targetGrantSet = assembly.PermissionSet;
|
||||
targetGrantSet.AddPermission(RestrictedMemberAccessPermission);
|
||||
targetGrantSet.Demand();
|
||||
@@ -82,7 +82,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
private static bool HasReflectionPermission(Type type) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
try {
|
||||
DemandReflectionAccess(type);
|
||||
return true;
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace System.Xml.Xsl.XsltOld {
|
||||
// The World of Compile
|
||||
//
|
||||
internal void Compile(NavigatorInput input, XmlResolver xmlResolver, Evidence evidence) {
|
||||
#if DISABLE_CAS_USE
|
||||
#if !FEATURE_MONO_CAS
|
||||
evidence = null;
|
||||
#endif
|
||||
Debug.Assert(input != null);
|
||||
|
||||
@@ -2125,7 +2125,7 @@ namespace System.Data.Common {
|
||||
[ResourceExposure(ResourceScope.Machine)]
|
||||
[ResourceConsumption(ResourceScope.Machine)]
|
||||
static internal Stream GetFileStream(string filename) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
(new FileIOPermission(FileIOPermissionAccess.Read, filename)).Assert();
|
||||
try {
|
||||
return new FileStream(filename,FileMode.Open,FileAccess.Read,FileShare.Read);
|
||||
@@ -2141,7 +2141,7 @@ namespace System.Data.Common {
|
||||
[ResourceExposure(ResourceScope.Machine)]
|
||||
[ResourceConsumption(ResourceScope.Machine)]
|
||||
static internal FileVersionInfo GetVersionInfo(string filename) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
(new FileIOPermission(FileIOPermissionAccess.Read, filename)).Assert(); // MDAC 62038
|
||||
try {
|
||||
return FileVersionInfo.GetVersionInfo(filename); // MDAC 60411
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace System.Data {
|
||||
internal class XMLSchema {
|
||||
|
||||
internal static TypeConverter GetConverter(Type type) {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
HostProtectionAttribute protAttrib = new HostProtectionAttribute();
|
||||
protAttrib.SharedState = true;
|
||||
CodeAccessPermission permission = (CodeAccessPermission)protAttrib.CreatePermission();
|
||||
@@ -32,7 +32,7 @@ namespace System.Data {
|
||||
return TypeDescriptor.GetConverter(type);
|
||||
}
|
||||
finally {
|
||||
#if !DISABLE_CAS_USE
|
||||
#if FEATURE_MONO_CAS
|
||||
CodeAccessPermission.RevertAssert();
|
||||
#endif
|
||||
}
|
||||
|
||||
Loaded 100 of 227 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user