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
350 changed files with 16496 additions and 6087 deletions

No files matched your search

+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.
+19 -3
View File
@@ -2499,6 +2499,7 @@ TARGET="unknown"
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=no
INTERP_SUPPORTED=no
LIBC="libc.so.6"
INTL="libc.so.6"
SQLITE="libsqlite.so.0"
@@ -2511,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
@@ -2938,10 +2940,18 @@ if test x$JIT_SUPPORTED = xyes; then
USEJIT=true
jit_status="Building and using the JIT"
else
AC_ERROR(No JIT support available or selected.)
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
AC_ERROR(No JIT support available or selected.)
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)
@@ -3348,6 +3358,7 @@ 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)
@@ -3367,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
@@ -3564,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
+5
View File
@@ -27,8 +27,13 @@ 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
+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"/>
+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,
+2
View File
@@ -467,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
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
@@ -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
+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)
@@ -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);
}
@@ -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;
}
@@ -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
+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;
+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 {
@@ -236,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
@@ -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);
+1 -3
View File
@@ -651,9 +651,7 @@ namespace System
#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));
}
}
@@ -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);
}
}
}
}
@@ -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
{
@@ -31,7 +31,7 @@ using System.Data;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture]
public class DBConcurrencyExceptionTest
@@ -39,7 +39,7 @@ using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Globalization;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture]
public class DataSetTest2
@@ -448,7 +448,7 @@ namespace MonoTests.System.Data
dt.Rows.Add(new object[] {2,"Value3","Value4"});
dt.Rows.Add(new object[] {3,"Value5","Value5"});
StringBuilder resultXML = new StringBuilder();
System.Text.StringBuilder resultXML = new System.Text.StringBuilder();
resultXML.Append("<" + ds.DataSetName + "xmlns=\"namespace\">");
@@ -975,13 +975,13 @@ namespace MonoTests.System.Data
[Test] public void Locale()
{
DataSet ds = new DataSet("MyDataSet");
CultureInfo culInfo = CultureInfo.CurrentCulture ;
System.Globalization.CultureInfo culInfo = System.Globalization.CultureInfo.CurrentCulture ;
// Checking Locale default from system
Assert.AreEqual(culInfo, ds.Locale , "DS156");
// Checking Locale get/set
culInfo = new CultureInfo("fr"); // = french
culInfo = new System.Globalization.CultureInfo("fr"); // = french
ds.Locale = culInfo ;
Assert.AreEqual(culInfo , ds.Locale , "DS157");
}
@@ -1998,11 +1998,11 @@ namespace MonoTests.System.Data
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
MemoryStream ms = new MemoryStream();
System.IO.MemoryStream ms = new System.IO.MemoryStream();
//write xml schema only
ds1.WriteXmlSchema(ms);
MemoryStream ms1 = new MemoryStream(ms.GetBuffer());
System.IO.MemoryStream ms1 = new System.IO.MemoryStream(ms.GetBuffer());
//copy schema
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(ms1);
@@ -2073,7 +2073,7 @@ namespace MonoTests.System.Data
Assert.AreEqual(0, ds2.Tables[1].Rows.Count , "DS282");
//try to delete the file
File.Delete(sTempFileName);
System.IO.File.Delete(sTempFileName);
}
[Test] public void ReadXmlSchema_ByTextReader()
@@ -2082,11 +2082,11 @@ namespace MonoTests.System.Data
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
StringWriter sw = new StringWriter();
System.IO.StringWriter sw = new System.IO.StringWriter();
//write xml file, schema only
ds1.WriteXmlSchema(sw);
StringReader sr = new StringReader(sw.GetStringBuilder().ToString());
System.IO.StringReader sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
//copy both data and schema
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(sr);
@@ -2122,14 +2122,14 @@ namespace MonoTests.System.Data
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
StringWriter sw = new StringWriter();
XmlTextWriter xmlTW = new XmlTextWriter(sw);
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Xml.XmlTextWriter xmlTW = new System.Xml.XmlTextWriter(sw);
//write xml file, schema only
ds1.WriteXmlSchema(xmlTW);
xmlTW.Flush();
StringReader sr = new StringReader(sw.ToString());
XmlTextReader xmlTR = new XmlTextReader(sr);
System.IO.StringReader sr = new System.IO.StringReader(sw.ToString());
System.Xml.XmlTextReader xmlTR = new System.Xml.XmlTextReader(sr);
//copy both data and schema
DataSet ds2 = new DataSet();
@@ -2196,7 +2196,7 @@ namespace MonoTests.System.Data
Assert.AreEqual(ds2.Tables[1].Rows.Count, ds1.Tables[1].Rows.Count , "DS299");
//try to delete the file
File.Delete(sTempFileName);
System.IO.File.Delete(sTempFileName);
}
[Test]
@@ -2212,7 +2212,7 @@ namespace MonoTests.System.Data
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
MemoryStream ms = new MemoryStream();
System.IO.MemoryStream ms = new System.IO.MemoryStream();
//write xml file, data only
ds1.WriteXml(ms);
@@ -2241,7 +2241,7 @@ namespace MonoTests.System.Data
{
string input = string.Empty;
StringReader sr;
System.IO.StringReader sr;
DataSet ds = new DataSet();
input += "<?xml version=\"1.0\"?>";
@@ -2261,7 +2261,7 @@ namespace MonoTests.System.Data
input += " </Price>";
input += "</Stock>";
sr = new StringReader(input);
sr = new System.IO.StringReader(input);
ds.ReadXml(sr);
@@ -2311,7 +2311,7 @@ namespace MonoTests.System.Data
{
DataSet ds = new DataSet("TestDataSet");
string input = string.Empty;
StringReader sr;
System.IO.StringReader sr;
input += "<?xml version=\"1.0\" standalone=\"yes\"?>";
input += "<Stocks><Stock name=\"MSFT\"><Company name=\"Microsoft Corp.\" /><Price type=\"high\"><Value>10.0</Value>";
@@ -2320,7 +2320,7 @@ namespace MonoTests.System.Data
input += "<Company name=\"General Electric\" /><Price type=\"high\"><Value>22.23</Value><Date>02/12/2001</Date></Price>";
input += "<Price type=\"low\"><Value>1.97</Value><Date>04/20/2003</Date></Price><Price type=\"current\"><Value>3.0</Value>";
input += "<Date>TODAY</Date></Price></Stock></Stocks>";
sr = new StringReader(input);
sr = new System.IO.StringReader(input);
ds.EnforceConstraints = false;
ds.ReadXml(sr);
@@ -2339,7 +2339,7 @@ namespace MonoTests.System.Data
{
m_ds = new DataSet("Stocks");
string input = string.Empty;
StringReader sr;
System.IO.StringReader sr;
input += "<?xml version=\"1.0\"?>";
input += "<Stocks>";
@@ -2408,7 +2408,7 @@ namespace MonoTests.System.Data
input += " </Stock>";
input += "</Stocks>";
sr = new StringReader(input);
sr = new System.IO.StringReader(input);
m_ds.EnforceConstraints = true;
m_ds.ReadXml(sr);
this.privateTestCase("TestCase 1", "Company", "name='Microsoft Corp.'", "Stock", "name='MSFT'", "DS320");
@@ -2444,14 +2444,14 @@ namespace MonoTests.System.Data
#region "TestCase 1 - Empty string"
// Empty string
DataSet ds = new DataSet();
StringReader sr = new StringReader (string.Empty);
XmlTextReader xReader = new XmlTextReader(sr);
System.IO.StringReader sr = new System.IO.StringReader (string.Empty);
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr);
try
{
ds.ReadXml (xReader);
Assert.Fail("DS335: ReadXml Failed to throw XmlException");
}
catch (XmlException) {}
catch (System.Xml.XmlException) {}
catch (AssertionException exc) {throw exc;}
catch (Exception exc)
{
@@ -2635,8 +2635,8 @@ namespace MonoTests.System.Data
private void PrivateTestCase(string a_name, string a_expected, string a_xmlData)
{
DataSet ds = new DataSet();
StringReader sr = new StringReader(a_xmlData) ;
XmlTextReader xReader = new XmlTextReader(sr) ;
System.IO.StringReader sr = new System.IO.StringReader(a_xmlData) ;
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
ds.ReadXml (xReader);
Assert.AreEqual(a_expected, this.dataSetDescription(ds), "DS337");
}
@@ -2681,8 +2681,8 @@ namespace MonoTests.System.Data
xmlData += "<c>3</c>";
xmlData += "</b>";
xmlData += "</a>";
StringReader sr = new StringReader(xmlData) ;
XmlTextReader xReader = new XmlTextReader(sr) ;
System.IO.StringReader sr = new System.IO.StringReader(xmlData) ;
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
ds.ReadXml (xReader);
Assert.AreEqual(3, ds.Tables["c"].Rows.Count, "DS338");
}
@@ -2738,7 +2738,7 @@ namespace MonoTests.System.Data
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
StringWriter sw = new StringWriter();
System.IO.StringWriter sw = new System.IO.StringWriter();
//write xml file, data only
ds1.WriteXml(sw);
@@ -2747,7 +2747,7 @@ namespace MonoTests.System.Data
//clear the data
ds2.Clear();
StringReader sr = new StringReader(sw.GetStringBuilder().ToString());
System.IO.StringReader sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
ds2.ReadXml(sr);
//check xml data
@@ -2777,8 +2777,8 @@ namespace MonoTests.System.Data
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
StringWriter sw = new StringWriter();
XmlTextWriter xmlTW = new XmlTextWriter(sw);
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Xml.XmlTextWriter xmlTW = new System.Xml.XmlTextWriter(sw);
//write xml file, data only
ds1.WriteXml(xmlTW);
@@ -2788,8 +2788,8 @@ namespace MonoTests.System.Data
DataSet ds2 = ds1.Copy();
//clear the data
ds2.Clear();
StringReader sr = new StringReader(sw.ToString());
XmlTextReader xmlTR = new XmlTextReader(sr);
System.IO.StringReader sr = new System.IO.StringReader(sw.ToString());
System.Xml.XmlTextReader xmlTR = new System.Xml.XmlTextReader(sr);
ds2.ReadXml(xmlTR);
//check xml data
@@ -2847,8 +2847,8 @@ namespace MonoTests.System.Data
[Test] public void WriteXmlSchema_Relations_ForeignKeys ()
{
MemoryStream ms = null;
MemoryStream ms1 = null;
System.IO.MemoryStream ms = null;
System.IO.MemoryStream ms1 = null;
DataSet ds1 = new DataSet();
@@ -2884,10 +2884,10 @@ namespace MonoTests.System.Data
new DataColumn[] {col1_5, col1_6},
new DataColumn[] {col2_5, col2_6});
ms = new MemoryStream();
ms = new System.IO.MemoryStream();
ds1.WriteXmlSchema (ms);
ms1 = new MemoryStream (ms.GetBuffer());
ms1 = new System.IO.MemoryStream (ms.GetBuffer());
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(ms1);
@@ -3096,18 +3096,18 @@ namespace MonoTests.System.Data
[Test] public void WriteXml_ByTextWriterXmlWriteMode()
{
StringReader sr = null;
StringWriter sw = null;
System.IO.StringReader sr = null;
System.IO.StringWriter sw = null;
try // For real
{
// ReadXml - DataSetOut
DataSet oDataset = new DataSet("DataSetOut");
sw = new StringWriter();
oDataset.WriteXml(sw, XmlWriteMode.WriteSchema);
sw = new System.IO.StringWriter();
oDataset.WriteXml(sw,System.Data.XmlWriteMode.WriteSchema);
sr = new StringReader(sw.GetStringBuilder().ToString());
sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
oDataset = new DataSet("DataSetOut");
oDataset.ReadXml(sr);
@@ -3252,13 +3252,13 @@ namespace MonoTests.System.Data
{
DataSet ds = new DataSet();
string input = "<a><b><c>2</c></b></a>";
StringReader sr = new StringReader(input) ;
XmlTextReader xReader = new XmlTextReader(sr) ;
System.IO.StringReader sr = new System.IO.StringReader(input) ;
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
ds.ReadXml (xReader);
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
XmlTextWriter xWriter = new XmlTextWriter(sw);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter(sb);
System.Xml.XmlTextWriter xWriter = new System.Xml.XmlTextWriter(sw);
ds.WriteXml(xWriter);
string output = sb.ToString();
Assert.AreEqual(input,output, "DS76");
@@ -3267,20 +3267,20 @@ namespace MonoTests.System.Data
DataSet ds = new DataSet();
string input = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><a><b><c>2</c></b></a>";
string expectedOutput = "<a><b><c>2</c></b></a>";
StringReader sr = new StringReader(input) ;
XmlTextReader xReader = new XmlTextReader(sr) ;
System.IO.StringReader sr = new System.IO.StringReader(input) ;
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
ds.ReadXml (xReader);
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
XmlTextWriter xWriter = new XmlTextWriter(sw);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter(sb);
System.Xml.XmlTextWriter xWriter = new System.Xml.XmlTextWriter(sw);
ds.WriteXml(xWriter);
string output = sb.ToString();
Assert.AreEqual(expectedOutput,output, "DS77");
}
{
DataSet ds = new DataSet("DSName");
StringWriter sr = new StringWriter();
System.IO.StringWriter sr = new System.IO.StringWriter();
ds.WriteXml(sr);
Assert.AreEqual("<DSName />",sr.ToString(), "DS78");
}
@@ -3315,7 +3315,7 @@ namespace MonoTests.System.Data
ds.Tables.Remove("ChildTable");
//Get the xml representation of the dataset.
StringWriter sr = new StringWriter();
System.IO.StringWriter sr = new System.IO.StringWriter();
ds.WriteXml(sr);
string xml = sr.ToString();
@@ -28,12 +28,10 @@
using NUnit.Framework;
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class DataTableCollectionTest2
{
@@ -145,7 +143,7 @@ namespace MonoTests.System.Data
{
counter = 0;
DataSet ds = new DataSet();
ds.Tables.CollectionChanged+=new CollectionChangeEventHandler(Tables_CollectionChanged);
ds.Tables.CollectionChanged+=new System.ComponentModel.CollectionChangeEventHandler(Tables_CollectionChanged);
ds.Tables.Add();
ds.Tables.Add();
Assert.AreEqual(2, counter, "DTC15");
@@ -155,7 +153,7 @@ namespace MonoTests.System.Data
Assert.AreEqual(4, counter, "DTC16");
}
private void Tables_CollectionChanged(object sender, CollectionChangeEventArgs e)
private void Tables_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
{
counter++;
}
@@ -165,7 +163,7 @@ namespace MonoTests.System.Data
{
counter = 0;
DataSet ds = new DataSet();
ds.Tables.CollectionChanging+=new CollectionChangeEventHandler(Tables_CollectionChanging);
ds.Tables.CollectionChanging+=new System.ComponentModel.CollectionChangeEventHandler(Tables_CollectionChanging);
ds.Tables.Add();
ds.Tables.Add();
Assert.AreEqual(2, counter, "DTC17");
@@ -175,7 +173,7 @@ namespace MonoTests.System.Data
Assert.AreEqual(4, counter, "DTC18");
}
private void Tables_CollectionChanging(object sender, CollectionChangeEventArgs e)
private void Tables_CollectionChanging(object sender, System.ComponentModel.CollectionChangeEventArgs e)
{
counter++;
}
@@ -235,7 +233,7 @@ namespace MonoTests.System.Data
ds.Tables.Add();
int count=0;
IEnumerator myEnumerator = ds.Tables.GetEnumerator();
System.Collections.IEnumerator myEnumerator = ds.Tables.GetEnumerator();
while (myEnumerator.MoveNext())
{
@@ -36,7 +36,7 @@ using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture]
public class DataTableTest2
@@ -31,7 +31,7 @@ using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace Monotests_System.Data
{
[TestFixture]
public class DataTableTest3
@@ -31,7 +31,7 @@ using System.IO;
using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace Monotests_System.Data
{
[TestFixture]
public class DataTableTest4
@@ -1600,7 +1600,7 @@ namespace MonoTests.System.Data
DataSet ds = new DataSet ();
DataTable table = new DataTable ("ParentTable");
XmlReadMode mode = XmlReadMode.Auto;
table.Columns.Add (new DataColumn ("id", Type.GetType ("System.Int32")));
table.Columns.Add (new DataColumn ("id", System.Type.GetType ("System.Int32")));
ds.Tables.Add (table);
using (FileStream stream = new FileStream (tempFile, FileMode.Open)) {
@@ -1638,7 +1638,7 @@ namespace MonoTests.System.Data
using (FileStream stream = new FileStream (tempFile, FileMode.Open)) {
DataSet ds = new DataSet ();
DataTable table = new DataTable ("Table1");
table.Columns.Add (new DataColumn ("id", Type.GetType ("System.Int32")));
table.Columns.Add (new DataColumn ("id", System.Type.GetType ("System.Int32")));
ds.Tables.Add (table);
try {
@@ -1852,7 +1852,7 @@ namespace MonoTests.System.Data
DataTable table = new DataTable ("DummyTable");
//define the table schame partially with a column name which does not match with any
//table columns in the diffgram
table.Columns.Add (new DataColumn ("WrongColumnName", Type.GetType ("System.String")));
table.Columns.Add (new DataColumn ("WrongColumnName", System.Type.GetType ("System.String")));
XmlReadMode mode = XmlReadMode.Auto;
@@ -2013,8 +2013,8 @@ namespace MonoTests.System.Data
Assert.AreEqual ("NewDataSet", table.DataSet.DataSetName, "#2");
Assert.AreEqual (2, table.Columns.Count, "#3");
Assert.AreEqual (2, table.Rows.Count, "#4");
Assert.AreEqual (typeof (Int32), table.Columns [0].DataType, "#5");
Assert.AreEqual (typeof (String), table.Columns [1].DataType, "#6");
Assert.AreEqual (typeof (System.Int32), table.Columns [0].DataType, "#5");
Assert.AreEqual (typeof (System.String), table.Columns [1].DataType, "#6");
Assert.AreEqual (1, table.Constraints.Count, "#7");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [0].GetType (), "#8");
Assert.AreEqual (1, table.ChildRelations.Count, "#9");
@@ -2027,9 +2027,9 @@ namespace MonoTests.System.Data
Assert.AreEqual ("NewDataSet", table1.DataSet.DataSetName, "#14");
Assert.AreEqual (3, table1.Columns.Count, "#15");
Assert.AreEqual (4, table1.Rows.Count, "#16");
Assert.AreEqual (typeof (Int32), table1.Columns [0].DataType, "#17");
Assert.AreEqual (typeof (String), table1.Columns [1].DataType, "#18");
Assert.AreEqual (typeof (Int32), table1.Columns [2].DataType, "#19");
Assert.AreEqual (typeof (System.Int32), table1.Columns [0].DataType, "#17");
Assert.AreEqual (typeof (System.String), table1.Columns [1].DataType, "#18");
Assert.AreEqual (typeof (System.Int32), table1.Columns [2].DataType, "#19");
Assert.AreEqual (2, table1.Constraints.Count, "#20");
Assert.AreEqual (typeof (UniqueConstraint), table1.Constraints [0].GetType (), "#21");
Assert.AreEqual (typeof (ForeignKeyConstraint), table1.Constraints [1].GetType (), "#22");
@@ -2045,8 +2045,8 @@ namespace MonoTests.System.Data
Assert.AreEqual ("NewDataSet", table1.DataSet.DataSetName, "#29");
Assert.AreEqual (2, table1.Columns.Count, "#30");
Assert.AreEqual (8, table1.Rows.Count, "#31");
Assert.AreEqual (typeof (Int32), table1.Columns [0].DataType, "#32");
Assert.AreEqual (typeof (String), table1.Columns [1].DataType, "#33");
Assert.AreEqual (typeof (System.Int32), table1.Columns [0].DataType, "#32");
Assert.AreEqual (typeof (System.String), table1.Columns [1].DataType, "#33");
Assert.AreEqual (1, table1.Constraints.Count, "#34");
Assert.AreEqual (typeof (ForeignKeyConstraint), table1.Constraints [0].GetType (), "#35");
Assert.AreEqual (1, table1.ParentRelations.Count, "#36");
@@ -34,7 +34,7 @@ using System.Xml.Serialization;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace Monotests_System.Data
{
[TestFixture]
public class DataTableTest5
@@ -28,13 +28,12 @@
using NUnit.Framework;
using System;
using System.Collections;
using System.ComponentModel;
using System.IO;
using System.ComponentModel;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class DataViewTest2
{
@@ -42,7 +41,7 @@ namespace MonoTests.System.Data
class EventProperties //hold the event properties to be checked
{
public ListChangedType lstType ;
public System.ComponentModel.ListChangedType lstType ;
public int NewIndex;
public int OldIndex;
}
@@ -509,7 +508,7 @@ namespace MonoTests.System.Data
//create the dataview for the table
DataView dv = new DataView(dt);
IEnumerator ienm = null;
System.Collections.IEnumerator ienm = null;
// GetEnumerator != null
ienm = dv.GetEnumerator();
@@ -550,7 +549,7 @@ namespace MonoTests.System.Data
DataView dv = new DataView(dt);
//add event handler
dv.ListChanged +=new ListChangedEventHandler(dv_ListChanged);
dv.ListChanged +=new System.ComponentModel.ListChangedEventHandler(dv_ListChanged);
// ----- Change Value ---------
evProp = null;
@@ -558,7 +557,7 @@ namespace MonoTests.System.Data
dv[1]["String1"] = "something";
Assert.AreEqual(true , evProp!=null , "DV58");
// change value - ListChangedType
Assert.AreEqual(ListChangedType.ItemChanged, evProp.lstType , "DV59");
Assert.AreEqual(System.ComponentModel.ListChangedType.ItemChanged, evProp.lstType , "DV59");
// change value - NewIndex
Assert.AreEqual(1, evProp.NewIndex, "DV60");
// change value - OldIndex
@@ -570,7 +569,7 @@ namespace MonoTests.System.Data
dv.AddNew();
Assert.AreEqual(true , evProp!=null , "DV62");
// Add New - ListChangedType
Assert.AreEqual(ListChangedType.ItemAdded , evProp.lstType , "DV63");
Assert.AreEqual(System.ComponentModel.ListChangedType.ItemAdded , evProp.lstType , "DV63");
// Add New - NewIndex
Assert.AreEqual(6, evProp.NewIndex, "DV64");
// Add New - OldIndex
@@ -582,7 +581,7 @@ namespace MonoTests.System.Data
dv.Sort = "ParentId Desc";
Assert.AreEqual(true , evProp!=null , "DV66");
// sort - ListChangedType
Assert.AreEqual(ListChangedType.Reset , evProp.lstType , "DV67");
Assert.AreEqual(System.ComponentModel.ListChangedType.Reset , evProp.lstType , "DV67");
// sort - NewIndex
Assert.AreEqual(-1, evProp.NewIndex, "DV68");
// sort - OldIndex
@@ -628,12 +627,12 @@ namespace MonoTests.System.Data
Assert.AreEqual(true , evProp != null , "DV168");
// Clear DataTable - should emit ListChangedType.Reset
Assert.AreEqual(ListChangedType.Reset , evProp.lstType , "DV169");
Assert.AreEqual(System.ComponentModel.ListChangedType.Reset , evProp.lstType , "DV169");
// Clear DataTable - should clear view count
Assert.AreEqual(0, dt.DefaultView.Count , "DV169");
}
private void dv_ListChanged(object sender, ListChangedEventArgs e)
private void dv_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
{
evProp = new EventProperties();
evProp.lstType = e.ListChangedType;
@@ -647,7 +646,7 @@ namespace MonoTests.System.Data
// this test also check DataView.Count property
DataRowView[] drvResult = null;
ArrayList al = new ArrayList();
System.Collections.ArrayList al = new System.Collections.ArrayList();
//create the source datatable
DataTable dt = DataProvider.CreateChildDataTable();
@@ -764,7 +763,7 @@ namespace MonoTests.System.Data
*/
//DataRowView[] drvResult = null;
ArrayList al = new ArrayList();
System.Collections.ArrayList al = new System.Collections.ArrayList();
DataTable dt = DataProvider.CreateParentDataTable();
@@ -822,7 +821,7 @@ namespace MonoTests.System.Data
private DataRow[] GetResultRows(DataTable dt,DataRowState State)
{
//get expected rows
ArrayList al = new ArrayList();
System.Collections.ArrayList al = new System.Collections.ArrayList();
DataRowVersion drVer = DataRowVersion.Current;
//From MSDN - The row the default version for the current DataRowState.
@@ -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 DeletedRowInaccessibleExceptionTest
{
@@ -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 DuplicateNameExceptionTest
{
@@ -33,7 +33,7 @@ using System.IO;
using System.Data;
//using GHTUtils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class EvaluateExceptionTest
{
@@ -31,7 +31,7 @@ using System;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class ForeignKeyConstraintTest2
{
@@ -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 InRowChangingEventExceptionTest
{
@@ -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 InvalidConstraintExceptionTest
{
@@ -32,7 +32,7 @@ using System.Data;
using NUnit.Framework;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture]
class MissingPrimaryKeyExceptionTest
@@ -57,4 +57,4 @@ namespace MonoTests.System.Data
tbl.Rows.Contains("Something");
}
}
}
}
@@ -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 NoNullAllowedExceptionTest
{
@@ -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 ReadOnlyExceptionTest
{
@@ -31,7 +31,7 @@ using System;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class RowNotInTableExceptionTest
{
@@ -32,7 +32,7 @@ using System.Text;
using System.IO;
using System.Data;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class SyntaxErrorExceptionTest
{
@@ -2,7 +2,7 @@ using NUnit.Framework;
using System;
using System.Data;
namespace MonoTests.System.Data
namespace Monotests_Mono.Data.SqlExpressions
{
[TestFixture]
public class ComparisonTest {
@@ -10,7 +10,7 @@ namespace MonoTests.System.Data
[Test]
public void TestStringTrailingSpaceHandling () {
// test for bug 79695 - does not ignore certain trailing whitespace chars when comparing strings
DataTable dataTable = new DataTable ("Person");
System.Data.DataTable dataTable = new System.Data.DataTable ("Person");
dataTable.Columns.Add ("Name", typeof (string));
dataTable.Rows.Add (new object[] {"Mike "});
DataRow[] selectedRows = dataTable.Select ("Name = 'Mike'");
@@ -31,7 +31,7 @@ using System;
using System.Data;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture] public class UniqueConstraintTest2
{
@@ -32,7 +32,7 @@ using System.Data;
using NUnit.Framework;
using MonoTests.System.Data.Utils;
namespace MonoTests.System.Data
namespace MonoTests_System.Data
{
[TestFixture]
class VersionNotFoundExceptionTest
@@ -73,4 +73,4 @@ namespace MonoTests.System.Data
object obj = drParent[0,DataRowVersion.Original];
}
}
}
}
@@ -32,7 +32,7 @@ using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace Monotests_System.Data
{
[TestFixture]
public class XmlDataLoaderTest
@@ -74,7 +74,7 @@ namespace MonoTests.System.Data
DataSet ds = new DataSet ("Set");
DataTable dt = new DataTable ("Test");
dt.Columns.Add ("CustName", typeof (String));
dt.Columns.Add ("Type", typeof (Type));
dt.Columns.Add ("Type", typeof (System.Type));
ds.Tables.Add (dt);
return ds;
}
@@ -33,7 +33,7 @@ using System.Xml.Serialization;
using System.Xml.Schema;
using NUnit.Framework;
namespace MonoTests.System.Data
namespace Monotests_System.Data
{
[TestFixture]
public class XmlDataReaderTest
@@ -103,7 +103,7 @@ namespace MonoTests.System.Data
StringReader sr = new StringReader (xml);
XmlTextReader xr = new XmlTextReader (sr);
DataTable tbl = new DataTable("CustomTypesTable");
tbl.Columns.Add("Dummy", typeof(UInt32));
tbl.Columns.Add("Dummy", typeof(System.UInt32));
tbl.Columns.Add("FuncXml", typeof(CustomTypeXml));
DataSet ds = new DataSet("CustomTypesData");
+1 -1
View File
@@ -21,7 +21,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid mobile mobile_static xammac net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.Async.dll
NO_SIGN_ASSEMBLY = yes
@@ -22,7 +22,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.Providers.dll
NO_SIGN_ASSEMBLY = yes
+1 -1
View File
@@ -21,7 +21,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.dll
NO_SIGN_ASSEMBLY = yes
@@ -120,17 +120,9 @@ namespace System.Net.Http.Headers
public string Name {
get {
var value = FindParameter ("name");
if (value == null)
return null;
return DecodeValue (value, false);
return FindParameter ("name");
}
set {
if (value != null)
value = EncodeBase64Value (value);
SetValue ("name", value);
}
}
@@ -170,7 +170,7 @@ namespace System.Net.Http.Headers
} else {
value.From = nvalue;
t = lexer.Scan (recognizeDash: true);
t = lexer.Scan ();
if (t != Token.Type.SeparatorDash)
return false;
@@ -96,7 +96,6 @@ namespace System.Net.Http.Headers
HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateSingle<CacheControlHeaderValue> ("Cache-Control", CacheControlHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
HeaderInfo.CreateMulti<string> ("Connection", CollectionParser.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
HeaderInfo.CreateSingle<ContentDispositionHeaderValue> ("Content-Disposition", ContentDispositionHeaderValue.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateMulti<string> ("Content-Encoding", CollectionParser.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateMulti<string> ("Content-Language", CollectionParser.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateSingle<long> ("Content-Length", Parser.Long.TryParse, HttpHeaderKind.Content),
@@ -247,7 +247,7 @@ namespace System.Net.Http.Headers
return false;
}
public Token Scan (bool recognizeDash = false)
public Token Scan ()
{
int start = pos;
if (s == null)
@@ -279,12 +279,8 @@ namespace System.Net.Http.Headers
ttype = Token.Type.SeparatorSlash;
break;
case '-':
if (recognizeDash) {
ttype = Token.Type.SeparatorDash;
break;
}
goto default;
ttype = Token.Type.SeparatorDash;
break;
case ',':
ttype = Token.Type.SeparatorComma;
break;
@@ -127,7 +127,7 @@ namespace System.Net.Http.Headers
int number;
token_read = false;
t = lexer.Scan (recognizeDash: true);
t = lexer.Scan ();
switch (t.Kind) {
case Token.Type.SeparatorDash:
t = lexer.Scan ();
@@ -144,7 +144,7 @@ namespace System.Net.Http.Headers
switch (values.Length) {
case 1:
t = lexer.Scan (recognizeDash: true);
t = lexer.Scan ();
from = number;
switch (t.Kind) {
case Token.Type.SeparatorDash:
@@ -50,6 +50,7 @@ namespace System.Net.Http
bool useProxy;
ClientCertificateOption certificate;
bool sentRequest;
HttpWebRequest wrequest;
string connectionGroupName;
bool disposed;
@@ -220,9 +221,12 @@ namespace System.Net.Http
protected override void Dispose (bool disposing)
{
if (disposing && !disposed) {
if (disposing) {
if (wrequest != null) {
wrequest.ServicePoint.CloseConnectionGroup (wrequest.ConnectionGroupName);
Volatile.Write (ref wrequest, null);
}
Volatile.Write (ref disposed, true);
ServicePointManager.CloseConnectionGroup (connectionGroupName);
}
base.Dispose (disposing);
@@ -313,7 +317,7 @@ namespace System.Net.Http
throw new ObjectDisposedException (GetType ().ToString ());
Volatile.Write (ref sentRequest, true);
var wrequest = CreateWebRequest (request);
wrequest = CreateWebRequest (request);
if (request.Content != null) {
var headers = wrequest.Headers;
@@ -239,33 +239,6 @@ namespace MonoTests.System.Net.Http.Headers
Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%C4%8D"), value.Parameters.First (), "#12");
}
[Test]
public void Properties_Name ()
{
var value = new ContentDispositionHeaderValue ("a");
value.Name = "aa";
Assert.AreEqual ("aa", value.Name, "#1");
Assert.AreEqual (new NameValueHeaderValue ("name", "aa"), value.Parameters.First (), "#2");
value.Name = "č";
Assert.AreEqual ("č", value.Name, "#11");
Assert.AreEqual (new NameValueHeaderValue ("name", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#12");
value.Name = "(@)";
Assert.AreEqual ("\"(@)\"", value.Name, "#21");
Assert.AreEqual (new NameValueHeaderValue ("name", "\"(@)\""), value.Parameters.First (), "#22");
value.Name = "\"č\"";
Assert.AreEqual ("č", value.Name, "#31");
Assert.AreEqual (new NameValueHeaderValue ("name", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#32");
value.Name = "\"quoted\"";
Assert.AreEqual ("\"quoted\"", value.Name, "#41");
Assert.AreEqual (new NameValueHeaderValue ("name", "\"quoted\""), value.Parameters.First (), "#42");
}
[Test]
public void Properties_ModificationDate ()
{
@@ -31,7 +31,6 @@ using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using System.Net.Http.Headers;
using System.Linq;
namespace MonoTests.System.Net.Http.Headers
{
@@ -82,13 +81,6 @@ namespace MonoTests.System.Net.Http.Headers
Assert.AreEqual ("mu/m", res.MediaType, "#2");
Assert.AreEqual ("jj'", res.CharSet, "#2b");
Assert.AreEqual ("mu/m; CHarset=jj'", res.ToString (), "#2c");
res = MediaTypeHeaderValue.Parse ("multipart/form-data; boundary=----Wk");
Assert.AreEqual ("multipart/form-data", res.MediaType, "#3");
Assert.IsNull (res.CharSet, "#3b");
Assert.AreEqual (1, res.Parameters.Count, "#3c");
Assert.AreEqual (new NameValueHeaderValue ("boundary", "----Wk"), res.Parameters.First (), "#3d");
Assert.AreEqual ("multipart/form-data; boundary=----Wk", res.ToString (), "#3e");
}
[Test]
@@ -222,7 +222,6 @@ namespace MonoTests.System.Net.Http
Assert.AreEqual (330, scm.Headers.ContentLength, "#2");
headers.Allow.Add ("a1");
headers.ContentDisposition = new ContentDispositionHeaderValue ("cd1");
headers.ContentEncoding.Add ("ce1");
headers.ContentLanguage.Add ("cl1");
headers.ContentLength = 23;
@@ -235,12 +234,6 @@ namespace MonoTests.System.Net.Http
headers.Add ("allow", "a2");
try {
headers.Add ("content-disposition", "cd2");
Assert.Fail ("content-disposition");
} catch (FormatException) {
}
headers.Add ("content-encoding", "ce3");
headers.Add ("content-language", "cl2");
@@ -314,7 +307,6 @@ namespace MonoTests.System.Net.Http
Assert.AreEqual (new MediaTypeHeaderValue ("multipart/*"), headers.ContentType);
Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.Expires);
Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.LastModified);
Assert.AreEqual (new ContentDispositionHeaderValue ("cd1"), headers.ContentDisposition);
}
[Test]
@@ -1,12 +1,10 @@
//
// System.Numerics.BigInteger
//
// Authors:
// Rodrigo Kumpera ([email protected])
// Marek Safar <[email protected]>
// Rodrigo Kumpera ([email protected])
//
// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -70,6 +68,7 @@ namespace System.Numerics {
readonly uint[] data;
readonly short sign;
static readonly uint[] ZERO = new uint [1];
static readonly uint[] ONE = new uint [1] { 1 };
BigInteger (short sign, uint[] data)
@@ -82,7 +81,7 @@ namespace System.Numerics {
{
if (value == 0) {
sign = 0;
data = null;
data = ZERO;
} else if (value > 0) {
sign = 1;
data = new uint[] { (uint) value };
@@ -97,7 +96,7 @@ namespace System.Numerics {
{
if (value == 0) {
sign = 0;
data = null;
data = ZERO;
} else {
sign = 1;
data = new uint [1] { value };
@@ -108,7 +107,7 @@ namespace System.Numerics {
{
if (value == 0) {
sign = 0;
data = null;
data = ZERO;
} else if (value > 0) {
sign = 1;
uint low = (uint)value;
@@ -136,7 +135,7 @@ namespace System.Numerics {
{
if (value == 0) {
sign = 0;
data = null;
data = ZERO;
} else {
sign = 1;
uint low = (uint)value;
@@ -181,7 +180,7 @@ namespace System.Numerics {
int exponent = Exponent (bytes);
if (exponent == 0) {
sign = 0;
data = null;
data = ZERO;
return;
}
@@ -218,7 +217,7 @@ namespace System.Numerics {
if (size == 0) {
sign = 0;
data = null;
data = ZERO;
return;
}
@@ -242,7 +241,7 @@ namespace System.Numerics {
if (len == 0 || (len == 1 && value [0] == 0)) {
sign = 0;
data = null;
data = ZERO;
return;
}
@@ -255,7 +254,7 @@ namespace System.Numerics {
while (value [len - 1] == 0) {
if (--len == 0) {
sign = 0;
data = null;
data = ZERO;
return;
}
}
@@ -457,12 +456,12 @@ namespace System.Numerics {
}
public static BigInteger Zero {
get { return new BigInteger (0); }
get { return new BigInteger (0, ZERO); }
}
public static explicit operator int (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return 0;
if (value.data.Length > 1)
throw new OverflowException ();
@@ -484,7 +483,7 @@ namespace System.Numerics {
[CLSCompliantAttribute (false)]
public static explicit operator uint (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return 0;
if (value.data.Length > 1 || value.sign == -1)
throw new OverflowException ();
@@ -528,7 +527,7 @@ namespace System.Numerics {
public static explicit operator long (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return 0;
if (value.data.Length > 2)
@@ -570,7 +569,7 @@ namespace System.Numerics {
[CLSCompliantAttribute (false)]
public static explicit operator ulong (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return 0;
if (value.data.Length > 2 || value.sign == -1)
throw new OverflowException ();
@@ -585,10 +584,9 @@ namespace System.Numerics {
public static explicit operator double (BigInteger value)
{
if (value.data == null)
return 0.0;
switch (value.data.Length) {
case 0:
return 0.0;
case 1:
return BuildDouble (value.sign, value.data [0], 0);
case 2:
@@ -615,7 +613,7 @@ namespace System.Numerics {
public static explicit operator decimal (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return Decimal.Zero;
uint[] data = value.data;
@@ -705,7 +703,7 @@ namespace System.Numerics {
int r = CoreCompare (left.data, right.data);
if (r == 0)
return Zero;
return new BigInteger (0, ZERO);
if (r > 0) //left > right
return new BigInteger (left.sign, CoreSub (left.data, right.data));
@@ -724,7 +722,7 @@ namespace System.Numerics {
int r = CoreCompare (left.data, right.data);
if (r == 0)
return Zero;
return new BigInteger (0, ZERO);
if (r > 0) //left > right
return new BigInteger (left.sign, CoreSub (left.data, right.data));
@@ -738,7 +736,7 @@ namespace System.Numerics {
public static BigInteger operator* (BigInteger left, BigInteger right)
{
if (left.sign == 0 || right.sign == 0)
return Zero;
return new BigInteger (0, ZERO);
if (left.data [0] == 1 && left.data.Length == 1) {
if (left.sign == 1)
@@ -799,7 +797,7 @@ namespace System.Numerics {
int i;
for (i = quotient.Length - 1; i >= 0 && quotient [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < quotient.Length - 1)
quotient = Resize (quotient, i + 1);
@@ -822,7 +820,7 @@ namespace System.Numerics {
int i;
for (i = remainder_value.Length - 1; i >= 0 && remainder_value [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < remainder_value.Length - 1)
remainder_value = Resize (remainder_value, i + 1);
@@ -831,7 +829,7 @@ namespace System.Numerics {
public static BigInteger operator- (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return value;
return new BigInteger ((short)-value.sign, value.data);
}
@@ -843,14 +841,14 @@ namespace System.Numerics {
public static BigInteger operator++ (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return One;
short sign = value.sign;
uint[] data = value.data;
if (data.Length == 1) {
if (sign == -1 && data [0] == 1)
return Zero;
return new BigInteger (0, ZERO);
if (sign == 0)
return new BigInteger (1, ONE);
}
@@ -865,14 +863,14 @@ namespace System.Numerics {
public static BigInteger operator-- (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return MinusOne;
short sign = value.sign;
uint[] data = value.data;
if (data.Length == 1) {
if (sign == 1 && data [0] == 1)
return Zero;
return new BigInteger (0, ZERO);
if (sign == 0)
return new BigInteger (-1, ONE);
}
@@ -937,7 +935,7 @@ namespace System.Numerics {
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < result.Length - 1)
result = Resize (result, i + 1);
@@ -997,7 +995,7 @@ namespace System.Numerics {
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < result.Length - 1)
result = Resize (result, i + 1);
@@ -1057,7 +1055,7 @@ namespace System.Numerics {
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < result.Length - 1)
result = Resize (result, i + 1);
@@ -1067,7 +1065,7 @@ namespace System.Numerics {
public static BigInteger operator~ (BigInteger value)
{
if (value.data == null)
if (value.sign == 0)
return new BigInteger (-1, ONE);
uint[] data = value.data;
@@ -1101,7 +1099,7 @@ namespace System.Numerics {
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < result.Length - 1)
result = Resize (result, i + 1);
@@ -1123,7 +1121,7 @@ namespace System.Numerics {
public static BigInteger operator<< (BigInteger value, int shift)
{
if (shift == 0 || value.data == null)
if (shift == 0 || value.sign == 0)
return value;
if (shift < 0)
return value >> -shift;
@@ -1179,7 +1177,7 @@ namespace System.Numerics {
if (size <= 0) {
if (sign == 1)
return Zero;
return new BigInteger (0, ZERO);
return new BigInteger (-1, ONE);
}
@@ -2144,7 +2142,7 @@ namespace System.Numerics {
int i;
for (i = remainder_value.Length - 1; i >= 0 && remainder_value [i] == 0; --i) ;
if (i == -1) {
remainder = Zero;
remainder = new BigInteger (0, ZERO);
} else {
if (i < remainder_value.Length - 1)
remainder_value = Resize (remainder_value, i + 1);
@@ -2153,7 +2151,7 @@ namespace System.Numerics {
for (i = quotient.Length - 1; i >= 0 && quotient [i] == 0; --i) ;
if (i == -1)
return Zero;
return new BigInteger (0, ZERO);
if (i < quotient.Length - 1)
quotient = Resize (quotient, i + 1);
@@ -2266,7 +2264,7 @@ namespace System.Numerics {
if (baseValue == 0.0d || baseValue == Double.PositiveInfinity)
return value.IsOne ? 0 : double.NaN;
if (value.data == null)
if (value.sign == 0)
return double.NegativeInfinity;
int length = value.data.Length - 1;
@@ -70,7 +70,6 @@ namespace MonoTests.System.Numerics
NfiUser.PercentNegativePattern = 2;
NfiUser.PercentPositivePattern = 2;
NfiUser.PercentSymbol = "%%%";
NfiUser.NumberDecimalSeparator = ".";
}
[Test]
@@ -626,12 +625,10 @@ namespace MonoTests.System.Numerics
Assert.IsTrue (new BigInteger (1).IsOne, "#7");
Assert.IsTrue (new BigInteger (32).IsPowerOfTwo, "#8");
Assert.IsTrue (new BigInteger (0).IsZero, "#9");
Assert.IsTrue (new BigInteger ().IsZero, "#9b");
Assert.AreEqual (0, new BigInteger (0).Sign, "#10");
Assert.AreEqual (-1, new BigInteger (-99999).Sign, "#11");
Assert.IsFalse (new BigInteger (0).IsPowerOfTwo, "#12");
Assert.IsFalse (new BigInteger ().IsPowerOfTwo, "#12b");
Assert.IsFalse (new BigInteger (-16).IsPowerOfTwo, "#13");
Assert.IsTrue (new BigInteger (1).IsPowerOfTwo, "#14");
}
@@ -650,7 +647,6 @@ namespace MonoTests.System.Numerics
Assert.AreEqual ("0000000005", new BigInteger (5).ToString ("d10"), "#2");
Assert.AreEqual ("0A8", new BigInteger (168).ToString ("X"), "#3");
Assert.AreEqual ("0", new BigInteger (0).ToString ("X"), "#4");
Assert.AreEqual ("0", new BigInteger ().ToString ("X"), "#4b");
Assert.AreEqual ("1", new BigInteger (1).ToString ("X"), "#5");
Assert.AreEqual ("0A", new BigInteger (10).ToString ("X"), "#6");
Assert.AreEqual ("F6", new BigInteger (-10).ToString ("X"), "#7");
@@ -754,7 +750,6 @@ namespace MonoTests.System.Numerics
Assert.AreEqual (new byte[] { 0x7F }, new BigInteger (0x7F).ToByteArray (), "#10");
Assert.AreEqual (new byte[] { 0x45, 0xCC, 0xD0 }, new BigInteger (-0x2F33BB).ToByteArray (), "#11");
Assert.AreEqual (new byte[] { 0 }, new BigInteger (0).ToByteArray (), "#12");
Assert.AreEqual (new byte[] { 0 }, new BigInteger ().ToByteArray (), "#13");
}
[Test]
@@ -891,14 +886,6 @@ namespace MonoTests.System.Numerics
Assert.AreEqual (-1m, (decimal)new BigInteger (-1), "#6");
Assert.AreEqual (9999999999999999999999999999m,
(decimal)new BigInteger (9999999999999999999999999999m), "#7");
Assert.AreEqual (0m, (decimal)new BigInteger (), "#8");
}
[SetCulture ("pt-BR")]
[Test]
public void Parse_pt_BR ()
{
Parse ();
}
[Test]
@@ -951,8 +938,7 @@ namespace MonoTests.System.Numerics
Assert.AreEqual (-23, (int)BigInteger.Parse(" -23 ", NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite), "#19");
Assert.AreEqual (300000, (int)BigInteger.Parse("3E5", NumberStyles.AllowExponent), "#20");
var dsep = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator;
Assert.AreEqual (250, (int)BigInteger.Parse("2" + dsep + "5E2", NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint), "#21");//2.5E2 = 250
Assert.AreEqual (250, (int)BigInteger.Parse("2"+Nfi.NumberDecimalSeparator+"5E2", NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint), "#21");//2.5E2 = 250
Assert.AreEqual (25, (int)BigInteger.Parse("2500E-2", NumberStyles.AllowExponent), "#22");
Assert.AreEqual ("136236974127783066520110477975349088954559032721408", BigInteger.Parse("136236974127783066520110477975349088954559032721408", NumberStyles.None).ToString(), "#23");
@@ -965,7 +951,7 @@ namespace MonoTests.System.Numerics
}
try {
Int32.Parse ("2" + dsep + "09E1", NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent);
Int32.Parse ("2.09E1", NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent);
Assert.Fail ("#26");
} catch (OverflowException) {
}
@@ -1290,9 +1276,6 @@ namespace MonoTests.System.Numerics
a = new BigInteger ();
Assert.AreEqual (BigInteger.Zero.GetHashCode (), a.GetHashCode (), "#15");
a = new BigInteger ();
Assert.AreEqual (BigInteger.Zero, a, "#16");
}
[Test]
+1 -1
View File
@@ -35,7 +35,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Core.dll
NO_SIGN_ASSEMBLY = yes
+1 -1
View File
@@ -24,7 +24,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Debugger.dll
NO_SIGN_ASSEMBLY = yes
@@ -24,7 +24,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Experimental.dll
NO_SIGN_ASSEMBLY = yes
@@ -21,7 +21,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = more_build_args
VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Interfaces.dll
NO_SIGN_ASSEMBLY = yes
Loaded 100 of 350 files, more files were not shown because too many files have changed in this diff. Show more