Compare commits

...
126 Commits
Author SHA1 Message Date
Jb Evain c74e612279 [runtime] Fix the CLI_FLAGS_PREFERRED32BIT value 2016-07-08 07:24:28 +02:00
Jb Evain 5d8d728709 [runtime] Fix the CLI Header flags check 2016-07-08 07:24:17 +02:00
Henric Müller 1ba6b7920b Fix for lock release in SynchronizationAttribute
* Making sure ownerThread is not nulled unless lockCount is zero.
* Fixed so Locked property checks lockCount when determining if locked
   instead of _locked field which was never set.
* Added test for setting Locked property.
* Added test capturing the original issue.
2016-07-08 07:22:47 +02:00
Zoltan Varga 69db8dd538 [jit] Emit memory barriers for volatile STFLD opcodes. Fixes #42413. 2016-07-08 07:20:11 +02:00
Aleksey Kliger (λgeek) cbd0f8dae6 [profiler] Actually link against libmono where necessary (#3232)
Previously $(LIBMONO) was empty and bitcode targets (which set
-no-undefined) had linker errors.
2016-07-07 06:45:59 +02:00
Alexander Köplinger ae2e58faa4 [System] Bump timeout in TimerTest a bit
I saw this failing occasionally on iOS on Wrench:

```
[FAIL] TimerTest.AutoResetEventFalseStopsFiringElapsed :   #2 wrong elapsedCount
  Expected: 1
  But was:  0

	at MonoTests.System.Timers.TimerTest.AutoResetEventFalseStopsFiringElapsed () [0x00091] in /Users/builder/data/lanes/1411/b07703ed/source/xamarin-macios/external/mono/mcs/class/System/Test/System.Timers/TimerTest.cs:327
	at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
	at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1411/b07703ed/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```
2016-07-07 06:45:36 +02:00
Zoltan Varga d6d9b1ae83 [bcl] Fix a random failure in a DataView test which happened because DataViewListener keeps a weak reference on the DataView and stops raising events if the view is GCd. Fixes #41035. 2016-07-05 16:30:50 -04:00
Andi McClure ab8a3912c0 Switch Android GC bridge default from new-bridge to tarjan-bridge 2016-07-05 13:29:58 -04:00
Zoltan Varga 7b7d32bedc [runtime] Abort the finalizer thread first instead of stopping it, to allow an orderly shutdown and to avoid hitting the 'finalizer_thread_exited' assert. Hopefully fixes #41833. (#3233) 2016-07-02 20:25:06 -04:00
Marcos Henrich c887be36d2 [System.Web.Services] Fixes bad XmlMapping.Key.
Fixes #41564

Calling xmlImporter.ImportMembersMapping would set the key with the
underlying message type [1], thus if a service had remote calls using
the same types a key already exists exception would be thrown.

Furthermore reference source has special logic to set headers
XmlMappings key [2].

This pull request fixes the issue by overriding the XmlMappings.Key with
the values similar to those used in the reference source version.

[1] http://referencesource.microsoft.com/#System.Xml/System/Xml/Serialization/XmlMembersMapping.cs,28
[2] http://referencesource.microsoft.com/#System.Web.Services/System/Web/Services/Protocols/SoapReflector.cs,515
2016-07-05 11:56:55 +01:00
Marcos Henrich cdad88da7b [System.Web.Services] Test Header sharing issue.
Covers #41564

When multiple methods shared soap header a duplicate key exception would
be thrown.

This issue only occurs on XAMMAC and MOBILE where the non reference
source serializer is still used.
2016-07-05 11:56:55 +01:00
Marcos Henrich 0935e38357 [System] Fixes ConnectAsync UnhandledEx
Fixes #41616

ConnectAsyncCallback now throws an exception when called a second time.
ConnectAsync reuses SocketAsyncEventArgs in BeginConnect which
already updates its state and calls ConnectAsyncCallback.

The changes make sure that ConnectAsyncCallback no longer called on
ConnectAsync catch block, while the state is still updated with the
exception.
2016-07-05 10:54:49 +01:00
Marcos Henrich 0d5c493022 [System] Test Unhandled Ex on ConnectAsync
Covers #41616

Our console runner is currently swallowing this test unhandled
exceptions.

To make it test show the failure I had to set legacyUnhandledExceptionPolicy
to 0 in mcs/class/lib/net_4_x/nunit-console.exe.config

Then running we can observe the crash by running:
make -C mcs/class/System check TESTNAME=System.Net.Sockets.SocketTest.ConnectAsyncUnhandledEx

Other tests appear to crash with legacyUEP set to 0, while the runner
shows no errors.
2016-07-05 10:54:48 +01:00
Marek Safar 3a4ccc0796 [mcs] More tweaks in betterness improvements. Fixes #42057 2016-07-04 15:04:39 +02:00
Marek Safar fed6c32e36 [System.Numerics.Vectors] Update type forwarders 2016-07-04 12:40:26 +02:00
Marek Safar 2b87f361c2 [System.Numerics] Update .net 4.6 api 2016-07-04 11:32:51 +02:00
Vlad Brezae c1dd76aec2 [sgen] Speed up domain finalization at shutdown
When we cleanup the gc at shutdown, we no longer care about running the remaining finalizers so we set the suspend_finalizers flag. This flag skipped running the finalizers but we would still traverse and modify the sgen finalizer hashes (on an arm box this could take even longer than 1s and lead to finalizer_thread_exited assertion failure since it's over the 100ms limit).

Avoid traversing sgen finalization hashes as soon as we see that we are shutting down.
2016-07-02 00:32:57 +03:00
Vlad Brezae ab1ca6f689 [sgen] Make suspend_finalizers volatile
It is used for signaling on separate threads.
2016-07-02 00:32:17 +03:00
monojenkins 4de3932df4 Merge pull request #3228 from xmcclure/step-crash-4.5.1
Restore debugger step-over NULL check 4.5.1

Backport PR #3219
2016-06-30 23:25:12 +01:00
Zoltan Varga 00bb13f6a5 [jit] Avoid emitting seq points inside alloc wrappers, they contain critical regions, and if thread self suspend in the seq point handler, it cannot be suspended by other threads. Fixes #42191. 2016-06-30 17:40:47 -04:00
Andi McClure c38a877b2e Restore NULL check which PR #3040/#3105 mistakenly removed (bug 41623)
Could cause crash while stepping over in SDB.
2016-06-30 12:44:46 -04:00
Alexander Kyte c55c4a72d8 [bcl] Remove cosmetic target that always triggers a rebuild (#3180) 2016-06-30 04:15:37 +02:00
Vlad Brezae 55c27b7f53 [utils] Fix retiring of live block for the lock free allocator
Freeing a block descriptor (along with the block) can happen either when freeing a pointer in the block (we do this in order to prevent situations where we need to wait for the next alloc in order to free a block), either when we acquire an empty block while allocating. Either way, in order to free a block descriptor, we need to acquire it first.

When freeing a slot in a block, we are checking if the block is now empty in which case we acquire the block descriptor in order to free it (along with the block). While doing so, we were failing to account for the case where, by the time we make the block descriptor empty and the time we acquire it, another thread would try to allocate from the same descriptor, see that it's empty, free it, allocate a new descriptor (which would happen to have the same address as the retired one) to fulfill the allocation and then set it as the active descriptor for the allocator. When the first thread finally acquires the descriptor, we need to double check that it is still empty since it might be logically a different descriptor than the one we actually freed from. In the unlikely case it's not empty, we need to put it back in the allocator's data structures.
2016-06-30 04:11:38 +02:00
Vlad Brezae 486b49025b [sgen] Use sgen_qsort instead of qsort (#3205)
qsort is not signal safe.
2016-06-30 04:08:52 +02:00
Zoltan Varga 845c8aed57 [bcl] Add a workaround for a watchos limitation to a memory mapped file test. Fixes #41747. 2016-06-30 04:08:19 +02:00
Alex Rønne Petersen 7fffb9c388 Revert "[profiler] Don't build shared libraries under bitcode."
This reverts commit cfd9870f83.

There is no need for this as of 79b99a989d8d4cf2636b738a623bb3656e048ebf.
2016-06-30 04:07:59 +02:00
Alex Rønne Petersen 30fb9e2618 [profiler] Link profiler libraries against libmono (revert of 92341a).
This caused issues with symbol resolution at runtime on Android and we haven't
seen any *actual* cases where linking against libmono caused problems.
2016-06-30 04:07:54 +02:00
Ludovic Henry 3581d0d32a [sgen] Use raw mutex for pin_queue_mutex as it's only used during a collection 2016-06-22 15:58:22 +02:00
Ludovic Henry b4f3a19ad8 [coop] Reuse local info variable for polling
This would lead to a crash when unregistering the thread from the currnt MonoThreadInfo* destructor, as `mono_thread_info_current_unchecked` would return NULL. This would trigger an infinite loop in `mono_threads_enter_gc_safe_region_unbalanced_with_info`.
2016-06-22 15:58:22 +02:00
Ludovic Henry ff4967bdf5 [marshal] Fix unused variable warning 2016-06-22 15:58:22 +02:00
Ludovic Henry 16db9f5d02 [threads] Make mono_thread_detach_if_exiting return if it detached 2016-06-22 15:58:22 +02:00
Ludovic Henry c620a32251 [coop] Use mono_thread_info_is_current in checked build 2016-06-22 15:58:22 +02:00
Ludovic Henry c2b27112b4 [coop] Remove unecessary assertion 2016-06-22 15:58:22 +02:00
Ludovic Henry 5d4a9b0207 [coop] Switch to GC unsafe state in SIGILL signal handler as it may throw an exception 2016-06-22 15:58:22 +02:00
Ludovic Henry b0d8d4ef4e [runtine] We should always ignore SIGPIPE signal 2016-06-22 15:58:22 +02:00
Ludovic Henry 3b834d2a46 [coop] Ensure GC unsafe state when throwing exception 2016-06-22 15:58:22 +02:00
Ludovic Henry 098b1bdddb [coop] Switch to GC safe around pthread_join 2016-06-22 15:58:22 +02:00
Ludovic Henry 8ce2b6b548 [coop] Do not pass current thread to mono_threads_enter_gc_unsafe_region_cookie 2016-06-22 15:58:22 +02:00
Ludovic Henry 00698f7408 [coop] Fix state transition when unregistering the thread
unregister_thread is the destructor for the current MonoThreadInfo* TLS key, meaning that when in this function, calling mono_thread_info_current_unchecked will always return NULL.
2016-06-22 15:58:22 +02:00
Ludovic Henry 9a9caf7494 [coop] Make GC safe/unsafe unbalanced transitions public
This is needed by Xamarin.iOS for unbalanced transitions, for example aroung a ObjC @throw.
2016-06-22 15:58:22 +02:00
Ludovic Henry 143c6c2209 [coop] Do not include mono-threads-coop.h and mono-threads-api.h in mono-threads.h
This leads to circular dependency between them, while mono-threads.h does not depends on the other 2.
2016-06-22 15:58:22 +02:00
Ludovic Henry c6f235cd88 [coop] Do not allow transition on not-attached, not-current and not-live thread 2016-06-22 15:58:22 +02:00
Ludovic Henry c8e62dada8 [coop] Remove unecessary GC unsafe transition 2016-06-22 15:58:22 +02:00
Ludovic Henry 6d20855af2 [marshal] Fix setting of last error for P/Invoke
On Unix, errno value might change between the native call and the call to mono_marshal_set_last_error, if we exit the gc safe region. We need to ensure that it's done right after the native call.
2016-06-22 15:58:22 +02:00
Ludovic Henry c3af5bc992 [checked-build] Fix warning 2016-06-22 15:58:22 +02:00
Ludovic Henry 2ada13b646 [coop] Remove DoneBlockingAborted state transition
This state transition would only be possible in case something went wrong. It's better to fix where this issue comes from.
2016-06-22 15:58:22 +02:00
Marek Habersack 44c5a48b97 Don't run the ping test on certain Android devices
As described in https://bugzilla.xamarin.com/show_bug.cgi?id=34883 at
least Samsung SG3 doesn't allow access to the local network
interface (in fact, even ifconfig doesn't work on the device). Therefore
the test needs to be disabled on those devices. This is the first part
of the fix, the second one will be implemented in Xamarin.Android test
suite which will provide the AndroidShouldPingWork method which will
check the device id against list of those that do not work for this
test.

Part #1 of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=34883
2016-06-22 14:48:37 +02:00
Marek Safar 8ec4b50c19 [System] Overwrite Console encoding to match mcs text output for CodeDOM compiler. Fixes #41979 2016-06-21 19:46:43 +02:00
Alexander Köplinger 7450e5985f [tools] Fix mozroots URL for Mozilla's certdata.txt and add deprecation warning
MXR is not coming back (see https://bugzilla.mozilla.org/show_bug.cgi?id=1279952 and https://github.com/SuaveIO/mono-script-buildpack/issues/9#issuecomment-226749314)
and this broke everyone who still relied on mozroots. Fix by using the version from the hg repository instead.

Starting from Mono 3.12 we've been shipping cert-sync to import CA certificates from the local computer trust store to Mono's trust store,
we strongly encourage everyone to move to that instead. Added a deprecation warning to mozroots to further strengthen this message.

Note that when fetching the CA list over the new https URL we need to skip cert validation errors, as the common use case for mozroots is when
no certs are present on the system (bootstrapping). This enables MITM but we don't really have any other options. Another reason why cert-sync is superior.

(cherry picked from commit e8bd8e656d)
2016-06-21 17:18:52 +02:00
Marek Safar 49fbaad9d3 [System] Update IPInterfaceProperties initialization on windows. Fixes #41897 2016-06-21 15:57:26 +02:00
Marek Safar 567eead66e [corlib] Add range check for minimal date in dst calculation. Fixes #41667 2016-06-21 15:17:17 +02:00
Marek Safar ed6134ef61 [reflection] Improves 1a820fcdc0 to do vslot match as optimization only 2016-06-20 13:43:41 +02:00
Marek Safar a314396709 [System.Web] Fixes SkinID property declaration 2016-06-20 12:48:30 +02:00
Marek Safar 3b4b25dadc [reflection] Properties always use name and signature hidding rules. Fixes #41874 2016-06-20 12:48:17 +02:00
Zoltan Varga 765d709d24 [llvm] Fix the allocation of vregs for the OP_MIN/MAX opcodes. Fixes #41947. 2016-06-17 17:27:19 -04:00
Marek Safar 42c253731a [bcl] Make mono cas opt-in features instead of opt-out for mobile profiles 2016-06-17 21:23:31 +02:00
Marek Safar a5d2e11456 [System] Put back handling of direct ip addresses to ServicePoint::HostEntry (removed in 932359f3d6). Fixes #41782 2016-06-16 17:46:50 +02:00
Zoltan Varga 8a2fd1e276 [llvm] Add suport for OP_OBJC_GET_SELECTOR, not enabled yet. 2016-06-15 16:05:38 -04:00
Zoltan Varga c044190b79 [runtime] Fix the printing of unhandled exceptions in coop. 2016-06-14 17:45:36 -04:00
Alexander Köplinger 65c1997913 [utils] Work around CLOCK_MONOTONIC being defined on macOS 10.12 SDK despite targeting earlier releases
Should fix https://bugzilla.xamarin.com/show_bug.cgi?id=41786

(cherry picked from commit b821c8e33c)
2016-06-14 19:08:53 +02:00
Marek Safar 856aa24078 [System] Fixes crash during implicit file uri parsing with unicode characters 2016-06-13 17:22:35 +02:00
Sebastien Pouliot bd693bbc41 [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null (#3141)
* [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null

This aligns the handler with the managed HttpClientHandler [1] and make
it easier to switch between them without additional or conditional code.

[1] https://github.com/mono/mono/blob/14f8acced5bbb2f6d55fb3e7800382700bcc65eb/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L97
2016-06-11 14:42:38 -04:00
Marek Safar 9c4da07fc1 [mscorlib] Better handling of unix timezones which have offset not specified in whole minutes. Fixes #41492 2016-06-10 21:54:16 +02:00
Mike Voorhees d27243324f Fix recursive property call in MonoSslStreamImpl
(cherry picked from commit ef0c4d2c1b)
2016-06-10 21:12:38 +02:00
Alexander Köplinger 6f824e0b6f [tests] Bump timeout in sleep.exe
We're seeing it randomly fail on Wrench with durations of 1550 - 1800ms.
Talked to Zoltan, this might be normal so bumping the timeout to reduce the failure rate.

(cherry picked from commit 0fa5f5fb4f)
2016-06-10 16:33:10 +02:00
Alexander Köplinger e3da710362 [System] Fix HttpListenerRequestTest.HttpRequestIsLocal intermittently failing
We're seeing the following exception on devices in CI:

```
[FAIL] HttpListenerRequestTest.HttpRequestIsLocal : System.Net.Sockets.SocketException : Could not resolve host 'XQA-AppleTV-1'
	  at System.Net.Dns.Error_11001 (System.String hostName) [0x00000] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:292
	  at System.Net.Dns.GetHostByName (System.String hostName) [0x00024] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:419
	  at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00061] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:380
	  at System.Net.Dns.GetHostAddresses (System.String hostNameOrAddress) [0x00065] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/Dns.cs:406
	  at MonoTests.System.Net.HttpListenerRequestTest.HttpRequestIsLocal () [0x00006] in /Users/xamarinqa/QABot/data/lanes/2441/d8287824/source/xamarin-macios/external/mono/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs:197
	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/1381/d8287824/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```

From looking at the code, resolving the hostname to IP addresses via DNS fails so the test doesn't even run.
We don't care where the local IPs come from so we can use an alternative way of getting them - via querying the network interfaces.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41671

PS: fixed a hardcoded port while I was touching the code
(cherry picked from commit 0178821e50)
2016-06-10 14:23:40 +02:00
Marek Safar cc612cb4d0 [System] Read all values of unknown/uncommon headers with multiple entries. Fixes #41552 2016-06-10 13:00:47 +02:00
Alex Rønne Petersen dd63bc4cda [profiler] Don't install the coverage suppression file if the profiler is disabled. 2016-06-10 10:48:00 +02:00
Alex Rønne Petersen c8c225f066 [profiler] Don't run the test suite when the profiler is disabled.
Also clean up the makefile logic surrounding tests a bit.
2016-06-10 10:47:55 +02:00
Zoltan Varga 6e3d2eb291 [llvm] Enable support for the atomic store intrinsics when running with llvmonly. 2016-06-10 10:46:49 +02:00
Alex Rønne Petersen a12ee3f98d [arm] Correctly detect hardware features when running as arm32 on arm64 hardware. 2016-06-10 10:46:16 +02:00
Marcos Henrich feba93a5de [runtime] Fixed interruptible wapi_sendfile part2.
Fixed issue where underlying system without HAVE_SENDFILE
would not interrupt while sending a file even when the socket was
set as a non blocking one.
2016-06-10 10:45:43 +02:00
Rodrigo Kumpera 9958261a8a [sgen] Inform on configure and --version when the concurrent GC is the default. 2016-06-09 13:48:18 -07:00
Vlad Brezae 8db00dcc40 [sgen] Don't try to stop a stopped world
On domain unload we were calling sgen_perform_collection even though we had a stopped world, when finishing a running concurrent collection.
2016-06-09 23:15:47 +03:00
Vlad Brezae b7c654d26d [sgen] Exit the critical section also on the slowpath of managed allocators
We were not exiting the critical section on this code path. This was leading to hangs at stw since the native code would take locks when compiling the code.
2016-06-09 23:15:28 +03:00
Marek Safar 3002249dab [mcs] Add probing conversion for FormattableString. Fixes #41575 2016-06-09 17:57:01 +02:00
Alexander Köplinger 840801ecb9 [System] Make ServicePointTest.DnsRefreshTimeout test more reliable
We are still seeing quite rare failures of this test:

```
HostEntry should result in the same IPHostEntry object.
  Expected: same as <System.Net.IPHostEntry>
  But was:  <System.Net.IPHostEntry>

+++++++++++++++++++
STACK TRACE:
at MonoTests.System.Net.ServicePointTest.DnsRefreshTimeout () [0x00045] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net/ServicePointTest.cs:228
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
```

Since the test is only checking if expiring of the cached DNS lookup works, we don't really need to use an external domain name for this
as "localhost" works just fine as well and typically doesn't trigger a DNS query which makes the test more reliable against network issues.

(cherry picked from commit ea4ad81185)
2016-06-09 15:39:27 +02:00
Marek Safar 4a655c66f7 [mcs] Recognize indexer with accessors using different names. Fixes #41602 2016-06-09 15:00:23 +02:00
Alexander Köplinger f4a3cbdaed [test-runner] Write stdout/stderr into StringBuilder instead of an intermediate file
We don't need to write out and then read back in the contents. Additionally, this will prevent
an unhandled exception we've seen on Jenkins due:

```
Unhandled Exception:
System.IO.IOException: Sharing violation on path /media/ssd/jenkins/workspace/test-mono-mainline-linux/label/debian-8-arm64/mono/tests/finalizer-wait.exe.stdout
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x7f7eb4a740 + 0x00650> in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) <0x7f7eb4a620 + 0x00053> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) <0x7f7e9b2170 + 0x000f3> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) <0x7f7e9b2120 + 0x00037> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) <0x7f7e9b2040 + 0x0003b> in <filename unknown>:0
  at System.IO.StreamReader..ctor (System.String path) <0x7f7e9b2010 + 0x0001f> in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.ReadAllText (System.String path) <0x7f7eb48c70 + 0x0003b> in <filename unknown>:0
  at TestRunner.DumpPseudoTrace (System.String filename) <0x7f7cfc6450 + 0x00023> in <filename unknown>:0
  at TestRunner.Main (System.String[] args) <0x7f8128b770 + 0x01ed3> in <filename unknown>:0
```

(cherry picked from commit 0d88c053bf)
2016-06-09 04:17:10 +02:00
Alexander Köplinger e8b9107c3f [test-runner] Print timeout value when test times out
This is useful when multiple timeouts are in place e.g. like in the runtime testsuite.

(cherry picked from commit 6c74957217)
2016-06-09 04:17:07 +02:00
Rodrigo Kumpera edec9a54af Packaging bump. 2016-06-08 18:19:13 -07:00
Rolf Bjarne Kvinge 5ac529a182 [corlib] Fix tests for watchOS. (#3130) 2016-06-08 17:01:22 -04:00
Alex Rønne Petersen d6c6e7b6de [sockets] Correctly report that Linux supports double binding for UDP, even on old kernels.
Conflicts:

	mcs/class/corlib/System/Environment.cs
	mono/metadata/appdomain.c
2016-06-08 18:17:36 +02:00
Alex Rønne Petersen 48cc848a43 [System] Make SocketAsyncTest.SendAsync give more helpful failures. 2016-06-08 18:05:41 +02:00
Alex Rønne Petersen d8e3d0e959 [Socket] Check for SocketOptionLevel.Socket before checking for SocketOptionName.ReuseAddress.
Without doing this, the check would consider a valid option name like
IpTimeToLive to be the same as ReuseAddress, as they share the same enum
value.

Fixes SocketTest.TtlChange and SocketTest.UdpMulticasTimeToLive on Android and
other platforms that don't support ReuseAddress.
2016-06-08 18:05:31 +02:00
Marcos Henrich 6b97b22c3b [runtime] Fixed interruptible wapi_sendfile.
Before closing a socket we try to interrupt and wait for all socket
pending system calls to return. For that we set the socket as non
blocking which makes the system calls to return with EAGAIN\EWOULDBLOCK.

This issue was caught by System.Net.Sockets.SocketTest.SendAsyncFile
that was intermittently failing, we were only able to reproduce it while
running multiple test suites in parallel. We now can say that it only failed when
the the socket was closed and the sendfile was waiting for the OS to
allocate enough resources to send the file.

This was fixed by changing wapi_sendfile to return on EAGAIN.
2016-06-08 15:00:17 +01:00
Marcos Henrich a33fb26f89 [System] Improved "Could not abort" exception.
Stack traces of blocked threads are now displayed on the exception.

The threads stacktraces are only stored when MONO_TESTS_IN_PROGRESS env
var is set to yes.
2016-06-08 15:00:16 +01:00
Marek Safar 6767d24b3f [mcs] Improve betterness changes in b12385e9fd 2016-06-08 15:27:42 +02:00
Alexander Köplinger 1301b2697c [System] Make TimerTest.EnabledInElapsed more reliable
We were seeing intermittent failures on devices like:

```
	[FAIL] TimerTest.EnabledInElapsed :   #1 loss of events
  Expected: True
  But was:  False

		  at MonoTests.System.Timers.TimerTest.EnabledInElapsed () <0x33b168 + 0x0014f> in <filename unknown>:0
		  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
		  at System.Reflection.MonoMethod.Invoke (System.Object , BindingFlags , System.Reflection.Binder , System.Object[] , System.Globalization.CultureInfo ) <0x66d400 + 0x000b7> in <filename unknown>:0
```

Since OS scheduling and GCs can influence the exact timing of the timer intervals sleeping for 200ms is likely just too short.
Instead of bumping the timeout, I decided to rewrite the test to not rely on Thread.Sleep ().
I also added another test which verifies setting AutoResetEvent=false stops the timer event from firing after the first one,
which was implicitly tested before by the other test.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41530

(cherry picked from commit bab393e095)
2016-06-08 12:48:42 +02:00
Vlad Brezae 0453803999 [sgen] Fix define argument
The code worked by accident because the function in which the define was expanded had an argument with the name desc.
2016-06-08 02:01:14 +03:00
Vlad Brezae c59dc39170 [sgen] Fix race between complex descriptor allocation and complex object scanning
When we allocate the complex descriptor for a new type we might have the concurrent marker scan objects. While the concurrent marker scans the bitmap for a complex object, which resides in the complex_descriptor array, another thread might allocate a new complex descriptor, thus reallocate the complex_descriptor array, which would lead to corruption of the bitmap used by the concurrent marker.

We reuse the SgenArrayList which never reallocates, using instead a list of exponentially increasing arrays.
2016-06-08 02:00:59 +03:00
Vlad Brezae 0c9216e5a4 [sgen] Make sure we will scan the bits correctly for complex objects 2016-06-08 02:00:43 +03:00
Vlad Brezae 4ef57bc080 [sgen] Add missing memory type description 2016-06-08 02:00:29 +03:00
Alexander Kyte b728d181e0 [runtime] Add environment variable to pass additional configure options 2016-06-07 15:48:22 -07:00
Alexander Kyte 06ec2cc12e [runtime] Add new configure option for default sgen GC mode 2016-06-07 15:48:08 -07:00
Alex Rønne Petersen e0789c921c [sgen] Remove a pointless memory barrier from the middle of the managed allocator.
This appears to serve no purpose as tlab_next is a thread-local variable. It's
only ever accessed by other threads in order to write to it, not read it. We
also don't do this memory barrier in the native allocation functions.
2016-06-07 00:51:20 +02:00
Zoltan Varga a35eef3a6a [offsets-tool] Generate offsets for SgenClientThreadInfo. 2016-06-06 16:48:59 -04:00
Zoltan Varga 726c4a3f18 [jit] Fix the emission of Selector.GetHandle () implementation to avoid the creation of string objects, which could cause GCs don't work in a cross compiler. Fixes #41431. 2016-06-06 13:22:57 -04:00
Marek Safar c0025d2188 [System] Override SupportsHeaders in all WebResponse overrides 2016-06-06 17:00:26 +02:00
Alex Rønne Petersen 745f4356c2 [arm] Don't emit memory barriers for relaxed atomic loads/stores. 2016-06-06 15:54:47 +02:00
Alex Rønne Petersen f5c88fb0fc [sgen] Cache the SgenThreadInfo pointer in a local when emitting managed allocators. 2016-06-06 15:54:41 +02:00
Alex Rønne Petersen e7e3420219 [gc] Register a critical region when executing managed allocators.
Previously, if we stopped a thread and it had a stack looking like this:

    ...
    profiler_signal_handler
    <signal handler called>
    managed_allocator
    ...

We would fail to identify the fact that we've just interrupted a thread that's
in a managed allocator (uninterruptible code) because we only look at the very
latest instruction pointer of the thread, which will be pointing into
profiler_signal_handler or some other function called by it. So we would
happily continue along with the STW process and proceed to doing the actual GC,
where we would see a broken heap.

We could solve this by unwinding the stack and checking all frames, but that's
complicated and error-prone. Instead, register a critical region while the
managed allocator. This way, if we don't identify it by instruction pointer, we
will identify it by the fact that the thread is in a critical region.
2016-06-06 15:54:36 +02:00
Alex Rønne Petersen b1ee8a55ff [System] Add back IWebProxyScript to the mobile profile. 2016-06-06 15:53:27 +02:00
Alex Rønne Petersen 13038ab9eb [bcl] Avoid ObjectDisposedException in EndPointListener.
This fixes a regression introduced in 123aaa5db0.
We would sometimes see an ObjectDisposedException when calling AcceptAsync ()
because that patch removed the try-catch around it.

(cherry picked from commit d9fc8f866a)
2016-06-05 21:46:01 +02:00
Alexander Köplinger 7192da2671 Revert "Revert "handles AwaitAsync finishing synchronously""
This reverts commit c88dea2f39.

The underlying issue was fixed by https://github.com/mono/mono/pull/3096
2016-06-05 21:46:01 +02:00
Andi McClure a8c94d1d17 Debugger step recursive 4.5.1 (#3105)
* Debugger stepping does not understand recursion (bug 38025)

Testing with the debugger showed multiple failures around recursive
functions:

1. Step-out breakpoints can trigger on inner frames.
Solution: Extend existing inner-frame test from step-over to step out
also.

2. "Same source line, continuing" test triggers even on wrong frame
   (affects both step over and step out)
Solution: Check frame as part of this test

3. When step breakpoints pick next sequence points, they can register
   multiple breakpoints at the same place if a recursive call happens to
   exit there. (Possibly harmless but may have resulted in duplicate
   debugger events being generated in one test.)
Solution: Check for duplicates in step-request breakpoint list before
adding new breakpoints

4. Mono.Debugging.Soft in the debugger-libs repo sometimes resumes
   after breakpoints if it decides Mono.Debugger.Soft has not stepped
   far enough, but the check to trigger this was not recursion-aware.
Solution: This one is not addressed in this commit, but a fix was
checked in to debugger-libs. Any code using this commit therefore
needs to be run in conjunction with debugger-libs dfbf6d8b13.

Tests were also added for issues 1-3 above.

* Fixes for peer feedback on recursive step patch

Made breakpoint uniqueness test switch to a hash after 8th item added,
consolidated the code that handles the uniqueness test and makes the
breakpoint in one function, fixed style issues.

* Halve the stack depth for both the new single step tests
2016-06-04 05:03:47 -04:00
Rodrigo Kumpera cd7496d658 [sgen] Make the serial collector the default on desktop until the known crashers get fixed. 2016-06-03 12:29:58 -07:00
Marek Safar 0d21061d41 [corlib] Fixes mobile tests 2016-06-02 14:41:17 +02:00
Marek Safar 150fa242fb Merge pull request #3098 from rolfbjarne/mono-api-info-compare-generic-method-parameters-4.5.1
[mono-api-info] Take number of generic parameters into account when comparing methods.
2016-06-02 13:11:32 +02:00
Rolf Bjarne Kvinge fe1a1784f4 [mono-api-info] Take number of generic parameters into account when comparing methods. 2016-06-02 12:10:33 +02:00
Zoltan Varga ae9f1d7f7a [arm] Return structures with sizes up to 16 bytes in int registers on watchos. Fixes #41393. 2016-06-02 06:04:54 -04:00
Alex Rønne Petersen c88dea2f39 Revert "handles AwaitAsync finishing synchronously"
This reverts commit 123aaa5db0.

This causes an ObjectDisposedException in the monodroid test suites.
2016-06-02 11:14:16 +02:00
Matthew Brophy e06fe98fa0 Add missing type forwarder for System.Diagnostics.Tracing.EventSourceSettings. ASP.net Core 1.0 RC2 apps will not run against mono without this. 2016-06-02 10:01:52 +02:00
Marek Safar 3ebd1cfd57 [corlib] Disable even more cas in mobile 2016-06-01 23:36:07 +02:00
Marek Habersack c937b46879 Xamarin.Android test suite updates
Xamarin.Android internal test suite takes advantage of the BCL tests
in Mono, so far their inclusion was a manual process and this commit
fixes it. A set of source inclusion and exclusion lists is added
and a handful of code fixes to make them compile on Xamarin.Android
2016-06-01 20:37:02 +02:00
Marcos Henrich b05d49ffaa [System] Fixes socket async exception.
SendAsyncFile uses StartSocketServer to start a server and at the same
time begins to accept a client socket. The issue is that when
the accept callback is called SendAsyncFile already closed the socket.

Fixed race condition by moving StartSocketServer and ReceiveCallback
logic into SendAsyncFile, and by using a new MRE to ensure that the
client receives all the data before the server is closed.

Fixes #41264

(cherry picked from commit 0693884580)
2016-06-01 18:30:01 +02:00
Alexander Köplinger 1b8ba5d892 [build] Make exclusion filename consistent between library and test
The test assembly used *.dll.excludes before while the library uses *.dll.exclude.sources.
Make this consistent to reduce confusion.

Also remove corlib_cmp.dll.excludes which is from a profile that no longer exists.

(cherry picked from commit 87b1150070)
2016-06-01 18:29:14 +02:00
Marek Safar e07d3c2fe3 [corlib] Disable more CAS code 2016-06-01 18:02:23 +02:00
Marek Safar 87033ea0ac [mcs] Adjust correctly newline counter inside pragma warning 2016-06-01 10:03:44 +02:00
Zoltan Varga 9df06f7f5d [arm] Pass structures larger than 16 bytes by ref on watchos. Fixes #41393. 2016-06-01 03:29:45 -04:00
Vlad Brezae f3106df8ba [sgen] Enable concurrent major by default on desktop platforms 2016-05-31 13:59:13 -07:00
Marek Safar 2c9e57560e [mcs] Add more of undocumented C#6 improved overload resolution 2016-05-31 18:41:51 +02:00
Alexander Köplinger 9ecc046d41 [WindowsBase] Fix off-by-one error in ZipTime
The date/time struct in zip.h defines the month value as

    uInt tm_mon;            /* months since January - [0,11] */

.NET's DateTime object in turn stores months from 1-12. We didn't
take this into account when passing the values from managed->native
so the month ended up being off by one.

We didn't use this codepath before https://github.com/mono/mono/pull/3036
that's why it didn't show up until now.

(cherry picked from commit 07baa1cce4)
2016-05-31 16:09:30 +02:00
Marek Safar 0c9641f7dc [System] Keep broken api in mobile profiles only 2016-05-31 10:07:44 +02:00
Alexander Köplinger e35814198d [ci] Bump timeout in runtime test step
We were seeing timeouts in the runtime step if two builds happen to be scheduled
at the exact same time on the ARM workers on Jenkins, causing increased load and
longer test times. They aborted the runtime step right before it'd finish.

Bump the timeout a bit to avoid this.
2016-05-31 07:06:34 +02:00
Zoltan Varga 48e3e32add [bcl] Comment out a win32 pinvoke on the mobile profile, since ios can't have unresolvable pinvokes. 2016-05-30 23:15:11 -04:00
227 changed files with 2899 additions and 740 deletions

No files matched your search

+3 -1
View File
@@ -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
View File
@@ -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)
+1 -1
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
-1
View File
@@ -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) \
-1
View File
@@ -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 \
-1
View File
@@ -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 \
+1 -1
View File
@@ -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
-1
View File
@@ -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 \
+1 -1
View File
@@ -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);
+272
View File
@@ -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
@@ -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
@@ -0,0 +1,2 @@
#include monodroid_System.ComponentModel.DataAnnotations_test.dll.new-exclude.sources
../../System.Web.DynamicData/Test/Common/AssertExtensions.cs
@@ -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
@@ -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
@@ -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]
@@ -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))]
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -4
View File
@@ -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);
}
@@ -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
}
}
}
@@ -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)
+24 -8
View File
@@ -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
+8
View File
@@ -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
@@ -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);
}
}
}
}
+2 -2
View File
@@ -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
}
}
+1 -1
View File
@@ -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)]
+21 -5
View File
@@ -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
@@ -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
+59
View File
@@ -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 ()
{
-8
View File
@@ -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
@@ -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