Compare commits

..
Author SHA1 Message Date
Rodrigo Kumpera bcc380d6ba [runtime] Instrument mono_domain_alloc 2014-09-16 18:16:47 -04:00
Rodrigo Kumpera 8516f578ee [runtime] Instrument image and image set mempool allocation. 2014-09-16 16:58:17 -04:00
Rodrigo Kumpera feaa6e19fb [runtime] Implement runtime valloc reporting. 2014-09-08 19:24:31 -04:00
Rodrigo Kumpera e8953e705c Properly name all sgen_alloc_os_memory. 2014-09-08 17:12:58 -04:00
Rodrigo Kumpera 130f08e943 Add reporting to jitinfo. 2014-09-08 17:11:11 -04:00
Rodrigo Kumpera 89558be055 [runtime] Finish metadata reporting. 2014-09-08 16:55:45 -04:00
Rodrigo Kumpera f2c8417122 [runtime] Proposed implementation of the memory profiler.
To get a small taste of it in action run the following program with it:

sing System;
using System.Net;
using System.Runtime.InteropServices;
using System.Linq;

public class Test
{
	[DllImport ("__Internal")]
	public static extern void mono_memprof_dump ();

	static int MethodThatDoesLinq () {
		int[] x = new[] { 1,2,3,4};
		var k = x.Where (_ => _ <= 100).Select (_ => _ + 1);
		int r = 0;
		foreach (var v in k)
			r += v;
		return r;
	}
	public static void Main ()
	{
		mono_memprof_dump ();
		MethodThatDoesLinq ();
		Console.WriteLine ("----------------------");
		mono_memprof_dump ();
	}
}
2014-09-08 02:27:09 -04:00
656 changed files with 22171 additions and 14770 deletions

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ When contributing to the Mono project, please follow the [Mono Coding
Guidelines][1]. We have been using a coding style for many years,
please make your patches conform to these guidelines.
[1] http://www.mono-project.com/community/contributing/coding-guidelines/
[1] http://www.mono-project.com/Coding_Guidelines
Etiquette
=========
@@ -68,7 +68,7 @@ status of your pull request. If it succeeded and we like the changes,
a maintainer will likely merge it. Otherwise, you can amend your pull
request to fix build breakage and Jenkins will test it again.
[2] http://jenkins.mono-project.com/
[2] http://monojenkins.cloudapp.net
# Inactivity
+4
View File
@@ -494,12 +494,16 @@ Directory Roadmap
* `dis/` - CIL executable Disassembler
* `cli/` - Common code for the JIT and the interpreter.
* `io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
* `cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
* `interp/` - Interpreter for CLI executables (obsolete).
* `arch/` - Architecture specific portions.
* `man/` - Manual pages for the various Mono commands and programs.
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
-98
View File
@@ -1,98 +0,0 @@
#
# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
#
# For further details see http://www.appveyor.com
#
# Use 'unstable' Appveyor build worker image as Appveyor have added Cygwin to this for us
os: Unstable
#
# Custom environment variables
#
environment:
global:
CYG_ROOT: C:/cygwin
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: C:/cygwin/var/cache/setup
NSIS_ROOT: C:\nsis
#
# Initialisation prior to pulling the Mono repository
#
init:
- 'echo Building Mono for Windows'
- 'echo System architecture: %PLATFORM%'
- 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
- 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
- 'git config --global core.autocrlf input'
#
# Install needed build dependencies
#
install:
# NOTE: Already installed on current Appveyor unstable image
# - 'echo Retrieving Cygwin'
# - 'appveyor DownloadFile http://cygwin.com/setup-x86.exe -FileName %CYGROOT%/setup-x86.exe'
- 'echo Setting up Cygwin dependencies'
- '%CYG_ROOT%\setup-x86.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl > NUL'
- 'echo Check Cygwin setup'
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
- 'echo Done setting up Cygwin'
- 'echo Retrieving NSIS'
- 'appveyor DownloadFile "http://sunet.dl.sourceforge.net/project/nsis/NSIS 2/2.46/nsis-2.46-setup.exe" -FileName nsissetup.exe'
- 'echo Setting up NSIS'
- 'nsissetup.exe /S /D=%NSIS_ROOT%'
- 'echo Done setting up NSIS'
#
# NOTE: msbuild doesn't work at present so use Cygwin to build
#
#build:
# project: C:\projects\mono\msvc\mono.sln
# verbosity: detailed
# Cygwin build script
#
# NOTES:
#
# The stdin/stdout file descriptor appears not to be valid for the Appveyor
# build which causes failures as certain functions attempt to redirect
# default file handles. Ensure a dummy file descriptor is opened with exec.
#
build_script:
- cmd: 'echo Cygwin root is: %CYG_ROOT%'
- cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
- cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
- cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
- cmd: 'echo Autogen running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; NOCONFIGURE=1 ./autogen.sh --prefix=/usr/local --with-preview=yes"'
- cmd: 'echo Configure running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./configure --host=i686-pc-mingw32"'
- cmd: 'echo Pulling monolite latest...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
- cmd: 'echo Make running...'
- cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make"'
- cmd: 'echo Installing...'
- cmd: 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
- cmd: '%CYG_ROOT%/bin/bash --login -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
# - cmd: 'echo Building package...'
# - cmd: 'cd %APPVEYOR_BUILD_FOLDER%'
# - cmd: '%NSIS_ROOT%\makensis /DMILESTONE=%APPVEYOR_REPO_BRANCH% /DSOURCE_INSTALL_DIR=%APPVEYOR_BUILD_FOLDER\install\*.* /DBUILDNUM=%APPVEYOR_BUILD_VERSION% monowiz.win32.nsi'
# - cmd: 'Building distribution...'
# - cmd: '%CYG_ROOT%/bin/bash -lc "export CYGWIN=winsymlinks:native; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make dist"'
#
# Disable tests for now
#
test: off
#
# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
# It has to be relative to the project path. Thus we have installed to within the build tree.
#
artifacts:
- path: install
name: mono-binaries
type: zip
+56 -26
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [3.12.0],
AC_INIT(mono, [3.10.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -115,9 +115,9 @@ case "$host" in
AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
fi
HOST_CC="gcc"
# Windows XP SP2 is required
# Windows 2000 is required that includes Internet Explorer 5.01
CPPFLAGS="$CPPFLAGS -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 -liphlpapi"
LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32"
libmono_cflags="-mms-bitfields -mwindows"
libmono_ldflags="-mms-bitfields -mwindows"
libdl=
@@ -767,7 +767,7 @@ DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying, shared_handles.],
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -941,11 +941,6 @@ if test "x$mono_feature_disable_sgen_copying" = "xyes"; then
AC_MSG_NOTICE([Disabled major=copying support in SGEN.])
fi
if test "x$mono_feature_disable_shared_handles" = "xyes"; then
AC_DEFINE(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles])
AC_SUBST(DISABLE_SHARED_HANDLES)
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
@@ -1199,7 +1194,7 @@ if test x$target_win32 = xno; then
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_HEADERS(sys/auxv.h sys/resource.h)
AC_CHECK_HEADERS(sys/auxv.h)
AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
@@ -1218,7 +1213,6 @@ if test x$target_win32 = xno; then
AC_CHECK_FUNCS(dl_iterate_phdr)
AC_CHECK_FUNCS(dladdr)
AC_CHECK_FUNCS(sysconf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(sched_setaffinity)
AC_CHECK_FUNCS(sched_getcpu)
@@ -2288,7 +2282,6 @@ if test "x$ac_cv_have_dev_random" = "xno" \
fi
AC_MSG_CHECKING([if inter-process shared handles are requested])
# Same as --enable-minimal=shared_handles
AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
AC_MSG_RESULT($try_shared_handles)
if test "x$try_shared_handles" != "xyes"; then
@@ -2505,6 +2498,8 @@ AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes])
TARGET="unknown"
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=no
INTERP_SUPPORTED=no
LIBC="libc.so.6"
INTL="libc.so.6"
SQLITE="libsqlite.so.0"
@@ -2517,6 +2512,7 @@ XINERAMA="libXinerama.so.1"
sizeof_register="SIZEOF_VOID_P"
jit_wanted=true
interp_wanted=false
sgen_supported=false
boehm_supported=true
case "$host" in
@@ -2525,6 +2521,7 @@ case "$host" in
arch_target=mips;
sgen_supported=true
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
AC_MSG_CHECKING(for mips n32)
AC_TRY_COMPILE([],[
@@ -2542,6 +2539,7 @@ case "$host" in
i*86-*-*)
TARGET=X86;
arch_target=x86;
JIT_SUPPORTED=yes
case $host_os in
solaris*)
LIBC="libc.so"
@@ -2587,6 +2585,7 @@ case "$host" in
x86_64-*-* | amd64-*-*)
TARGET=AMD64;
arch_target=amd64;
JIT_SUPPORTED=yes
if test "x$ac_cv_sizeof_void_p" = "x4"; then
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
@@ -2618,6 +2617,7 @@ case "$host" in
TARGET=IA64
arch_target=ia64
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
LIBC="libc.so.6.1"
INTL="libc.so.6.1"
AC_CHECK_LIB(unwind, _U_dyn_register, [], [AC_MSG_ERROR(library libunwind not found)])
@@ -2630,6 +2630,7 @@ case "$host" in
TARGET=SPARC
fi
arch_target=sparc;
JIT_SUPPORTED=yes
ACCESS_UNALIGNED="no"
case $host_os in
linux*) ;;
@@ -2662,6 +2663,7 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
fi
arch_target=ppc;
JIT_SUPPORTED=yes
case $host_os in
linux*|darwin*)
sgen_supported=true
@@ -2672,6 +2674,7 @@ case "$host" in
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
sgen_supported=true
;;
@@ -2679,6 +2682,7 @@ case "$host" in
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
sgen_supported=true
AOT_SUPPORTED="yes"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
@@ -2688,6 +2692,7 @@ case "$host" in
# TARGET=ARM;
# arch_target=arm;
# ACCESS_UNALIGNED="no"
# JIT_SUPPORTED=yes
# sgen_supported=true
# AOT_SUPPORTED="no"
# ;;
@@ -2695,6 +2700,7 @@ case "$host" in
# https://lkml.org/lkml/2012/7/15/133
TARGET=ARM64
arch_target=arm64
JIT_SUPPORTED=yes
sgen_supported=true
boehm_supported=false
;;
@@ -2702,6 +2708,7 @@ case "$host" in
TARGET=S390X;
arch_target=s390x;
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=yes
sgen_supported=true
CFLAGS="$CFLAGS -mbackchain -D__USE_STRING_INLINES"
;;
@@ -2717,7 +2724,9 @@ if test "x$host" != "x$target"; then
TARGET=ARM;
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
@@ -2755,6 +2764,7 @@ if test "x$host" != "x$target"; then
# arch_target=arm
# AC_DEFINE(TARGET_ARM, 1, [...])
# ACCESS_UNALIGNED="no"
# JIT_SUPPORTED=yes
# sizeof_register=4
# CPPFLAGS="$CPPFLAGS \
# -D__ARM_EABI__ \
@@ -2764,6 +2774,7 @@ if test "x$host" != "x$target"; then
# -DDISABLE_SOCKETS \
# -DDISABLE_ATTACH \
# -DUSE_NEWLIB"
# jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
# with_tls=pthread
@@ -2780,7 +2791,9 @@ if test "x$host" != "x$target"; then
AC_DEFINE(TARGET_ARM, 1, [...])
AC_DEFINE(TARGET_ANDROID, 1, [...])
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
@@ -2795,20 +2808,10 @@ if test "x$host" != "x$target"; then
;;
esac
;;
i686*-linux-*)
TARGET=X86;
arch_target=x86;
AC_DEFINE(TARGET_X86, 1, [...])
AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
sgen_supported=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
;;
aarch64-*)
TARGET=ARM64
JIT_SUPPORTED=yes
jit_wanted=true
;;
*)
AC_MSG_ERROR([Cross compiling is not supported for target $target])
@@ -2931,7 +2934,27 @@ fi
AC_SUBST(SGEN_DEFINES)
AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
jit_status="Building and using the JIT"
USEJIT=false
if test x$JIT_SUPPORTED = xyes; then
if $jit_wanted; then
USEJIT=true
jit_status="Building and using the JIT"
else
if $interp_wanted; then
jit_status="Building the JIT, defaulting to the interpreter"
else
AC_ERROR(No JIT or interpreter support available or selected.)
fi
fi
else
if test x$interp_wanted = xtrue; then
jit_status="interpreter"
else
AC_ERROR(No JIT or interpreter support available or selected.)
fi
fi
AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
libsuffix=".so"
@@ -3334,6 +3357,8 @@ AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
AM_CONDITIONAL(INTERP_SUPPORTED, test x$interp_wanted = xtrue)
AM_CONDITIONAL(INCLUDED_LIBGC, test x$libgc = xincluded)
AC_SUBST(LIBC)
@@ -3353,7 +3378,11 @@ AC_SUBST(LDFLAGS)
mono_build_root=`pwd`
AC_SUBST(mono_build_root)
mono_runtime=mono/mini/mono
if test x$USEJIT = xtrue; then
mono_runtime=mono/mini/mono
else
mono_runtime=mono/interpreter/mint
fi
AC_SUBST(mono_runtime)
mono_cfg_root=$mono_build_root/runtime
@@ -3550,6 +3579,7 @@ mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/ia64/Makefile
mono/arch/mips/Makefile
mono/interpreter/Makefile
mono/tests/Makefile
mono/tests/tests-config
mono/tests/assemblyresolve/Makefile
+9
View File
@@ -26,8 +26,17 @@ else
SGENPCFILE=
endif
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mono-2.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
else
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
+1 -1
View File
@@ -10,7 +10,7 @@
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="@prefix@/@reloc_libdir@/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="MonoPosixHelper" target="@prefix@/lib/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
+1 -2
View File
@@ -135,7 +135,6 @@ AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
AC_CHECK_FUNCS(getrlimit)
#
# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
@@ -180,7 +179,7 @@ if test "x$have_iso_varargs" = "xyes"; then
fi
AC_SUBST(G_HAVE_ISO_VARARGS)
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h sys/resource.h)
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h)
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)
+8
View File
@@ -57,6 +57,14 @@ typedef struct {
Slot *slot;
} Iter;
size_t
mono_eg_hashtable_get_memory_size (GHashTable *hashtable)
{
return sizeof (GHashTable) +
hashtable->in_use * sizeof (Slot) +
hashtable->table_size * sizeof (Slot*);
}
static const guint prime_tbl[] = {
11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
+3
View File
@@ -176,6 +176,7 @@ typedef struct _GMemChunk GMemChunk;
/*
* Misc.
*/
#define g_atexit(func) ((void) atexit (func))
const gchar * g_getenv(const gchar *variable);
gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
@@ -466,6 +467,8 @@ guint g_spaced_primes_closest (guint x);
#define g_hash_table_insert(h,k,v) g_hash_table_insert_replace ((h),(k),(v),FALSE)
#define g_hash_table_replace(h,k,v) g_hash_table_insert_replace ((h),(k),(v),TRUE)
size_t mono_eg_hashtable_get_memory_size (GHashTable *hashtable);
gboolean g_direct_equal (gconstpointer v1, gconstpointer v2);
guint g_direct_hash (gconstpointer v1);
gboolean g_int_equal (gconstpointer v1, gconstpointer v2);
+1 -1
View File
@@ -176,7 +176,7 @@ default_stderr_handler (const gchar *message)
}
#elif defined(HOST_IOS)
#elif MONOTOUCH
#include <asl.h>
static int
+2 -23
View File
@@ -53,10 +53,6 @@
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef G_OS_WIN32
#include <io.h>
#include <winsock2.h>
@@ -217,23 +213,6 @@ write_all (int fd, const void *vbuf, size_t n)
return nwritten;
}
#ifndef G_OS_WIN32
static int
g_getdtablesize (void)
{
#ifdef HAVE_GETRLIMIT
struct rlimit limit;
int res;
res = getrlimit (RLIMIT_NOFILE, &limit);
g_assert (res == 0);
return limit.rlim_cur;
#else
return getdtablesize ();
#endif
}
#endif
gboolean
g_spawn_command_line_sync (const gchar *command_line,
gchar **standard_output,
@@ -277,7 +256,7 @@ g_spawn_command_line_sync (const gchar *command_line,
close (stderr_pipe [0]);
dup2 (stderr_pipe [1], STDERR_FILENO);
}
for (i = g_getdtablesize () - 1; i >= 3; i--)
for (i = getdtablesize () - 1; i >= 3; i--)
close (i);
/* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
@@ -438,7 +417,7 @@ g_spawn_async_with_pipes (const gchar *working_directory,
}
if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
for (i = g_getdtablesize () - 1; i >= 3; i--)
for (i = getdtablesize () - 1; i >= 3; i--)
close (i);
}
+1 -1
View File
@@ -26,7 +26,7 @@ i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-li
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
+13 -9
View File
@@ -1075,10 +1075,19 @@ first generation (of two). A larger nursery will usually speed up the
program but will obviously use more memory. The default nursery size
4 MB.
.TP
\fBmajor=\fIcollector\fR Specifies which major collector to use.
Options are `marksweep' for the Mark&Sweep collector, and
`marksweep-conc' for concurrent Mark&Sweep. The non-concurrent
Mark&Sweep collector is the default.
\fBmajor=\fIcollector\fR
Specifies which major collector to use. Options are `marksweep' for
the Mark&Sweep collector, `marksweep-conc' for concurrent Mark&Sweep,
`marksweep-par' for parallel Mark&Sweep, `marksweep-fixed' for
Mark&Sweep with a fixed heap, and `marksweep-fixed-par' for parallel
Mark&Sweep with a fixed heap. The Mark&Sweep collector is the default.
.TP
\fBmajor-heap-size=\fIsize\fR
Sets the size of the major heap (not including the large object space)
for the fixed-heap Mark&Sweep collector (i.e. `marksweep-fixed' and
`marksweep-fixed-par'). The size is in bytes, with optional suffixes
`k', `m' and `g' to specify kilo-, mega- and gigabytes, respectively.
The default is 512 megabytes.
.TP
\fBsoft-heap-limit=\fIsize\fR
Once the heap size gets larger than this size, ignore what the default
@@ -1257,11 +1266,6 @@ work, Mono needs to be compiled with the BINARY_PROTOCOL define on
sgen-gc.c. You can then use this command to explore the output
.nf
sgen-grep-binprot 0x1234 0x5678 < file
.TP
\fBnursery-canaries\fR
If set, objects allocated in the nursery are suffixed with a canary (guard)
word, which is checked on each minor collection. Can be used to detect/debug
heap corruption issues.
.fi
.ne
.RE
-2
View File
@@ -12,7 +12,6 @@ monotouch_SUBDIRS := build class
monotouch_runtime_SUBDIRS := build class
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
mobile_static_SUBDIRS := build class
net_3_5_SUBDIRS := build class tools/xbuild
net_4_0_SUBDIRS := build class
net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
@@ -115,7 +114,6 @@ $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%:
$(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--%
$(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--%
$(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--%
$(_boot_:%=profile-do--mobile_static--%): profile-do--mobile_static--%: profile-do--build--%
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--build--%
$(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--%
+1 -16
View File
@@ -12,22 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:MOBILE \
-d:MOBILE_DYNAMIC \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
+1 -18
View File
@@ -12,24 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:FULL_AOT_RUNTIME \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:FULL_AOT_RUNTIME -d:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
+1 -18
View File
@@ -12,24 +12,7 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:MOBILE_DYNAMIC \
-d:MONODROID \
-d:ANDROID \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MOBILE_DYNAMIC -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
+2 -20
View File
@@ -12,27 +12,9 @@ profile-check:
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MOBILE \
-d:MONOTOUCH \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-d:FULL_AOT_RUNTIME \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FULL_AOT_RUNTIME -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
NO_INSTALL = yes
NO_INSTALL = yes
@@ -107,7 +107,7 @@ namespace Commons.Xml.Relaxng.Rnc
public RelaxngPattern Parse (TextReader source, string baseUri, string defaultNamespace)
{
this.defaultNamespace = defaultNamespace ?? string.Empty;
this.defaultNamespace = defaultNamespace;
if (defaultNamespace != null && defaultNamespace.Length != 0)
nsmgr.AddNamespace (String.Empty, defaultNamespace);
try {
@@ -13,7 +13,7 @@ using System.Xml;
using Commons.Xml.Nvdl;
using NUnit.Framework;
namespace MonoTests.Commons.Xml.Relaxng
namespace MonoTests.Commons.Xml.Nvdl
{
[TestFixture]
public class NvdlValidatingReaderTests
@@ -95,19 +95,5 @@ start = mine";
r.Close ();
}
}
[Test]
public void SimpleDefaultNamespace ()
{
var g = RncParser.ParseRnc (new StringReader ("element e { empty }"));
var x = XmlReader.Create (new StringReader ("<e/>"));
var r = new RelaxngValidatingReader (x, g);
try {
while (!r.EOF)
r.Read ();
} finally {
r.Close ();
}
}
}
}
@@ -8,7 +8,7 @@ TEST_ARCHIVE = testSuite.zip
RNCTESTS = test/RNCTest.xml
RNCTEST_ARCHIVE = anglia-test-suite.zip
all : relaxngtest.exe #anglia-test-runner.exe
all : relaxngtest.exe anglia-test-runner.exe
relaxngtest.exe : relaxngtest.cs $(TESTS)
$(MCS_RUNTIME) $(MCS) -debug+ relaxngtest.cs -r:Commons.Xml.Relaxng.dll
@@ -40,7 +40,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.COMException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComMemberType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComSourceInterfacesAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComInterfaceType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STATSTG))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CriticalHandle))]
+19 -22
View File
@@ -106,7 +106,7 @@ net_2_0_only_dirs := \
pcl_facade_dirs := Facades
mobile_common_dirs := \
mobile_dirs := \
corlib \
System \
System.Core \
@@ -134,27 +134,19 @@ mobile_common_dirs := \
System.Net \
System.Windows \
System.Xml.Serialization \
Mono.CSharp \
Microsoft.CSharp \
$(pcl_facade_dirs)
mobile_static_dirs := \
$(mobile_common_dirs) \
Mono.Dynamic.Interpreter
mobile_dynamic_dirs := \
$(mobile_common_dirs) \
monodroid_dirs := \
Mono.CompilerServices.SymbolWriter \
Mono.CSharp \
Microsoft.CSharp \
System.Net.Http
xammac_dirs := \
$(mobile_dynamic_dirs)
monodroid_dirs := \
$(mobile_dynamic_dirs)
monotouch_dirs := \
$(mobile_static_dirs)
Mono.CompilerServices.SymbolWriter \
Mono.CSharp \
Microsoft.CSharp \
System.Net.Http
monotouch_runtime_dirs := \
corlib \
@@ -163,6 +155,11 @@ monotouch_runtime_dirs := \
System.XML \
Mono.CSharp
monotouch_dirs := \
Mono.CSharp \
Microsoft.CSharp \
Mono.Dynamic.Interpreter
net_4_0_dirs := \
System.Numerics \
Microsoft.CSharp \
@@ -232,12 +229,12 @@ xbuild_4_0_dirs := \
Microsoft.Build
net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler
monodroid_SUBDIRS := $(monodroid_dirs)
monotouch_SUBDIRS := $(monotouch_dirs)
monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
monotouch_SUBDIRS := $(mobile_dirs) $(monotouch_dirs)
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
mobile_static_SUBDIRS := $(mobile_static_dirs)
mobile_SUBDIRS := $(mobile_dynamic_dirs)
xammac_SUBDIRS := $(xammac_dirs)
mobile_static_SUBDIRS := $(mobile_dirs)
mobile_SUBDIRS := $(mobile_dirs)
xammac_SUBDIRS := $(mobile_dirs) $(xammac_dirs)
net_3_5_SUBDIRS := $(xbuild_2_0_dirs)
net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs)
net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler
@@ -245,7 +242,7 @@ xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
include ../build/rules.make
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs)
@@ -175,7 +175,7 @@ namespace System.Windows.Forms {
Rectangle text_rectangle;
Rectangle image_rectangle;
ThemeEngine.Current.CalculateButtonTextAndImageLayout (pevent.Graphics, this, out text_rectangle, out image_rectangle);
ThemeEngine.Current.CalculateButtonTextAndImageLayout (this, out text_rectangle, out image_rectangle);
// Draw our button
if (this.FlatStyle == FlatStyle.Standard)
@@ -3663,8 +3663,7 @@ namespace System.Windows.Forms
if (View != View.Details) {
if (bounds.Left < 0)
h_scroll.Value += bounds.Left;
// Don't shift right unless right-to-left layout is active. (Xamarin bug 22483)
else if (this.RightToLeftLayout && bounds.Right > view_rect.Right)
else if (bounds.Right > view_rect.Right)
h_scroll.Value += (bounds.Right - view_rect.Right);
}
@@ -258,19 +258,11 @@ namespace System.Windows.Forms
StringFormat sf = FlagsToStringFormat (flags);
Size retval;
int proposedWidth;
if (proposedSize.Width == 0)
proposedWidth = Int32.MaxValue;
else {
proposedWidth = proposedSize.Width;
if ((flags & TextFormatFlags.NoPadding) == 0)
proposedWidth -= 9;
}
if (dc is Graphics)
retval = (dc as Graphics).MeasureString (text, font, proposedWidth, sf).ToSize ();
retval = (dc as Graphics).MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
else
retval = TextRenderer.MeasureString (text, font, proposedWidth, sf).ToSize ();
retval = TextRenderer.MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
if (retval.Width > 0 && (flags & TextFormatFlags.NoPadding) == 0)
retval.Width += 9;
@@ -698,7 +698,7 @@ namespace System.Windows.Forms
#region Button
public abstract Size CalculateButtonAutoSize (Button button);
public abstract void CalculateButtonTextAndImageLayout (Graphics g, ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
public abstract void CalculateButtonTextAndImageLayout (ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
public abstract void DrawFlatButton (Graphics g, ButtonBase b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
@@ -364,23 +364,24 @@ namespace System.Windows.Forms
return ret_size;
}
public override void CalculateButtonTextAndImageLayout (Graphics g, ButtonBase button, out Rectangle textRectangle, out Rectangle imageRectangle)
public override void CalculateButtonTextAndImageLayout (ButtonBase button, out Rectangle textRectangle, out Rectangle imageRectangle)
{
Image image = button.Image;
string text = button.Text;
Rectangle content_rect = button.PaddingClientRectangle;
Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags | TextFormatFlags.NoPadding, button.UseCompatibleTextRendering);
Size text_size = TextRenderer.MeasureTextInternal (text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering);
Size image_size = image == null ? Size.Empty : image.Size;
textRectangle = Rectangle.Inflate (content_rect, -4, -4);
textRectangle = Rectangle.Empty;
imageRectangle = Rectangle.Empty;
switch (button.TextImageRelation) {
case TextImageRelation.Overlay:
// Overlay is easy, text always goes here
textRectangle = Rectangle.Inflate (content_rect, -4, -4);
if (button.Pressed)
textRectangle.Offset (1, 1);
if (button.Pressed)
textRectangle.Offset (1, 1);
// Image is dependent on ImageAlign
if (image == null)
@@ -437,16 +438,20 @@ namespace System.Windows.Forms
imageRectangle = new Rectangle (image_x, image_y, image_width, image_height);
break;
case TextImageRelation.ImageAboveText:
LayoutTextAboveOrBelowImage (textRectangle, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.TextAboveImage:
LayoutTextAboveOrBelowImage (textRectangle, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextAboveOrBelowImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.ImageBeforeText:
LayoutTextBeforeOrAfterImage (textRectangle, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextBeforeOrAfterImage (content_rect, false, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
case TextImageRelation.TextBeforeImage:
LayoutTextBeforeOrAfterImage (textRectangle, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
content_rect.Inflate (-4, -4);
LayoutTextBeforeOrAfterImage (content_rect, true, text_size, image_size, button.TextAlign, button.ImageAlign, out textRectangle, out imageRectangle);
break;
}
}
@@ -532,14 +537,12 @@ namespace System.Windows.Forms
offset += (int)(2 * (excess_height / 3));
if (textFirst) {
var textHeight = excess_height >= 0 ? totalArea.Height - imageSize.Height - element_spacing: textSize.Height;
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, totalArea.Top + offset, textSize.Width, textHeight);
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, totalArea.Top + offset, textSize.Width, textSize.Height);
final_image_rect = new Rectangle (AlignInRectangle (totalArea, imageSize, imageAlign).Left, final_text_rect.Bottom + element_spacing, imageSize.Width, imageSize.Height);
}
else {
final_image_rect = new Rectangle (AlignInRectangle (totalArea, imageSize, imageAlign).Left, totalArea.Top + offset, imageSize.Width, imageSize.Height);
var textHeight = excess_height >= 0 ? totalArea.Height - final_image_rect.Height : textSize.Height;
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, final_image_rect.Bottom + element_spacing, textSize.Width, textHeight);
final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, final_image_rect.Bottom + element_spacing, textSize.Width, textSize.Height);
if (final_text_rect.Bottom > totalArea.Bottom)
final_text_rect.Y = totalArea.Top;
@@ -1296,7 +1296,7 @@ namespace System.Windows.Forms {
buffer [i] = Marshal.ReadByte (prop, i);
Clipboard.Item = Encoding.UTF8.GetString (buffer);
} else if (property == UTF16_STRING) {
Clipboard.Item = Marshal.PtrToStringUni (prop);
Clipboard.Item = Marshal.PtrToStringUni (prop, Encoding.Unicode.GetMaxCharCount ((int)nitems));
} else if (property == RICHTEXTFORMAT)
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
else if (DataFormats.ContainsFormat (property.ToInt32 ())) {
@@ -1018,27 +1018,13 @@ namespace Microsoft.Build.BuildEngine
if (!StartHandlerHasExecuted)
return;
if (EventArgs is ProjectStartedEventArgs) {
var pfa = finished_args as ProjectFinishedEventArgs;
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (pfa == null)
return;
ConsoleLogger.ProjectFinishedHandler (Sender, pfa);
} else if (EventArgs is TargetStartedEventArgs) {
var fa = finished_args as TargetFinishedEventArgs;
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (fa == null)
return;
ConsoleLogger.TargetFinishedHandler (Sender, fa);
} else if (EventArgs is TaskStartedEventArgs) {
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
if (!(finished_args is TaskFinishedEventArgs))
return;
ConsoleLogger.TaskFinishedHandler (Sender, (TaskFinishedEventArgs) finished_args);
} else if (!(EventArgs is BuildStartedEventArgs))
if (EventArgs is ProjectStartedEventArgs)
ConsoleLogger.ProjectFinishedHandler (Sender, finished_args as ProjectFinishedEventArgs);
else if (EventArgs is TargetStartedEventArgs)
ConsoleLogger.TargetFinishedHandler (Sender, finished_args as TargetFinishedEventArgs);
else if (EventArgs is TaskStartedEventArgs)
ConsoleLogger.TaskFinishedHandler (Sender, finished_args as TaskFinishedEventArgs);
else if (!(EventArgs is BuildStartedEventArgs))
throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ());
}
}
@@ -99,12 +99,8 @@ namespace Microsoft.Build.BuildEngine {
try {
TaskExecutionMode taskExecutionMode;
string reason;
bool skip_completely;
if (!BuildTargetNeeded (out reason, out skip_completely)) {
if (!BuildTargetNeeded (out reason)) {
LogTargetSkipped (target, reason);
if (skip_completely)
return true;
taskExecutionMode = TaskExecutionMode.SkipAndSetOutput;
} else {
taskExecutionMode = TaskExecutionMode.Complete;
@@ -117,27 +113,8 @@ namespace Microsoft.Build.BuildEngine {
//FIXME: parsing attributes repeatedly
IBuildTask bt = target.BuildTasks [i];
// HACK: need some form of cross references checks
var tem = taskExecutionMode;
if (tem == TaskExecutionMode.SkipAndSetOutput) {
var bti = bt as BuildTask;
//
// BuildTargetNeeded checks only files timestamps but ignores any metadata dependencies
// that way we can end up in the situation when output metadata are populated but from
// incomplete dependencies.
//
// E.g.
// <CreateItem Include="$(IntermediateOutputPath)%(_PngImage.LogicalName)" AdditionalMetadata="LogicalName=%(_PngImage.LogicalName)">
// <Output TaskParameter="Include" />
// </CreateItem>
//
if (bti != null && bti.Name == "CreateItem")
tem = TaskExecutionMode.Complete;
}
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
bool task_result = batchingImpl.Build (bt, tem, out executeOnErrors);
bool task_result = batchingImpl.Build (bt, taskExecutionMode, out executeOnErrors);
if (task_result)
continue;
@@ -172,17 +149,15 @@ namespace Microsoft.Build.BuildEngine {
ParseAttribute (outputs);
}
bool BuildTargetNeeded (out string reason, out bool skipCompletely)
bool BuildTargetNeeded (out string reason)
{
reason = String.Empty;
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime youngestInput, oldestOutput;
skipCompletely = false;
if (String.IsNullOrEmpty (inputs.Trim ())) {
if (String.IsNullOrEmpty (inputs.Trim ()))
return true;
}
if (String.IsNullOrEmpty (outputs.Trim ())) {
project.ParentEngine.LogError ("Target {0} has inputs but no outputs specified.", name);
@@ -203,7 +178,6 @@ namespace Microsoft.Build.BuildEngine {
}
if (inputFiles == null || inputFiles.Length == 0) {
skipCompletely = true;
reason = String.Format ("No input files were specified for target {0}, skipping.", name);
return false;
}
@@ -112,7 +112,6 @@
<Compile Include="Microsoft.Build.BuildEngine\TaskBatchingImpl.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskDatabase.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskEngine.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskExecutionMode.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Token.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Toolset.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ToolsetCollection.cs" />
@@ -1,14 +1,12 @@
//
// ToolTask.cs: Base class for command line tool tasks.
//
// Authors:
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
// Marek Safar ([email protected])
//
// (C) 2005 Marek Sieradzki
// Copyright 2009 Novell, Inc (http://www.novell.com)
// Copyright 2014 Xamarin Inc
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -92,45 +90,12 @@ namespace Microsoft.Build.Utilities
return true;
}
string CreateToolPath ()
{
string tp;
if (string.IsNullOrEmpty (ToolPath)) {
tp = GenerateFullPathToTool ();
if (string.IsNullOrEmpty (tp))
return null;
//
// GenerateFullPathToTool can return path including tool name
//
if (string.IsNullOrEmpty (ToolExe))
return tp;
tp = Path.GetDirectoryName (tp);
} else {
tp = ToolPath;
}
var path = Path.Combine (tp, ToolExe);
if (!File.Exists (path)) {
if (Log != null)
Log.LogError ("Tool executable '{0}' could not be found", path);
return null;
}
return path;
}
public override bool Execute ()
{
if (SkipTaskExecution ())
return true;
var tool_path = CreateToolPath ();
if (tool_path == null)
return false;
exitCode = ExecuteTool (tool_path, GenerateResponseFileCommands (),
exitCode = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
GenerateCommandLineCommands ());
// HandleTaskExecutionErrors is called only if exitCode != 0
@@ -324,14 +289,14 @@ namespace Microsoft.Build.Utilities
protected virtual string GenerateCommandLineCommands ()
{
return "";
return null;
}
protected abstract string GenerateFullPathToTool ();
protected virtual string GenerateResponseFileCommands ()
{
return "";
return null;
}
protected virtual string GetResponseFileSwitch (string responseFilePath)
@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -425,53 +424,6 @@ namespace MonoTests.Microsoft.Build.Utilities {
Assert.AreEqual (a.ToolPath, "Bar", "#5");
a.ToolPath = "";
Assert.AreEqual (a.ToolPath, "", "#6");
a.Execute ();
}
[Test]
public void Execute_1 ()
{
var t = new TestExecuteToolTask ();
t.OnExecuteTool = delegate { Assert.Fail ("#1"); };
t.BuildEngine = new MockBuildEngine ();
Assert.IsFalse (t.Execute (), "result");
}
[Test]
public void Execute_2 ()
{
var t = new TestExecuteToolTask ();
t.BuildEngine = new MockBuildEngine ();
t.ToolPath = Directory.GetCurrentDirectory ();
t.ToolExe = "Makefile";
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
Assert.AreEqual (Path.Combine (Directory.GetCurrentDirectory (), "Makefile"), pathToTool, "#1");
Assert.AreEqual ("", responseFileCommands, "#2");
Assert.AreEqual ("", commandLineCommands, "#3");
};
Assert.IsTrue (t.Execute (), "result");
}
[Test]
public void Execute_3 ()
{
var t = new TestExecuteToolTask ();
t.FullPathToTool = "fpt";
t.BuildEngine = new MockBuildEngine ();
t.ToolExe = "Makefile.mk";
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
Assert.AreEqual ("Makefile.mk", pathToTool, "#1");
Assert.AreEqual ("", responseFileCommands, "#2");
Assert.AreEqual ("", commandLineCommands, "#3");
};
Assert.IsFalse (t.Execute (), "result");
}
}
@@ -596,86 +548,9 @@ namespace MonoTests.Microsoft.Build.Utilities {
}
protected override string GenerateFullPathToTool ()
{
return "";
}
}
class MockBuildEngine : IBuildEngine
{
public int ColumnNumberOfTaskNode {
get {
return 0;
}
}
public bool ContinueOnError {
get {
throw new NotImplementedException ();
}
}
public int LineNumberOfTaskNode {
get {
return 0;
}
}
public string ProjectFileOfTaskNode {
get {
return "ProjectFileOfTaskNode";
}
}
public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs)
{
throw new NotImplementedException ();
}
public void LogCustomEvent (CustomBuildEventArgs e)
{
}
public void LogErrorEvent (BuildErrorEventArgs e)
{
Console.WriteLine (e.Message);
}
public void LogMessageEvent (BuildMessageEventArgs e)
{
}
public void LogWarningEvent (BuildWarningEventArgs e)
{
}
}
class TestExecuteToolTask : ToolTask
{
public Action<string, string, string> OnExecuteTool;
public string FullPathToTool;
protected override string ToolName {
get { return "TestTool.exe"; }
}
protected override bool CallHostObjectToExecute ()
{
return base.CallHostObjectToExecute ();
}
protected override string GenerateFullPathToTool ()
{
return FullPathToTool;
}
protected override int ExecuteTool (string pathToTool, string responseFileCommands, string commandLineCommands)
{
if (OnExecuteTool != null)
OnExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
return 0;
}
}
}
+1 -3
View File
@@ -6,9 +6,7 @@ LIBRARY = Mono.CSharp.dll
LIB_MCS_FLAGS = -r:System.Core.dll -r:System.Xml.dll -r:System.dll
MOBILE_STATIC := $(filter mobile_static monotouch, $(PROFILE))
ifdef MOBILE_STATIC
ifeq (monotouch, $(PROFILE))
LIB_MCS_FLAGS += -d:IOS_REFLECTION
endif
@@ -1,13 +0,0 @@
#include Mono.CSharp.dll.sources
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
../corlib/System.Reflection.Emit/FlowControl.cs
../corlib/System.Reflection.Emit/OpCode.cs
../corlib/System.Reflection.Emit/OpCodeNames.cs
../corlib/System.Reflection.Emit/OpCodes.cs
../corlib/System.Reflection.Emit/OpCodeType.cs
../corlib/System.Reflection.Emit/OperandType.cs
../corlib/System.Reflection.Emit/PEFileKinds.cs
../corlib/System.Reflection.Emit/Label.cs
../corlib/System.Reflection.Emit/MethodToken.cs
../corlib/System.Reflection.Emit/StackBehaviour.cs
monotouch.cs
@@ -1,2 +1,13 @@
#include mobile_static_Mono.CSharp.dll.sources
monotouch.cs
#include Mono.CSharp.dll.sources
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
../corlib/System.Reflection.Emit/FlowControl.cs
../corlib/System.Reflection.Emit/OpCode.cs
../corlib/System.Reflection.Emit/OpCodeNames.cs
../corlib/System.Reflection.Emit/OpCodes.cs
../corlib/System.Reflection.Emit/OpCodeType.cs
../corlib/System.Reflection.Emit/OperandType.cs
../corlib/System.Reflection.Emit/PEFileKinds.cs
../corlib/System.Reflection.Emit/Label.cs
../corlib/System.Reflection.Emit/MethodToken.cs
../corlib/System.Reflection.Emit/StackBehaviour.cs
monotouch.cs
@@ -41,9 +41,7 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Net.Sockets;
using System.Globalization;
using System.Security;
using System.Text;
using System.Runtime.InteropServices;
namespace Mono.Data.Tds.Protocol
{
@@ -1470,7 +1468,7 @@ namespace Mono.Data.Tds.Protocol
t3.Domain = this.connectionParms.DefaultDomain;
t3.Host = this.connectionParms.Hostname;
t3.Username = this.connectionParms.User;
t3.Password = GetPlainPassword(this.connectionParms.Password);
t3.Password = this.connectionParms.Password;
Comm.StartPacket (TdsPacketType.SspAuth); // 0x11
Comm.Append (t3.GetBytes ());
@@ -1921,20 +1919,6 @@ namespace Mono.Data.Tds.Protocol
comm.Skip(4);
}
public static string GetPlainPassword(SecureString secPass)
{
IntPtr plainString = IntPtr.Zero;
try
{
plainString = Marshal.SecureStringToGlobalAllocUnicode(secPass);
return Marshal.PtrToStringUni(plainString);
}
finally
{
Marshal.ZeroFreeGlobalAllocUnicode(plainString);
}
}
#endregion // Private Methods
#if NET_2_0
@@ -29,7 +29,6 @@
//
using System;
using System.Security;
namespace Mono.Data.Tds.Protocol {
public sealed class Tds42 : Tds
@@ -78,7 +77,7 @@ namespace Mono.Data.Tds.Protocol {
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// password (offset 62 0x3e)
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
tmp = Comm.Append (connectionParameters.Password, 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
@@ -146,7 +145,7 @@ namespace Mono.Data.Tds.Protocol {
// remote passwords
Comm.Append (empty, 2, pad);
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
tmp = Comm.Append (connectionParameters.Password, 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
@@ -31,7 +31,6 @@
using Mono.Data.Tds;
using System;
using System.Text;
using System.Security;
namespace Mono.Data.Tds.Protocol
{
@@ -119,7 +118,7 @@ namespace Mono.Data.Tds.Protocol
// password (offset 62 0x3e)
// 62-92
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
tmp = Comm.Append (connectionParameters.Password, 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
@@ -188,7 +187,7 @@ namespace Mono.Data.Tds.Protocol
// remote passwords
// 202-457
Comm.Append (empty, 2, pad);
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
tmp = Comm.Append (connectionParameters.Password, 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
@@ -37,7 +37,6 @@
using System;
using System.Globalization;
using System.Text;
using System.Security;
using Mono.Security.Protocol.Ntlm;
@@ -393,12 +392,11 @@ namespace Mono.Data.Tds.Protocol
return IsConnected;
}
private static string EncryptPassword (SecureString secPass)
private static string EncryptPassword (string pass)
{
int xormask = 0x5a5a;
int len = secPass.Length;
int len = pass.Length;
char[] chars = new char[len];
string pass = GetPlainPassword(secPass);
for (int i = 0; i < len; ++i) {
int c = ((int) (pass[i])) ^ xormask;
@@ -489,19 +487,6 @@ namespace Mono.Data.Tds.Protocol
Comm.Append ((byte) 0x00); // no param meta data name
Comm.Append ((byte) 0x00); // no status flags
// Convert BigNVarChar values larger than 4000 chars to nvarchar(max)
// Need to do this here so WritePreparedParameterInfo emit the
// correct data type
foreach (TdsMetaParameter param2 in parameters) {
var colType = param2.GetMetaType ();
if (colType == TdsColumnType.BigNVarChar) {
int size = param2.GetActualSize ();
if ((size >> 1) > 4000)
param2.Size = -1;
}
}
// Write sql as a parameter value - UCS2
TdsMetaParameter param = new TdsMetaParameter ("sql",
@@ -31,7 +31,6 @@
//
using System;
using System.Security;
namespace Mono.Data.Tds.Protocol
{
@@ -43,8 +42,7 @@ namespace Mono.Data.Tds.Protocol
public string Hostname;
public string Language;
public string LibraryName;
public SecureString Password;
public bool PasswordSet;
public string Password;
public string ProgName;
public string User;
public bool DomainLogin;
@@ -64,8 +62,7 @@ namespace Mono.Data.Tds.Protocol
Hostname = System.Net.Dns.GetHostName();
Language = String.Empty;
LibraryName = "Mono";
Password = new SecureString();
PasswordSet = false;
Password = String.Empty;
ProgName = "Mono";
User = String.Empty;
DomainLogin = false;
+2 -2
View File
@@ -27,11 +27,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace MonoTests.Mono.Data.Tds
namespace bug4786test
{
using NUnit.Framework;
using global::Mono.Data.Tds.Protocol;
using Mono.Data.Tds.Protocol;
using System;
using System.Net;
using System.Net.Sockets;
@@ -155,12 +155,11 @@ namespace Mono.Debugger.Soft
[Flags]
enum InvokeFlags {
NONE = 0,
DISABLE_BREAKPOINTS = 1,
SINGLE_THREADED = 2,
OUT_THIS = 4,
OUT_ARGS = 8,
VIRTUAL = 16,
NONE = 0x0,
DISABLE_BREAKPOINTS = 0x1,
SINGLE_THREADED = 0x2,
OUT_THIS = 0x4,
OUT_ARGS = 0x8,
}
enum ElementType {
@@ -417,7 +416,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 38;
internal const int MINOR_VERSION = 35;
enum WPSuspendPolicy {
NONE = 0,
@@ -585,8 +584,7 @@ namespace Mono.Debugger.Soft
enum CmdStackFrame {
GET_VALUES = 1,
GET_THIS = 2,
SET_VALUES = 3,
GET_DOMAIN = 4,
SET_VALUES = 3
}
enum CmdArrayRef {
@@ -2379,10 +2377,6 @@ namespace Mono.Debugger.Soft
SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values));
}
internal long StackFrame_GetDomain (long thread_id, long id) {
return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
}
/*
* ARRAYS
*/
@@ -22,11 +22,6 @@ namespace Mono.Debugger.Soft
/*
* Return the values of out arguments
*/
ReturnOutArgs = 8,
/*
* Do a virtual invoke
* Since protocol version 2.37
*/
Virtual = 16
ReturnOutArgs = 8
}
}
@@ -307,8 +307,6 @@ namespace Mono.Debugger.Soft
f |= InvokeFlags.OUT_THIS;
if ((options & InvokeOptions.ReturnOutArgs) != 0)
f |= InvokeFlags.OUT_ARGS;
if ((options & InvokeOptions.Virtual) != 0)
f |= InvokeFlags.VIRTUAL;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
thread.InvalidateFrames ();
@@ -7,7 +7,6 @@ namespace Mono.Debugger.Soft
public class StackFrame : Mirror
{
ThreadMirror thread;
AppDomainMirror domain;
MethodMirror method;
int il_offset;
Location location;
@@ -33,16 +32,6 @@ namespace Mono.Debugger.Soft
}
}
public AppDomainMirror Domain {
get {
vm.CheckProtocolVersion (2, 38);
if (domain == null)
domain = vm.GetDomain (vm.conn.StackFrame_GetDomain (thread.Id, Id));
return domain;
}
}
public MethodMirror Method {
get {
return method;
@@ -22,10 +22,6 @@ public class TestsBase
static string base_static_s = "C";
#pragma warning restore 0414
#pragma warning restore 0169
public virtual string virtual_method () {
return "V1";
}
}
public enum AnEnum {
@@ -1369,10 +1365,6 @@ public class Tests : TestsBase, ITest2
j = 5;
set_ip_2 ();
}
public override string virtual_method () {
return "V2";
}
}
class TypeLoadClass {
@@ -2137,11 +2137,6 @@ public class DebuggerTests
v = this_obj.InvokeMethod (e.Thread, m, null);
AssertValue (42, v);
// virtual call
m = t.BaseType.GetMethod ("virtual_method");
v = this_obj.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
AssertValue ("V2", v);
#if NET_4_5
// instance
m = t.GetMethod ("invoke_pass_ref");
@@ -2869,10 +2864,8 @@ public class DebuggerTests
var frames = e.Thread.GetFrames ();
Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name);
Assert.AreEqual (domain, frames [0].Domain);
Assert.AreEqual ("invoke", frames [1].Method.Name);
Assert.AreEqual ("domains", frames [2].Method.Name);
Assert.AreEqual (vm.RootDomain, frames [2].Domain);
// Test breakpoints on already JITted methods in other domains
m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2");
+2 -4
View File
@@ -9,9 +9,7 @@ LIB_MCS_FLAGS = -r:System.dll -r:System.Core.dll \
-d:MONO_INTERPRETER \
-delaysign -keyfile:../mono.pub
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifdef MOBILE_STATIC
ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
endif
@@ -23,4 +21,4 @@ $(the_libdir_base)Mono.Dynamic.Interpreter.dll: $(mono_dynamic_interpreter_deps)
$(the_libdir_base)plaincore/System.Core.dll:
(cd ../System.Core; $(MAKE) $@)
.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
@@ -39,7 +39,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
[TestFixture]
@@ -46,7 +46,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
class FooConverter : TypeConverter {
@@ -39,7 +39,7 @@ using NUnit.Framework;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
class DefaultOption : Option {
@@ -31,7 +31,7 @@ using System;
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
namespace MonoTests.Mono.Options
namespace Tests.Mono.Options
#endif
{
static class Utils {
@@ -221,13 +221,15 @@ namespace Mono.Security.Cryptography {
string msg = Locale.GetText ("Could not create user key store '{0}'.");
throw new CryptographicException (String.Format (msg, _userPath), e);
}
if (!ProtectUser (_userPath)) {
string msg = Locale.GetText ("Could not secure user key store '{0}'.");
throw new IOException (String.Format (msg, _userPath));
}
_userPathExists = true;
}
}
if (!IsUserProtected (_userPath) && !ProtectUser (_userPath)) {
string msg = Locale.GetText ("Could not secure user key store '{0}'.");
throw new IOException (String.Format (msg, _userPath));
}
}
// is it properly protected ?
if (!IsUserProtected (_userPath)) {
@@ -256,13 +258,15 @@ namespace Mono.Security.Cryptography {
string msg = Locale.GetText ("Could not create machine key store '{0}'.");
throw new CryptographicException (String.Format (msg, _machinePath), e);
}
if (!ProtectMachine (_machinePath)) {
string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
throw new IOException (String.Format (msg, _machinePath));
}
_machinePathExists = true;
}
}
if (!IsMachineProtected (_machinePath) && !ProtectMachine (_machinePath)) {
string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
throw new IOException (String.Format (msg, _machinePath));
}
}
// is it properly protected ?
if (!IsMachineProtected (_machinePath)) {
@@ -26,7 +26,7 @@ using System;
using System.Collections;
using System.IO;
using System.Threading;
using System.Net;
using Mono.Security.Protocol.Tls.Handshake;
namespace Mono.Security.Protocol.Tls
@@ -683,9 +683,6 @@ namespace Mono.Security.Protocol.Tls
public void SendAlert(Alert alert)
{
if (ServicePointManager.Mono_Suppress_TLS_Alerts)
return;
AlertLevel level;
AlertDescription description;
bool close;
@@ -428,8 +428,7 @@ namespace Mono.Security.Protocol.Tls
private void NegotiateAsyncWorker (IAsyncResult result)
{
NegotiateAsyncResult negotiate = result.AsyncState as NegotiateAsyncResult;
var state = negotiate.State;
try
{
switch (negotiate.State)
@@ -590,23 +589,12 @@ namespace Mono.Security.Protocol.Tls
catch (TlsException ex)
{
// FIXME: should the send alert also be done asynchronously here and below?
Console.WriteLine ("TlsException when handling state {1}: {0}", ex, state);
try {
this.protocol.SendAlert(ex.Alert);
} catch (Exception ex2) {
Console.WriteLine ("TLS: Send Alert raised an exception: {0}", ex2);
}
this.protocol.SendAlert(ex.Alert);
negotiate.SetComplete (new IOException("The authentication or decryption has failed.", ex));
}
catch (Exception ex)
{
Console.WriteLine ("General Exception: {0} when handling state {1}", ex, state);
try {
this.protocol.SendAlert(AlertDescription.InternalError);
} catch (Exception ex2) {
Console.WriteLine ("TLS: Send Alert raised an exception: {0}", ex2);
}
this.protocol.SendAlert(AlertDescription.InternalError);
negotiate.SetComplete (new IOException("The authentication or decryption has failed.", ex));
}
}
@@ -97,26 +97,10 @@ namespace Mono.Security.X509 {
// methods
public void Clear ()
{
/*
* Both _certificates and _crls extend CollectionBase, whose Clear() method calls OnClear() and
* OnClearComplete(), which should be overridden in derivative classes. So we should not worry about
* other threads that might be holding references to _certificates or _crls. They should be smart enough
* to handle this gracefully. And if not, it's their own fault.
*/
ClearCertificates ();
ClearCrls ();
}
void ClearCertificates()
{
if (_certificates != null)
_certificates.Clear ();
_certificates = null;
}
void ClearCrls ()
{
if (_crls != null)
_crls.Clear ();
_crls = null;
@@ -133,7 +117,6 @@ namespace Mono.Security.X509 {
fs.Write (data, 0, data.Length);
fs.Close ();
}
ClearCertificates (); // We have modified the store on disk. So forget the old state.
}
#if !NET_2_1
// Try to save privateKey if available..
@@ -158,7 +141,6 @@ namespace Mono.Security.X509 {
byte[] data = crl.RawData;
fs.Write (data, 0, data.Length);
}
ClearCrls (); // We have modified the store on disk. So forget the old state.
}
}
@@ -167,7 +149,6 @@ namespace Mono.Security.X509 {
string filename = Path.Combine (_storePath, GetUniqueName (certificate));
if (File.Exists (filename)) {
File.Delete (filename);
ClearCertificates (); // We have modified the store on disk. So forget the old state.
}
}
@@ -176,7 +157,6 @@ namespace Mono.Security.X509 {
string filename = Path.Combine (_storePath, GetUniqueName (crl));
if (File.Exists (filename)) {
File.Delete (filename);
ClearCrls (); // We have modified the store on disk. So forget the old state.
}
}
@@ -256,13 +236,8 @@ namespace Mono.Security.X509 {
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
KeyPairPersistence kpp = new KeyPairPersistence (cspParams);
try {
if (!kpp.Load ())
return cert;
}
catch {
if (!kpp.Load ())
return cert;
}
if (cert.RSA != null)
cert.RSA = new RSACryptoServiceProvider (cspParams);
@@ -12,7 +12,7 @@ CLEAN_FILES += $(STRING_MESSAGES)
EXTRA_DISTFILES = \
src/ComponentModel/Strings.resx
VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll
NO_INSTALL = yes
@@ -18,7 +18,7 @@ endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
# This is a .NET 3.5+ assembly
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.DataAnnotations.dll
NO_INSTALL = yes
@@ -1 +0,0 @@
#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources
+6 -5
View File
@@ -10,16 +10,17 @@ ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720
endif
MOBILE_DYNAMIC := $(filter monodroid xammac mobile, $(PROFILE))
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifeq (monodroid, $(PROFILE))
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,ANDROID
endif
ifdef MOBILE_DYNAMIC
ifeq (xammac, $(PROFILE))
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT
endif
system_core_plain_libdir = $(the_libdir_base)plaincore
ifdef MOBILE_STATIC
ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
extra_test_flags := -exclude:NotWorkingInterpreter
system_core_library_deps = $(the_libdir_base)Mono.Dynamic.Interpreter.dll $(system_core_plain_libdir)/System.Core.dll
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR
@@ -71,4 +72,4 @@ ifneq ($(PROFILE),basic)
csproj-local:
$(MAKE) csproj-local intermediate=plaincore/
endif
endif
endif
@@ -24,16 +24,13 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo {
public sealed partial class TimeZoneInfo {
[SerializableAttribute]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
@@ -453,29 +453,29 @@ namespace System {
: db.GetAvailableIds ();
}
static TimeZoneInfo _GetTimeZone (string id, string name)
static TimeZoneInfo _GetTimeZone (string name)
{
if (db == null)
return null;
byte[] buffer = db.GetTimeZoneData (name);
if (buffer == null)
return null;
return TimeZoneInfo.ParseTZBuffer (id, buffer, buffer.Length);
return TimeZoneInfo.ParseTZBuffer (name, buffer, buffer.Length);
}
internal static TimeZoneInfo GetTimeZone (string id, string name)
internal static TimeZoneInfo GetTimeZone (string id)
{
if (name != null) {
if (name == "GMT" || name == "UTC")
return new TimeZoneInfo (id, TimeSpan.FromSeconds (0), id, name, name, null, disableDaylightSavingTime:true);
if (name.StartsWith ("GMT"))
if (id != null) {
if (id == "GMT" || id == "UTC")
return new TimeZoneInfo (id, TimeSpan.FromSeconds (0), id, id, id, null, true);
if (id.StartsWith ("GMT"))
return new TimeZoneInfo (id,
TimeSpan.FromSeconds (ParseNumericZone (name)),
id, name, name, null, disableDaylightSavingTime:true);
TimeSpan.FromSeconds (ParseNumericZone (id)),
id, id, id, null, true);
}
try {
return _GetTimeZone (id, name);
return _GetTimeZone (id);
} catch (Exception) {
return null;
}
@@ -533,12 +533,12 @@ namespace System {
static readonly object _lock = new object ();
static TimeZoneInfo defaultZone;
internal static TimeZoneInfo Local {
internal static TimeZoneInfo Default {
get {
lock (_lock) {
if (defaultZone != null)
return defaultZone;
return defaultZone = GetTimeZone ("Local", GetDefaultTimeZoneName ());
return defaultZone = GetTimeZone (GetDefaultTimeZoneName ());
}
}
}
@@ -553,10 +553,7 @@ namespace System {
{
IntPtr value = IntPtr.Zero;
int n = 0;
string defaultTimeZone = Environment.GetEnvironmentVariable ("__XA_OVERRIDE_TIMEZONE_ID__");
if (!string.IsNullOrEmpty (defaultTimeZone))
return defaultTimeZone;
string defaultTimeZone;
// Used by the tests
if (Environment.GetEnvironmentVariable ("__XA_USE_JAVA_DEFAULT_TIMEZONE_ID__") == null)
@@ -579,20 +576,16 @@ namespace System {
#if SELF_TEST
/*
* Compile:
* mcs /debug+ /out:tzi.exe /unsafe "/d:INSIDE_CORLIB;MONODROID;NET_4_0;LIBC;SELF_TEST" ../corlib/System/AndroidPlatform.cs System/TimeZone*.cs ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
* mcs /out:tzi.exe /unsafe "/d:INSIDE_CORLIB;MONODROID;NET_4_0;LIBC;SELF_TEST" System/TimeZone*.cs ../../build/common/Consts.cs ../Mono.Options/Mono.Options/Options.cs
* Prep:
* mkdir -p usr/share/zoneinfo
* mkdir -p misc/zoneinfo/zoneinfo
* android_root=`adb shell echo '$ANDROID_ROOT' | tr -d "\r"`
* android_data=`adb shell echo '$ANDROID_DATA' | tr -d "\r"`
* adb pull $android_root/usr/share/zoneinfo usr/share/zoneinfo
* adb pull $android_data/misc/zoneinfo/tzdata misc/zoneinfo
* Run:
* __XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT=`pwd` ANDROID_DATA=`pwd` mono --debug tzi.exe --offset=1969-01-01
* ANDROID_ROOT=`pwd` mono tzi.exe
*/
static void Main (string[] args)
{
DateTime? offset = null;
Func<IAndroidTimeZoneDB> c = () => GetDefaultTimeZoneDB ();
Mono.Options.OptionSet p = null;
p = new Mono.Options.OptionSet () {
@@ -602,10 +595,6 @@ namespace System {
{ "Z=", "Create ZoneInfoDB from {DIR}.", v => {
c = () => new ZoneInfoDB (v);
} },
{ "offset=", "Show timezone info offset for DateTime {OFFSET}.", v => {
offset = DateTime.Parse (v);
Console.WriteLine ("Using DateTime Offset: {0}", offset);
} },
{ "help", "Show this message and exit", v => {
p.WriteOptionDescriptions (Console.Out);
Environment.Exit (0);
@@ -617,13 +606,9 @@ namespace System {
foreach (var id in GetAvailableIds ()) {
Console.Write ("name={0,-40}", id);
try {
TimeZoneInfo zone = _GetTimeZone (id, id);
if (zone != null) {
Console.Write (" {0,-40}", zone);
if (offset.HasValue) {
Console.Write ("From Offset: {0}", zone.GetUtcOffset (offset.Value));
}
}
TimeZoneInfo zone = _GetTimeZone (id);
if (zone != null)
Console.Write (" {0}", zone);
else {
Console.Write (" ERROR:null");
}
@@ -64,15 +64,12 @@ namespace System {
[DllImport ("__Internal")]
extern static IntPtr monotouch_timezone_get_data (string name, ref int size);
static Stream GetMonoTouchData (string name, bool throw_on_error = true)
static Stream GetMonoTouchData (string name)
{
int size = 0;
IntPtr data = monotouch_timezone_get_data (name, ref size);
if (size <= 0) {
if (throw_on_error)
throw new TimeZoneNotFoundException ();
return null;
}
if (size <= 0)
throw new TimeZoneNotFoundException ();
unsafe {
var s = new UnmanagedMemoryStream ((byte*) data, size);
@@ -24,7 +24,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Collections.Generic;
using System.Globalization;
@@ -33,10 +33,7 @@ using System.Text;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
partial class TimeZoneInfo
public partial class TimeZoneInfo
{
public static TimeZoneInfo FromSerializedString (string source)
{
@@ -24,17 +24,14 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace System
{
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo
public sealed partial class TimeZoneInfo
{
[SerializableAttribute]
#if MOBILE
+41 -165
View File
@@ -35,7 +35,7 @@ using System.Threading;
[assembly:TypeForwardedTo (typeof(TimeZoneInfo))]
#elif INSIDE_CORLIB || (NET_3_5 && !NET_4_0 && !MOBILE)
#elif (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -57,10 +57,7 @@ namespace System
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
[SerializableAttribute]
#if NET_4_0 || !INSIDE_CORLIB
public
#endif
sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
public sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
{
TimeSpan baseUtcOffset;
public TimeSpan BaseUtcOffset {
@@ -103,31 +100,15 @@ namespace System
}
}
/*
TimeZone transitions are stored when there is a change on the base offset.
*/
private List<KeyValuePair<DateTime, TimeType>> transitions;
static TimeZoneInfo CreateLocal ()
{
#if MONODROID
return AndroidTimeZones.Local;
return AndroidTimeZones.Default;
#elif MONOTOUCH
using (Stream stream = GetMonoTouchData (null)) {
return BuildFromStream ("Local", stream);
}
#elif LIBC
var tz = Environment.GetEnvironmentVariable ("TZ");
if (tz != null) {
if (tz == String.Empty)
return Utc;
try {
return FindSystemTimeZoneByFileName (tz, Path.Combine (TimeZoneDirectory, tz));
} catch {
return Utc;
}
}
try {
return FindSystemTimeZoneByFileName ("Local", "/etc/localtime");
} catch {
@@ -351,7 +332,8 @@ namespace System
if (dateTime.Kind == DateTimeKind.Utc)
return dateTime;
return ConvertTimeToUtc (dateTime, TimeZoneInfo.Local);
//FIXME: do not rely on DateTime implementation !
return DateTime.SpecifyKind (dateTime.ToUniversalTime (), DateTimeKind.Utc);
}
public static DateTime ConvertTimeToUtc (DateTime dateTime, TimeZoneInfo sourceTimeZone)
@@ -368,9 +350,15 @@ namespace System
if (sourceTimeZone.IsInvalidTime (dateTime))
throw new ArgumentException ("dateTime parameter is an invalid time");
if (dateTime.Kind == DateTimeKind.Utc && sourceTimeZone == TimeZoneInfo.Utc)
return dateTime;
if (dateTime.Kind == DateTimeKind.Utc)
return dateTime;
if (dateTime.Kind == DateTimeKind.Local)
return ConvertTimeToUtc (dateTime);
if (sourceTimeZone.IsAmbiguousTime (dateTime) || !sourceTimeZone.IsDaylightSavingTime (dateTime))
return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset, DateTimeKind.Utc);
else {
@@ -427,7 +415,7 @@ namespace System
}
#endif
#if MONODROID
var timeZoneInfo = AndroidTimeZones.GetTimeZone (id, id);
var timeZoneInfo = AndroidTimeZones.GetTimeZone (id);
if (timeZoneInfo == null)
throw new TimeZoneNotFoundException ();
return timeZoneInfo;
@@ -656,16 +644,14 @@ namespace System
#endif
#if MONODROID
foreach (string id in AndroidTimeZones.GetAvailableIds ()) {
var tz = AndroidTimeZones.GetTimeZone (id, id);
var tz = AndroidTimeZones.GetTimeZone (id);
if (tz != null)
systemTimeZones.Add (tz);
}
#elif MONOTOUCH
if (systemTimeZones.Count == 0) {
foreach (string name in GetMonoTouchNames ()) {
using (Stream stream = GetMonoTouchData (name, false)) {
if (stream == null)
continue;
using (Stream stream = GetMonoTouchData (name)) {
systemTimeZones.Add (BuildFromStream (name, stream));
}
}
@@ -696,8 +682,13 @@ namespace System
public TimeSpan GetUtcOffset (DateTime dateTime)
{
bool isDST;
return GetUtcOffset (dateTime, out isDST);
if (IsDaylightSavingTime (dateTime)) {
AdjustmentRule rule = GetApplicableRule (dateTime);
if (rule != null)
return BaseUtcOffset + rule.DaylightDelta;
}
return BaseUtcOffset;
}
public TimeSpan GetUtcOffset (DateTimeOffset dateTimeOffset)
@@ -705,82 +696,6 @@ namespace System
throw new NotImplementedException ();
}
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
{
isDST = false;
TimeZoneInfo tz = this;
if (dateTime.Kind == DateTimeKind.Utc)
tz = TimeZoneInfo.Utc;
if (dateTime.Kind == DateTimeKind.Local)
tz = TimeZoneInfo.Local;
bool isTzDst;
var tzOffset = GetUtcOffset (dateTime, tz, out isTzDst);
if (tz == this) {
isDST = isTzDst;
return tzOffset;
}
var utcTicks = dateTime.Ticks - tzOffset.Ticks;
if (utcTicks < 0 || utcTicks > DateTime.MaxValue.Ticks)
return BaseUtcOffset;
var utcDateTime = new DateTime (utcTicks, DateTimeKind.Utc);
return GetUtcOffset (utcDateTime, this, out isDST);
}
private static TimeSpan GetUtcOffset (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
{
if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local)
throw new Exception ();
isDST = false;
if (tz == TimeZoneInfo.Utc)
return TimeSpan.Zero;
TimeSpan offset;
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST))
return offset;
if (dateTime.Kind == DateTimeKind.Utc) {
var utcRule = tz.GetApplicableRule (dateTime);
if (utcRule != null && tz.IsInDST (utcRule, dateTime)) {
isDST = true;
return tz.BaseUtcOffset + utcRule.DaylightDelta;
}
return tz.BaseUtcOffset;
}
var stdTicks = dateTime.Ticks - tz.BaseUtcOffset.Ticks;
if (stdTicks < 0 || stdTicks > DateTime.MaxValue.Ticks)
return tz.BaseUtcOffset;
var stdUtcDateTime = new DateTime (stdTicks, DateTimeKind.Utc);
var tzRule = tz.GetApplicableRule (stdUtcDateTime);
DateTime dstUtcDateTime = DateTime.MinValue;
if (tzRule != null) {
var dstTicks = stdUtcDateTime.Ticks - tzRule.DaylightDelta.Ticks;
if (dstTicks < 0 || dstTicks > DateTime.MaxValue.Ticks)
return tz.BaseUtcOffset;
dstUtcDateTime = new DateTime (dstTicks, DateTimeKind.Utc);
}
if (tzRule != null && tz.IsInDST (tzRule, stdUtcDateTime) && tz.IsInDST (tzRule, dstUtcDateTime)) {
isDST = true;
return tz.BaseUtcOffset + tzRule.DaylightDelta;
}
return tz.BaseUtcOffset;
}
public bool HasSameRules (TimeZoneInfo other)
{
if (other == null)
@@ -835,16 +750,6 @@ namespace System
throw new NotImplementedException ();
}
private bool IsInDST (AdjustmentRule rule, DateTime dateTime)
{
// Check whether we're in the dateTime year's DST period
if (IsInDSTForYear (rule, dateTime, dateTime.Year))
return true;
// We might be in the dateTime previous year's DST period
return IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
}
bool IsInDSTForYear (AdjustmentRule rule, DateTime dateTime, int year)
{
DateTime DST_start = TransitionPoint (rule.DaylightTransitionStart, year);
@@ -867,11 +772,25 @@ namespace System
if (!SupportsDaylightSavingTime)
return false;
//FIXME: do not rely on DateTime implementation !
if ((dateTime.Kind == DateTimeKind.Local || dateTime.Kind == DateTimeKind.Unspecified) && this == TimeZoneInfo.Local)
return dateTime.IsDaylightSavingTime ();
//FIXME: do not rely on DateTime implementation !
if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Utc)
return IsDaylightSavingTime (DateTime.SpecifyKind (dateTime.ToUniversalTime (), DateTimeKind.Utc));
AdjustmentRule rule = GetApplicableRule (dateTime.Date);
if (rule == null)
return false;
bool isDst;
GetUtcOffset (dateTime, out isDst);
// Check whether we're in the dateTime year's DST period
if (IsInDSTForYear (rule, dateTime, dateTime.Year))
return true;
return isDst;
// We might be in the dateTime previous year's DST period
return IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
}
public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset)
@@ -1048,40 +967,6 @@ namespace System
return null;
}
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset,out bool isDst)
{
offset = BaseUtcOffset;
isDst = false;
if (transitions == null)
return false;
//Transitions are always in standard time
DateTime date = dateTime;
if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local)
date = date.ToUniversalTime () + BaseUtcOffset;
if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc)
date = date + BaseUtcOffset;
for (var i = transitions.Count - 1; i >= 0; i--) {
var pair = transitions [i];
DateTime ttime = pair.Key;
TimeType ttype = pair.Value;
if (ttime > date)
continue;
offset = new TimeSpan (0, 0, ttype.Offset);
isDst = ttype.IsDst;
return true;
}
return false;
}
private static DateTime TransitionPoint (TransitionTime transition, int year)
{
if (transition.IsFixedDateRule)
@@ -1172,7 +1057,6 @@ namespace System
bool dst_observed = false;
DateTime dst_start = DateTime.MinValue;
List<AdjustmentRule> adjustmentRules = new List<AdjustmentRule> ();
bool storeTransition = false;
for (int i = 0; i < transitions.Count; i++) {
var pair = transitions [i];
@@ -1183,8 +1067,6 @@ namespace System
standardDisplayName = ttype.Name;
daylightDisplayName = null;
baseUtcOffset = new TimeSpan (0, 0, ttype.Offset);
if (adjustmentRules.Count > 0) // We ignore AdjustmentRules but store transitions.
storeTransition = true;
adjustmentRules = new List<AdjustmentRule> ();
dst_observed = false;
}
@@ -1226,22 +1108,16 @@ namespace System
}
}
TimeZoneInfo tz;
if (adjustmentRules.Count == 0 && !storeTransition) {
if (adjustmentRules.Count == 0) {
TimeType t = (TimeType)time_types [0];
if (standardDisplayName == null) {
standardDisplayName = t.Name;
baseUtcOffset = new TimeSpan (0, 0, t.Offset);
}
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
} else {
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
}
if (storeTransition)
tz.transitions = transitions;
return tz;
}
static Dictionary<int, string> ParseAbbreviations (byte [] buffer, int index, int count)
@@ -232,7 +232,7 @@ namespace MonoTests.System
DateTime afterDST = new DateTime (2007, 10, 28, 2, 0, 0, DateTimeKind.Unspecified);
Assert.IsFalse (london.IsDaylightSavingTime (beforeDST), "Just before DST");
Assert.IsTrue (london.IsDaylightSavingTime (startDST), "the first seconds of DST");
Assert.IsFalse (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
Assert.IsTrue (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
Assert.IsFalse (london.IsDaylightSavingTime (afterDST), "Just after DST");
}
@@ -804,143 +804,6 @@ namespace MonoTests.System
Assert.IsTrue (london.Equals (deserialized));
}
}
[TestFixture]
public class MultipleDaylightSavingTimeTests {
private TimeZoneInfo cairo;
private DateTime dst1Start;
private DateTime dst1End;
private DateTime dst2Start;
private DateTime dst2End;
private TimeSpan baseUtcOffset;
private TimeSpan dstUtcOffset;
private TimeSpan dstOffset;
[SetUp]
public void CreateTimeZones ()
{
/*
From 1/1/2014 12:00:00 AM to 6/30/2014 12:00:00 AM
Delta: 01:00:00
Begins at 12:00 AM on 16 May
Ends at 1:00 AM on 29 June
From 7/1/2014 12:00:00 AM to 12/31/2014 12:00:00 AM
Delta: 01:00:00
Begins at 12:00 AM on 29 July
Ends at 12:00 AM on 26 September
*/
dst1Start = new DateTime (2014, 5, 16);
dst1End = new DateTime (2014, 6, 29);
dst2Start = new DateTime (2014, 7, 29);
dst2End = new DateTime (2014, 9, 26);
baseUtcOffset = new TimeSpan (2, 0, 0);
dstUtcOffset = new TimeSpan (3, 0, 0);
dstOffset = dstUtcOffset - baseUtcOffset;
var rule1 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (
new DateTime (2014, 1, 1), new DateTime (2014, 6, 30), dstOffset,
CreateFixedDateRule (dst1Start), CreateFixedDateRule (dst1End));
var rule2 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (
new DateTime (2014, 7, 1), new DateTime (2014, 12, 31), dstOffset,
CreateFixedDateRule (dst2Start), CreateFixedDateRule (dst2End));
cairo = TimeZoneInfo.CreateCustomTimeZone ("Africa/Cairo", baseUtcOffset, "Africa/Cairo", "EET", "EEST",
new [] {rule1, rule2});
}
private static TimeZoneInfo.TransitionTime CreateFixedDateRule (DateTime dateTime)
{
var time = new DateTime (dateTime.Ticks - dateTime.Date.Ticks);
return TimeZoneInfo.TransitionTime.CreateFixedDateRule (time, dateTime.Month, dateTime.Day);
}
[Test]
public void GetUtcOffset_FromUTC ()
{
var d = dst1Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
[Test]
public void GetUtcOffset_FromLocal ()
{
var d = dst1Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (-baseUtcOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-baseUtcOffset-dstOffset);
d = DateTime.SpecifyKind (d, DateTimeKind.Utc);
d = d.ToLocalTime ();
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
[Test]
public void GetUtcOffset_FromUnspecified ()
{
var d = dst1Start.Add (dstOffset);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst1End.Add (-dstOffset);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2Start.Add (dstOffset);
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
d = dst2End.Add (-dstOffset);
Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
}
}
}
}
#endif
@@ -1,4 +1,109 @@
#include mobile_common_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
Assembly/AssemblyInfo.cs
System/Actions.cs
System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
System.Runtime.CompilerServices/ExecutionScope.cs
System.Runtime.CompilerServices/ExtensionAttribute.cs
System.Runtime.CompilerServices/IStrongBox.cs
System.Runtime.CompilerServices/StrongBox_T.cs
System.Linq/Check.cs
System.Linq/Enumerable.cs
System.Linq/QueryableEnumerable.cs
System.Linq/QueryableTransformer.cs
System.Linq/Grouping.cs
System.Linq/IGrouping.cs
System.Linq/IOrderedQueryable.cs
System.Linq/IOrderedQueryable_T.cs
System.Linq/IOrderedEnumerable_T.cs
System.Linq/IQueryable.cs
System.Linq/IQueryable_T.cs
System.Linq/Lookup.cs
System.Linq/ILookup_T.cs
System.Linq/OrderedEnumerable.cs
System.Linq/OrderedSequence.cs
System.Linq/Queryable.cs
System.Linq/QuickSort.cs
System.Linq/SortContext.cs
System.Linq/SortDirection.cs
System.Linq/SortSequenceContext.cs
System.Linq/IQueryProvider.cs
System.Collections.Generic/HashSet.cs
System.Security.Cryptography/Aes.cs
System.Threading/LockRecursionPolicy.cs
System.Threading/ReaderWriterLockSlim.cs
System.Threading/ThreadLockState.cs
System.Threading/ReaderWriterLockSlimExtensions.cs
System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
System.Linq.Parallel.QueryNodes/QueryCastNode.cs
System.Linq.Parallel.QueryNodes/QueryChildNode.cs
System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
System.Linq.Parallel.QueryNodes/QuerySetNode.cs
System.Linq.Parallel.QueryNodes/QueryStartNode.cs
System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
System.Linq.Parallel.QueryNodes/QueryZipNode.cs
System.Linq.Parallel.QueryNodes/SetInclusion.cs
System.Linq.Parallel.QueryNodes/WrapHelper.cs
System.Linq.Parallel/AggregationList.cs
System.Linq.Parallel/ConcurrentGrouping.cs
System.Linq.Parallel/ConcurrentLookup.cs
System.Linq.Parallel/INodeVisitor.cs
System.Linq.Parallel/IVisitableNode.cs
System.Linq.Parallel/OrderingEnumerator.cs
System.Linq.Parallel/ParallelExecuter.cs
System.Linq.Parallel/ParallelPartitioner.cs
System.Linq.Parallel/ParallelQueryEnumerator.cs
System.Linq.Parallel/ParallelQuickSort.cs
System.Linq.Parallel/QueryCheckerVisitor.cs
System.Linq.Parallel/QueryIsOrderedVisitor.cs
System.Linq.Parallel/QueryOptions.cs
System.Linq.Parallel/RangeList.cs
System.Linq.Parallel/RepeatList.cs
System.Linq.Parallel/ReverseList.cs
System.Linq.Parallel/StripPartitioner.cs
System.Linq.Parallel/TemporaryArea.cs
System.Linq/EnumerableExecutor.cs
System.Linq/EnumerableExecutor_T.cs
System.Linq/EnumerableQuery.cs
System.Linq/EnumerableQuery_T.cs
System.Linq/OrderedParallelQuery.cs
System.Linq/ParallelEnumerable.cs
System.Linq/ParallelExecutionMode.cs
System.Linq/ParallelMergeOptions.cs
System.Linq/ParallelQuery.cs
System.IO.MemoryMappedFiles/MemoryMappedFile.cs
System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
System.IO/HandleInheritability.cs
System.Threading.Tasks/TaskExtensions.cs
System.Linq.Expressions/Extensions.cs
System.Linq.Expressions/ExpressionTransformer.cs
../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
System.Linq.Expressions/DynamicExpressionVisitor.cs
@@ -1,108 +0,0 @@
Assembly/AssemblyInfo.cs
System/Actions.cs
System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
System.Runtime.CompilerServices/ExecutionScope.cs
System.Runtime.CompilerServices/ExtensionAttribute.cs
System.Runtime.CompilerServices/IStrongBox.cs
System.Runtime.CompilerServices/StrongBox_T.cs
System.Linq/Check.cs
System.Linq/Enumerable.cs
System.Linq/QueryableEnumerable.cs
System.Linq/QueryableTransformer.cs
System.Linq/Grouping.cs
System.Linq/IGrouping.cs
System.Linq/IOrderedQueryable.cs
System.Linq/IOrderedQueryable_T.cs
System.Linq/IOrderedEnumerable_T.cs
System.Linq/IQueryable.cs
System.Linq/IQueryable_T.cs
System.Linq/Lookup.cs
System.Linq/ILookup_T.cs
System.Linq/OrderedEnumerable.cs
System.Linq/OrderedSequence.cs
System.Linq/Queryable.cs
System.Linq/QuickSort.cs
System.Linq/SortContext.cs
System.Linq/SortDirection.cs
System.Linq/SortSequenceContext.cs
System.Linq/IQueryProvider.cs
System.Collections.Generic/HashSet.cs
System.Security.Cryptography/Aes.cs
System.Threading/LockRecursionPolicy.cs
System.Threading/ReaderWriterLockSlim.cs
System.Threading/ThreadLockState.cs
System.Threading/ReaderWriterLockSlimExtensions.cs
System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
System.Linq.Parallel.QueryNodes/QueryCastNode.cs
System.Linq.Parallel.QueryNodes/QueryChildNode.cs
System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
System.Linq.Parallel.QueryNodes/QuerySetNode.cs
System.Linq.Parallel.QueryNodes/QueryStartNode.cs
System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
System.Linq.Parallel.QueryNodes/QueryZipNode.cs
System.Linq.Parallel.QueryNodes/SetInclusion.cs
System.Linq.Parallel.QueryNodes/WrapHelper.cs
System.Linq.Parallel/AggregationList.cs
System.Linq.Parallel/ConcurrentGrouping.cs
System.Linq.Parallel/ConcurrentLookup.cs
System.Linq.Parallel/INodeVisitor.cs
System.Linq.Parallel/IVisitableNode.cs
System.Linq.Parallel/OrderingEnumerator.cs
System.Linq.Parallel/ParallelExecuter.cs
System.Linq.Parallel/ParallelPartitioner.cs
System.Linq.Parallel/ParallelQueryEnumerator.cs
System.Linq.Parallel/ParallelQuickSort.cs
System.Linq.Parallel/QueryCheckerVisitor.cs
System.Linq.Parallel/QueryIsOrderedVisitor.cs
System.Linq.Parallel/QueryOptions.cs
System.Linq.Parallel/RangeList.cs
System.Linq.Parallel/RepeatList.cs
System.Linq.Parallel/ReverseList.cs
System.Linq.Parallel/StripPartitioner.cs
System.Linq.Parallel/TemporaryArea.cs
System.Linq/EnumerableExecutor.cs
System.Linq/EnumerableExecutor_T.cs
System.Linq/EnumerableQuery.cs
System.Linq/EnumerableQuery_T.cs
System.Linq/OrderedParallelQuery.cs
System.Linq/ParallelEnumerable.cs
System.Linq/ParallelExecutionMode.cs
System.Linq/ParallelMergeOptions.cs
System.Linq/ParallelQuery.cs
System.IO.MemoryMappedFiles/MemoryMappedFile.cs
System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
System.IO/HandleInheritability.cs
System.Threading.Tasks/TaskExtensions.cs
System.Linq.Expressions/Extensions.cs
System.Linq.Expressions/ExpressionTransformer.cs
../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
System.Linq.Expressions/DynamicExpressionVisitor.cs
@@ -1,2 +0,0 @@
#include mobile_common_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
@@ -1,4 +1,4 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
@@ -1,3 +1,3 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
System/TimeZoneInfo.MonoTouch.cs
@@ -1,4 +1,4 @@
#include mobile_common_System.Core.dll.sources
#include mobile_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
@@ -95,7 +95,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -111,7 +111,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -127,7 +127,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -142,7 +142,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -157,7 +157,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -172,7 +172,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -193,8 +193,8 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode);
@@ -206,8 +206,8 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode);
@@ -547,7 +547,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -558,7 +558,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByName (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameRef (IntPtr stmtp,
@@ -569,7 +569,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -580,7 +580,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameRef (stmtp, out bindpp, errhp, placeholder, placeh_len, ref valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameBytes (IntPtr stmtp,
@@ -591,7 +591,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -602,7 +602,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameBytes (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPos (IntPtr stmtp,
@@ -612,7 +612,7 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -623,7 +623,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPos (stmtp, out bindpp, errhp, position, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosRef (IntPtr stmtp,
@@ -633,7 +633,7 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -644,7 +644,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosRef (stmtp, out bindpp, errhp, position, ref valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosBytes (IntPtr stmtp,
@@ -654,7 +654,7 @@ namespace System.Data.OracleClient.Oci
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
IntPtr indp,
ref short indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
@@ -665,7 +665,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosBytes (stmtp, out bindpp, errhp, position, valuep,
value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
}
[DllImport ("oci")]
@@ -723,8 +723,8 @@ namespace System.Data.OracleClient.Oci
IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode)
{
@@ -732,7 +732,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIDefineByPos", "OCI");
#endif
return OciNativeCalls.OCIDefineByPos (stmtp, out defnpp, errhp, position, valuep,
value_sz, dty, indp, rlenp, rcodep, mode);
value_sz, dty, ref indp, ref rlenp, rcodep, mode);
}
internal static int OCIDefineByPosPtr (IntPtr stmtp,
@@ -742,8 +742,8 @@ namespace System.Data.OracleClient.Oci
ref IntPtr valuep,
int value_sz,
OciDataType dty,
IntPtr indp,
IntPtr rlenp,
ref short indp,
ref short rlenp,
IntPtr rcodep,
uint mode)
{
@@ -751,7 +751,7 @@ namespace System.Data.OracleClient.Oci
Trace.WriteLineIf(traceOci, "OCIDefineByPosPtr", "OCI");
#endif
return OciNativeCalls.OCIDefineByPosPtr (stmtp, out defnpp, errhp, position, ref valuep,
value_sz, dty, indp, rlenp, rcodep, mode);
value_sz, dty, ref indp, ref rlenp, rcodep, mode);
}
internal static int OCIDescriptorFree (IntPtr hndlp,
@@ -32,16 +32,16 @@ namespace System.Data.OracleClient.Oci
//IntPtr handle;
IntPtr value;
IntPtr indicator;
short indicator;
//OracleType type;
OciDataType ociType;
OciDataType definedType;
int definedSize;
IntPtr rlenp;
short rlenp = 0;
//short precision;
short scale;
Type fieldType;
string name;
//string name;
// Oracle defines the LONG VARCHAR and LONG VARRAW to have a size of 2 to the 31 power - 5
// see DefineLongVarChar and DefineLongVarRaw
@@ -70,13 +70,11 @@ namespace System.Data.OracleClient.Oci
{
OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
name = parameter.GetName ();
//name = parameter.GetName ();
definedType = parameter.GetDataType ();
definedSize = parameter.GetDataSize ();
//precision = parameter.GetPrecision ();
scale = parameter.GetScale ();
rlenp = OciCalls.AllocateClear (sizeof(short));
indicator = OciCalls.AllocateClear (sizeof(short));
Define (position, connection);
@@ -105,7 +103,7 @@ namespace System.Data.OracleClient.Oci
}
internal bool IsNull {
get { return (Indicator == -1); }
get { return (indicator == -1); }
}
internal short Scale {
@@ -113,13 +111,7 @@ namespace System.Data.OracleClient.Oci
}
internal short Size {
get { return(Marshal.ReadInt16(rlenp)); }
set { Marshal.WriteInt16(rlenp, value); }
}
internal short Indicator {
get { return(Marshal.ReadInt16(indicator)); }
set { Marshal.WriteInt16(indicator, value); }
get { return rlenp; }
}
internal IntPtr Value {
@@ -200,8 +192,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -230,8 +222,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -269,11 +261,11 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
Size = (short) definedSize;
rlenp = (short) definedSize;
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -299,8 +291,8 @@ namespace System.Data.OracleClient.Oci
value,
maxByteCount,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
OciErrorHandle.ThrowExceptionIfError (ErrorHandle, status);
@@ -320,10 +312,10 @@ namespace System.Data.OracleClient.Oci
ErrorHandle,
position + 1,
value,
definedSize,
definedSize * 2,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -365,8 +357,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -394,8 +386,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
if (status != 0) {
@@ -423,8 +415,8 @@ namespace System.Data.OracleClient.Oci
value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero, 0);
if (status != 0) {
@@ -467,8 +459,8 @@ namespace System.Data.OracleClient.Oci
ref value,
definedSize,
ociType,
indicator,
rlenp,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
@@ -495,8 +487,6 @@ namespace System.Data.OracleClient.Oci
}
disposed = true;
} finally {
Marshal.FreeHGlobal (indicator);
Marshal.FreeHGlobal (rlenp);
base.Dispose (disposing);
value = IntPtr.Zero;
}
@@ -37,13 +37,12 @@ using System.Text;
namespace System.Data.OracleClient
{
[TypeConverter (typeof(OracleParameter.OracleParameterConverter))]
public sealed class OracleParameter :
public sealed class OracleParameter :
#if NET_2_0
DbParameter, IDbDataParameter, ICloneable,
DbParameter, IDbDataParameter, ICloneable
#else
MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable,
MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
#endif
IDisposable
{
#region Fields
@@ -67,7 +66,6 @@ namespace System.Data.OracleClient
object value = DBNull.Value;
OciLobLocator lobLocator; // only if Blob or Clob
IntPtr bindOutValue = IntPtr.Zero;
IntPtr indicator = IntPtr.Zero;
OciDateTimeDescriptor dateTimeDesc;
IntPtr cursor = IntPtr.Zero;
@@ -79,6 +77,7 @@ namespace System.Data.OracleClient
bool useRef;
OciDataType bindType;
short indicator;
int bindSize;
bool sizeManuallySet;
@@ -105,7 +104,6 @@ namespace System.Data.OracleClient
this.value = value.value;
this.lobLocator = value.lobLocator;
this.oracleTypeSet = value.oracleTypeSet;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter ()
@@ -121,7 +119,6 @@ namespace System.Data.OracleClient
this.srcVersion = DataRowVersion.Current;
this.value = null;
this.oracleTypeSet = false;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter (string name, object value)
@@ -132,7 +129,6 @@ namespace System.Data.OracleClient
srcColumn = string.Empty;
SourceVersion = DataRowVersion.Current;
InferOracleType (value);
this.indicator = OciCalls.AllocateClear (sizeof(short));
#if NET_2_0
// Find the OciType before inferring for the size
if (value != null && value != DBNull.Value) {
@@ -177,7 +173,6 @@ namespace System.Data.OracleClient
OracleType = oracleType;
SourceColumn = sourceColumn;
SourceVersion = sourceVersion;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
#endif
@@ -204,12 +199,6 @@ namespace System.Data.OracleClient
OracleType = oracleType;
SourceColumn = srcColumn;
SourceVersion = srcVersion;
this.indicator = OciCalls.AllocateClear (sizeof(short));
}
~OracleParameter ()
{
Dispose(false);
}
#endregion // Constructors
@@ -221,11 +210,6 @@ namespace System.Data.OracleClient
set { container = value; }
}
internal short Indicator {
get { return (Marshal.ReadInt16(indicator)); }
set { Marshal.WriteInt16(indicator, value); }
}
#if !NET_2_0
[Browsable (false)]
[RefreshProperties (RefreshProperties.All)]
@@ -469,6 +453,7 @@ namespace System.Data.OracleClient
}
if (isnull == true && direction == ParameterDirection.Input) {
indicator = 0;
bindType = OciDataType.VarChar2;
bindSize = 0;
} else {
@@ -480,6 +465,7 @@ namespace System.Data.OracleClient
case OciDataType.CharZ:
case OciDataType.OciString:
bindType = OciDataType.String;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -572,7 +558,7 @@ namespace System.Data.OracleClient
dt = DateTime.MinValue;
sDate = "";
if (isnull)
Indicator = -1;
indicator = -1;
else if (v is String) {
sDate = (string) v;
dt = DateTime.Parse (sDate);
@@ -608,7 +594,7 @@ namespace System.Data.OracleClient
case OciDataType.Float:
case OciDataType.Number:
bindType = OciDataType.String;
Indicator = 0;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -652,7 +638,7 @@ namespace System.Data.OracleClient
bindSize = Size + 5; // 4 bytes prepended for length, bytes, 1 byte NUL character
Indicator = 0;
indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
@@ -772,7 +758,7 @@ namespace System.Data.OracleClient
case OciDataType.VarRaw:
bindType = OciDataType.VarRaw;
bindSize = Size + 2; // include 2 bytes prepended to hold the length
Indicator = 0;
indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
@@ -798,7 +784,7 @@ namespace System.Data.OracleClient
case OciDataType.LongVarRaw:
bindType = OciDataType.LongVarRaw;
bindSize = Size + 4; // include 4 bytes prepended to hold the length
Indicator = 0;
indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
@@ -868,7 +854,7 @@ namespace System.Data.OracleClient
ref bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -884,7 +870,7 @@ namespace System.Data.OracleClient
ref bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -901,7 +887,7 @@ namespace System.Data.OracleClient
ref cursor,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -917,7 +903,7 @@ namespace System.Data.OracleClient
bytes,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -933,7 +919,7 @@ namespace System.Data.OracleClient
bindValue,
bindSize,
bindType,
indicator,
ref indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
@@ -1265,7 +1251,7 @@ namespace System.Data.OracleClient
// used to update the parameter value
// for Output, the output of InputOutput, and Return parameters
value = DBNull.Value;
if (Indicator == -1)
if (indicator == -1)
return;
int rsize = 0;
@@ -1467,22 +1453,6 @@ namespace System.Data.OracleClient
return buffer;
}
public void Dispose ()
{
Dispose (true);
}
void Dispose (bool disposing)
{
if (disposing) {
GC.SuppressFinalize(this);
}
if (indicator != IntPtr.Zero) {
Marshal.FreeHGlobal (indicator);
indicator = IntPtr.Zero;
}
}
#endregion // Methods
internal sealed class OracleParameterConverter : ExpandableObjectConverter
@@ -1 +1,2 @@
#include net_4_5_System.Data.Services.Client.dll.sources
#include System.Data.Services.Client.dll.sources
./Client/AssemblyAttributes.cs
@@ -26,11 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class ChangeInterceptorAttributeTests {
[Test]
@@ -47,4 +45,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual ("setName", ci.EntitySetName);
}
}
}
}
@@ -26,11 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class DataServiceExceptionTests {
[Test]
@@ -70,4 +68,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual (inner, ex.InnerException);
}
}
}
}
@@ -26,11 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class DataServiceTests {
[Test]
@@ -81,4 +79,4 @@ namespace MonoTests.System.Data.Services {
this.OnStartProcessingRequest (args);
}
}
}
}
@@ -26,12 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using System.Linq;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class ETagAttributeTests {
[Test]
@@ -65,4 +63,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual ("bar", e.PropertyNames[1]);
}
}
}
}
@@ -26,11 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Data.Services;
using System.Linq.Expressions;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class ExpandSegmentCollectionTests {
[Test]
@@ -102,4 +101,4 @@ namespace MonoTests.System.Data.Services {
Assert.IsFalse (esc.HasFilter);
}
}
}
}
@@ -26,12 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using System.Linq.Expressions;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class ExpandSegmentTests {
[Test]
@@ -86,4 +84,4 @@ namespace MonoTests.System.Data.Services {
{ new ExpandSegment ("first", null), new ExpandSegment ("second", null), new ExpandSegment ("third", null) }));
}
}
}
}
@@ -26,12 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using System.Linq;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class IgnorePropertiesAttributeTests {
[Test]
@@ -65,4 +63,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual ("bar", e.PropertyNames[1]);
}
}
}
}
@@ -26,10 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class MimeTypeAttributeTests {
[Test]
@@ -40,4 +39,4 @@ namespace MonoTests.System.Data.Services {
Assert.AreEqual ("type", mt.MimeType);
}
}
}
}
@@ -26,11 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data.Services;
using NUnit.Framework;
namespace MonoTests.System.Data.Services {
namespace System.Data.Services.Tests {
[TestFixture]
public class QueryInterceptorAttributeTests {
[Test]
@@ -47,4 +45,4 @@ namespace MonoTests.System.Data.Services {
new QueryInterceptorAttribute (null);
}
}
}
}
@@ -206,7 +206,6 @@
<Compile Include="System.Data.SqlClient\SqlCommandBuilder.cs" />
<Compile Include="System.Data.SqlClient\SqlConnection.cs" />
<Compile Include="System.Data.SqlClient\SqlConnectionStringBuilder.cs" />
<Compile Include="System.Data.SqlClient\SqlCredential.cs" />
<Compile Include="System.Data.SqlClient\SqlDataAdapter.cs" />
<Compile Include="System.Data.SqlClient\SqlDataReader.cs" />
<Compile Include="System.Data.SqlClient\SqlDataSourceConverter.cs" />
@@ -43,6 +43,7 @@ namespace System.Data.Common {
readonly IDataReader reader;
readonly bool closeReader;
readonly SchemaInfo [] schema;
readonly object [] values;
#endregion // Fields
@@ -57,6 +58,7 @@ namespace System.Data.Common {
{
this.reader = reader;
this.closeReader = closeReader;
this.values = new object [reader.FieldCount];
this.schema = LoadSchema (reader);
}
@@ -65,13 +67,8 @@ namespace System.Data.Common {
#region Properties
public object Current {
get {
// DbDataRecordImpl does not do copy of the array
// and MoveNext would overwrite any previously filled data
var values = new object [reader.FieldCount];
get {
reader.GetValues (values);
// TODO: Should not allocate on every property call
return new DbDataRecordImpl (schema, values);
}
}
@@ -56,7 +56,6 @@ using System.Xml;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.Security;
namespace System.Data.SqlClient
{
@@ -94,9 +93,6 @@ namespace System.Data.SqlClient
// The connection string that identifies this connection
string connectionString;
// The connection credentials
SqlCredential credentials;
// The transaction object for the current transaction
SqlTransaction transaction;
@@ -137,12 +133,6 @@ namespace System.Data.SqlClient
ConnectionString = connectionString;
}
public SqlConnection (string connectionString, SqlCredential cred)
{
ConnectionString = connectionString;
Credentials = cred;
}
#endregion // Constructors
#region Properties
@@ -165,15 +155,6 @@ namespace System.Data.SqlClient
}
}
public SqlCredential Credentials {
get {
return credentials;
}
set {
credentials = value;
}
}
#if !NET_2_0
[DataSysDescription ("Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.")]
#endif
@@ -582,16 +563,6 @@ namespace System.Data.SqlClient
if (!tds.IsConnected) {
try {
if (Credentials != null) {
if (parms.User != String.Empty)
throw new ArgumentException("UserID already specified");
if (parms.PasswordSet)
throw new ArgumentException("Password already specified");
if (parms.DomainLogin != false)
throw new ArgumentException("Cannot use credentials with DomainLogin");
parms.User = Credentials.UserId;
parms.Password = Credentials.Password;
}
tds.Connect (parms);
} catch {
if (pooling)
@@ -908,10 +879,7 @@ namespace System.Data.SqlClient
break;
case "password" :
case "pwd" :
parms.Password = new SecureString();
foreach (char c in value)
parms.Password.AppendChar(c);
parms.PasswordSet = true;
parms.Password = value;
break;
case "persistsecurityinfo" :
case "persist security info" :
@@ -1,76 +0,0 @@
//
// System.Data.SqlClient.SqlCredential.cs
//
// Author:
// Neale Ferguson ([email protected])
//
// Copyright (C) Neale Ferguson, 2014
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Data;
using System.Runtime.InteropServices;
using System.Security;
namespace System.Data.SqlClient {
/// <summary>
/// Describes an error from a SQL database.
/// </summary>
[Serializable]
public sealed class SqlCredential
{
#region Fields
string uid = "";
SecureString pwd = null;
#endregion // Fields
#region Constructors
public SqlCredential (string user, SecureString password)
{
if (user == null)
throw new ArgumentNullException("UserID");
if (password == null)
throw new ArgumentNullException("Password");
this.uid = user;
this.pwd = password;
}
#endregion // Constructors
#region Properties
public string UserId {
get { return uid; }
}
public SecureString Password {
get { return pwd; }
}
#endregion
}
}
@@ -289,7 +289,6 @@ System.Data.SqlClient/SqlCommand.cs
System.Data.SqlClient/SqlCommandBuilder.cs
System.Data.SqlClient/SqlConnection.cs
System.Data.SqlClient/SqlConnectionStringBuilder.cs
System.Data.SqlClient/SqlCredential.cs
System.Data.SqlClient/SqlDataAdapter.cs
System.Data.SqlClient/SqlDataReader.cs
System.Data.SqlClient/SqlDataSourceConverter.cs
@@ -31,7 +31,7 @@ using System.Data;
using System.Data.Common;
using System.IO;
namespace MonoTests.System.Data.Common
namespace Test.System.Data.Common
{
internal class DbDataReaderMock : DbDataReader
{
@@ -32,7 +32,7 @@ using System.Data;
using System.Data.Common;
using System.IO;
namespace MonoTests.System.Data.Common
namespace Test.System.Data.Common
{
[TestFixture]
public class DbDataReaderTest
@@ -12,8 +12,6 @@ using System.Threading;
using NUnit.Framework;
namespace MonoTests.System.Data
{
[TestFixture]
public class BinarySerializationTest
{
@@ -753,4 +751,3 @@ public class BinarySerializationTest
}
#endif
}
@@ -33,7 +33,7 @@ using System.IO;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class ConstraintExceptionTest
{
Loaded 100 of 656 files, more files were not shown because too many files have changed in this diff. Show more