Compare commits

...
178 Commits
Author SHA1 Message Date
Zoltan Varga 470791b186 2009-01-09 Zoltan Varga <[email protected]>
Backport of r122907.
	
	* CustomAttributeData.cs (ToString): Applied patch from Leszek Ciesielski
	<[email protected]>. Use DeclaringType.FullName instead of DeclaringType.Name.
	Fixes #464830.

svn path=/branches/mono-2-2/mcs/; revision=122909
2009-01-09 16:05:52 +00:00
Marek Habersack 3887d81f8e Backport of r122891.
svn path=/branches/mono-2-2/mcs/; revision=122892
2009-01-09 14:38:26 +00:00
Geoff Norton 11072be5ed 2009-01-08 Geoff Norton <[email protected]>
* processes.c: Fix the osx version check to properly detect 10.5 v 10.4

svn path=/branches/mono-2-2/mono/; revision=122853
2009-01-09 02:32:27 +00:00
Marek Habersack 4291f2a73b Backport of r122839.
svn path=/branches/mono-2-2/mcs/; revision=122841
2009-01-08 23:51:36 +00:00
Rusty Howell 5b8bf83ccd simple checkin to trigger build
svn path=/branches/mono-2-2/mono/; revision=122733
2009-01-08 02:15:25 +00:00
Zoltan Varga 1fd0386f87 2008-12-16 Zoltan Varga <[email protected]>
* class.c (mono_class_get_fields): Handle loading errors.

svn path=/branches/mono-2-2/mono/; revision=122714
2009-01-07 21:00:16 +00:00
Zoltan Varga 9de1e8b272 2009-01-07 Zoltan Varga <[email protected]>
Backport of 122702.
	
	* mini-arm.c (mono_arch_flush_icache): Use __GNUC_PREREQ instead of checking
	__GNUC_MINOR__ which can break when the major version changes.

svn path=/branches/mono-2-2/mono/; revision=122704
2009-01-07 20:10:21 +00:00
Zoltan Varga c02bd27e8f 2009-01-07 Zoltan Varga <[email protected]>
Backport of r122700.
	
	* RxInterpreter.cs: Add support for constant strings in anchors. Fixes
	#464135.

svn path=/branches/mono-2-2/mcs/; revision=122701
2009-01-07 19:51:33 +00:00
Rodrigo Kumpera c146e4e4fd In metadata:
Backport of r122672 - r122675.

	* file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
	return value of GetCurrentDirectory to never access unitialized memory.

	* file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
	return value of GetCurrentDirectory and expand the buffer if needed.

	Fixes #459094.

2009-01-07 Rodrigo Kumpera  <[email protected]>

In io-layer:
2009-01-07 Rodrigo Kumpera  <[email protected]>

	Backport of r122672 - r122675.

	* io.c (GetCurrentDirectory): Avoid calling g_get_current_dir straight
	away as it doesn't handle ENAMETOOLONG correctly. As a bonus we avoid
	allocating memory in the common path.

In tests:
2009-01-07 Rodrigo Kumpera  <[email protected]>

	Backport of r122672 - r122675.

	* bug-459094	.cs: New regression test.

	* Makefile.am: Test added.


svn path=/branches/mono-2-2/mono/; revision=122678
2009-01-07 17:18:06 +00:00
Rodrigo Kumpera 331427f067 In metadata:
2009-01-07 Rodrigo Kumpera  <[email protected]>

	Backport of r122579 - r122585.

	* verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
	interfaces_packed here.

	Fixes part of #463294.

	* verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.

	Fixes part of #463294.

	* verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
	is a boxed complex as well.

	Fixes part of #463294.

In tests/verifier:
2009-01-07 Rodrigo Kumpera <[email protected]>

	Backport of r122579 - r122585.

	* valid_iface_constant_with_parent_implementing_it.il:
	Regression test for #461200.

	* valid_array_compat_with_bonds_and_sizes.il:
	* valid_array_compat_with_bounds.il:
	* valid_array_compat_with_sizes.il: Regression tests for 
	#461200.

	* valid_ceq_with_boxed_vt.il: Regression test for #461200.


svn path=/branches/mono-2-2/mono/; revision=122650
2009-01-07 12:48:50 +00:00
Geoff Norton 37bbac467f 2009-01-07 Geoff Norton <[email protected]>
* processes.c: Only use open -W on OSX 10.5+.  Patch from
        Miguel

svn path=/branches/mono-2-2/mono/; revision=122619
2009-01-07 06:32:03 +00:00
Rodrigo Kumpera 5161c62e10 2009-01-07 Rodrigo Kumpera <[email protected]>
* Vector*.cs: Use explicit layout to avoid the runtime
	miscalculating the size of vector types.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=122608
2009-01-07 04:10:17 +00:00
Gonzalo Paniagua Javier 9458c03da1 ignore test. Bug 464013
svn path=/branches/mono-2-2/mcs/; revision=122603
2009-01-07 02:54:15 +00:00
Zoltan Varga 6179d4a924 2009-01-07 Zoltan Varga <[email protected]>
* AsyncTest.cs: Disable these tests, they fail randomly (bug #463999).

svn path=/branches/mono-2-2/mcs/; revision=122600
2009-01-07 01:21:25 +00:00
Marek Safar 58216b41fb Put back temporary disabled fix.
svn path=/branches/mono-2-2/mcs/; revision=122578
2009-01-06 21:32:06 +00:00
Marek Safar 30a744498e Try to revert major Banshee bug fix.
svn path=/branches/mono-2-2/mcs/; revision=122501
2009-01-05 23:23:19 +00:00
Marek Safar c253f26bc3 Update.
svn path=/branches/mono-2-2/mcs/; revision=122473
2009-01-05 17:58:21 +00:00
Zoltan Varga 6017bcd4ae 2009-01-05 Zoltan Varga <[email protected]>
* branch-opts.c (mono_if_conversion): Fix another assert introduced by
	the last change.

svn path=/branches/mono-2-2/mono/; revision=122472
2009-01-05 17:32:03 +00:00
Zoltan Varga 561cb241d9 2009-01-05 Zoltan Varga <[email protected]>
Backport of r122452.
	
	* mini.c (mono_allocate_stack_slots_full2): Use mono_class_from_mono_type
	instead of directly accessing type->data.klass. Fixes #462016.
	(mono_allocate_stack_slots_full): Ditto.

svn path=/branches/mono-2-2/mono/; revision=122453
2009-01-05 13:22:31 +00:00
Federico Di Gregorio 1fcf34271b Added missing property Extend to Mono.Cairo.Pattern
svn path=/branches/mono-2-2/mcs/; revision=122441
2009-01-05 12:09:40 +00:00
Marek Safar f2de867101 2009-01-05 Marek Safar <[email protected]>
A fix for bug #457257
	* decl.cs: Fixed incorrect member declaring type comparison.


svn path=/branches/mono-2-2/mcs/; revision=122439
2009-01-05 11:49:57 +00:00
Zoltan Varga 992e22f306 2009-01-05 Zoltan Varga <[email protected]>
* configure.in: Disable sigaltstack on freebsd as it doesn't seem to work.

svn path=/branches/mono-2-2/mono/; revision=122422
2009-01-05 09:12:31 +00:00
Zoltan Varga 0c65fe81ed 2009-01-05 Zoltan Varga <[email protected]>
Backport of r122416.
	
	* mini-arm.c (mono_arch_flush_icache): Applied patch from Riku Voipio 
	<[email protected]>. Fix cache flush on kernels without OLDABI compat option.

svn path=/branches/mono-2-2/mono/; revision=122417
2009-01-05 09:00:19 +00:00
Zoltan Varga 6887168dc2 2009-01-04 Zoltan Varga <[email protected]>
Backport of r122392.
	
	* branch-opts.c (mono_if_conversion): Fix an assert introduced by the last
	change.

svn path=/branches/mono-2-2/mono/; revision=122393
2009-01-04 18:48:29 +00:00
Zoltan Varga 87b0e91eff 2009-01-04 Zoltan Varga <[email protected]>
Backport of r122386.
	
	* branch-opts.c (mono_if_conversion): Use branch->inst_true_bb/inst_false_bb
	instead of bblock->out_bb [0]/[1], the two might not be the same. Fixes
	#463357.

	* iltests.il.in: Add a regression test.

svn path=/branches/mono-2-2/mono/; revision=122387
2009-01-04 01:54:44 +00:00
Zoltan Varga 883c60f9a9 2008-11-27 Mark Probst <[email protected]>
Backport of r120164.
	
	* marshal.c (mono_string_builder_to_utf8): Fixed a wrong
	invocation to g_utf16_to_utf8().

svn path=/branches/mono-2-2/mono/; revision=122373
2009-01-03 18:38:36 +00:00
Rodrigo Kumpera 1fc3eea4d1 2009-01-04 Rodrigo Kumpera <[email protected]>
Backport of r122364.

	* basic-simd.cs: Add a regression test for #462457.




svn path=/branches/mono-2-2/mono/; revision=122367
2009-01-03 15:16:52 +00:00
Rodrigo Kumpera ce5e64372c 2009-01-04 Rodrigo Kumpera <[email protected]>
Backport of r122363.

	* mini-ops.h: Add a definition of XPHI.

	* mini.h (MONO_IS_PHI): Make is aware of simd instrincs. 

	* ssa.c (op_phi_to_move): Handle XPHI.

	* ssa.c (mono_ssa_compute): Generate a XPHI for simd intrinsics instead of VPHI.

	Fixes #462457


svn path=/branches/mono-2-2/mono/; revision=122366
2009-01-03 15:16:21 +00:00
Marek Safar eb766b843d 2009-01-02 Marek Safar <[email protected]>
A fix for bug #463121
	* nullable.cs: Fixed nullable user quality operator comparison.


svn path=/branches/mono-2-2/mcs/; revision=122346
2009-01-02 17:48:33 +00:00
Marek Safar dbb88b930b 2009-01-02 Marek Safar <[email protected]>
A fix for bug #462592
	* pending.cs: Emit type arguments for generic proxy method.


svn path=/branches/mono-2-2/mcs/; revision=122331
2009-01-02 12:58:07 +00:00
Massimiliano Mantione 701ec25f87 Merged the profiler documentation from trunk (r122288).
svn path=/branches/mono-2-2/mono/; revision=122290
2008-12-31 11:19:53 +00:00
Massimiliano Mantione 56157b091b Make the profiler like r122287 on trunk.
svn path=/branches/mono-2-2/mono/; revision=122289
2008-12-31 11:19:08 +00:00
Marek Safar 91506c541c 2008-12-30 Marek Safar <[email protected]>
* expression.cs (As): Mutate all type arguments.


svn path=/branches/mono-2-2/mcs/; revision=122233
2008-12-30 11:41:14 +00:00
Marek Safar 5deb2e0f97 2008-12-29 Marek Safar <[email protected]>
A fix for bug #462622
	* anonymous.cs: Resolve anonymous type GetHashCode in unchecked
	context.


svn path=/branches/mono-2-2/mcs/; revision=122179
2008-12-29 11:24:29 +00:00
Marek Safar f0bac9e0b7 2008-12-29 Marek Safar <[email protected]>
A fix for bug #450782
	* ecore.cs: Consider more variables of form V.I to be fixed.


svn path=/branches/mono-2-2/mcs/; revision=122178
2008-12-29 09:34:02 +00:00
Zoltan Varga 6d9fa806ea 2008-12-29 Zoltan Varga <[email protected]>
Backport of r122170.

	* mini.c (mono_jit_compile_method_inner): Avoid holding the domain lock
	while loading AOT methods.

svn path=/branches/mono-2-2/mono/; revision=122171
2008-12-29 01:14:57 +00:00
Zoltan Varga 2ee594eee6 2008-12-29 Zoltan Varga <[email protected]>
Backport of r122168.
	
	* mini-exceptions.c: Check jit_tls->class_cast_from instead of class_cast_to
	since only the former is nulled out after a successful cast. This prevents
	crashes with rethrown exceptions when using --debug=casts.

svn path=/branches/mono-2-2/mono/; revision=122169
2008-12-29 00:57:10 +00:00
Rodrigo Kumpera fd92d87ed0 2008-12-26 Rodrigo Kumpera <[email protected]>
Backport of r122134.

	* bug-461261.cs: New regression test.

	* Makefile.am: Test added.


svn path=/branches/mono-2-2/mono/; revision=122137
2008-12-26 19:44:13 +00:00
Rodrigo Kumpera 2bc209f4f4 2008-12-26 Rodrigo Kumpera <[email protected]>
Backport of r122133.

	* class.c (get_implicit_generic_array_interfaces): If the internal
	enumerator is an interface inflate System.Object instead of itself.

	Fixes #461261.


svn path=/branches/mono-2-2/mono/; revision=122136
2008-12-26 19:36:34 +00:00
Mark Probst f73e839351 2008-12-24 Mark Probst <[email protected]>
Backport of r122086.

	* mini.h: New macro for checking whether a method is final,
	i.e. whether the method or its class is marked final.

	* method-to-ir.c: Use the new macro for all final-checks
	consistently.  Fixes the crash in the System.ServiceModel tests.

2008-12-24  Mark Probst  <[email protected]>

	Backport of r122086.

	* generic-sealed-virtual.2.cs: Test case for final generic
	methods.

	* Makefile.am: Test added.

svn path=/branches/mono-2-2/mono/; revision=122087
2008-12-24 11:43:01 +00:00
Mark Probst f6e12de276 2008-12-24 Mark Probst <[email protected]>
* mini-ppc.c (mono_arch_build_imt_thunk): Fix the build.

svn path=/branches/mono-2-2/mono/; revision=122079
2008-12-24 09:19:42 +00:00
Rodrigo Kumpera e5af45cdb3 2008-12-24 Rodrigo Kumpera <[email protected]>
Backport of r122071.

	* bug-461941.cs: New regression test.

	* Makefile.am: Test added.


svn path=/branches/mono-2-2/mono/; revision=122076
2008-12-24 05:00:44 +00:00
Rodrigo Kumpera 2491b3dbb2 2008-12-24 Rodrigo Kumpera <[email protected]>
Backport of r122070.

	* object.c (mono_runtime_invoke_array): Don't assert with
	byref nullable types.

	* marshal.c (mono_marshal_get_runtime_invoke): To handle
	byref nullables we unbox the object and store it on the
	stack. 
	We can't use the boxed object since it is the T of Nullable<T>
	and the boxed representation of a nullable it's underlying type
	or null.
	We could cheat and create a boxed nullable and use the same
	machinery of other byref VTs but this feels like a hack and
	using the stack has the bonus of reducing heap pressure.

	Fixes #461941.


svn path=/branches/mono-2-2/mono/; revision=122075
2008-12-24 04:58:24 +00:00
Mark Probst ef11247772 2008-12-23 Mark Probst <[email protected]>
Backport of r122034.

	* mini-ppc.c (mono_arch_build_imt_thunk): Save and restore r11.
	Clobbering it is not allowed because the caller might use it as
	the vtable register in the interface call.

svn path=/branches/mono-2-2/mono/; revision=122058
2008-12-23 20:54:22 +00:00
Mark Probst 370bf41989 2008-12-23 Mark Probst <[email protected]>
* mini-exceptions.c (get_exception_catch_class): Removed another
	overly strict assertion.  Fixes #461198.

2008-12-23  Mark Probst  <[email protected]>

	* bug-461198.2.cs: New generic sharing test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-2/mono/; revision=122040
2008-12-23 16:10:40 +00:00
Rodrigo Kumpera 9e79a22008 2008-12-23 Rodrigo Kumpera <[email protected]>
Backport of r122036.

	* bug-461867.cs: New regression test.

	* Makefile.am: Test added.


svn path=/branches/mono-2-2/mono/; revision=122039
2008-12-23 15:37:32 +00:00
Rodrigo Kumpera da54730380 2008-12-23 Rodrigo Kumpera <[email protected]>
Backport of r122035.

 	* marshal.c (mono_marshal_emit_managed_wrapper): Handle char
 	return value.
 
 	Fixes #461867.


svn path=/branches/mono-2-2/mono/; revision=122038
2008-12-23 15:37:02 +00:00
Ivan Zlatev 3a433af16e 2008-12-22 Ivan N. Zlatev <[email protected]>
* ReferenceConverter.cs: Implemented.
	* ReferenceConverterTest.cs: Added.
	[Fixes bug #381435]

svn path=/branches/mono-2-2/mcs/; revision=122033
2008-12-23 10:52:51 +00:00
Veerapuram Varadhan 6fdda55b42 * SqlXmlTest.cs: Available only in 2.0 and above
svn path=/branches/mono-2-2/mcs/; revision=122008
2008-12-22 20:50:59 +00:00
Jonathan Pobst cdc69e8e9e Backport Ivan's patch to 2.2.
2008-11-30  Ivan N. Zlatev  <[email protected]>

	* GroupBoxRenderer.cs: Fix when VisualStyles disabled:
	   - No caption text is drawn because Color.Empty is used.
	   - Fix top and height off by 1.
	[Fixes bug #448764]

svn path=/branches/mono-2-2/mcs/; revision=121993
2008-12-22 18:30:50 +00:00
Veerapuram Varadhan d67fd7ce3a Add new SqlXmlTest
svn path=/branches/mono-2-2/mcs/; revision=121960
2008-12-21 03:45:53 +00:00
Veerapuram Varadhan d195b62b9d * SqlXml.cs (CreateReader): Better use
ConformanceLevel.Fragment while creating the reader as column
        values are not really Xml documents.  Also, throw
        SqlNullValueException when data is null.
        (.ctor): Take good care of empty XmlReaders.



svn path=/branches/mono-2-2/mcs/; revision=121959
2008-12-21 03:41:39 +00:00
Miguel de Icaza 3e90298aa1 Backport
svn path=/branches/mono-2-2/mcs/; revision=121935
2008-12-20 19:19:00 +00:00
Miguel de Icaza 8ae9f4eace Backport to 2.2
svn path=/branches/mono-2-2/mcs/; revision=121933
2008-12-20 19:15:12 +00:00
Mark Probst 08038cbf3b 2008-12-19 Mark Probst <[email protected]>
* mini-exceptions.c (get_exception_catch_class): Removed overly
	strict assertion.

2008-12-19  Mark Probst  <[email protected]>

	* bug-459285.2.cs: New generic sharing test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-2/mono/; revision=121840
2008-12-19 12:42:38 +00:00
Mark Probst 7e7c65d58f 2008-12-19 Mark Probst <[email protected]>
Backport of r121292.

        * method-to-ir.c: Removed an unnecessary assertion.

2008-12-19  Mark Probst  <[email protected]>

        Backport of r121292.

        * metadata/generic-sharing.c: Look for constraints in all type
        arguments, not just the first one.

2008-12-19  Mark Probst  <[email protected]>

        Backport of r121292.

        * generic-marshalbyref.2.cs: Test for calls to marshal-by-ref
        objects.

        * Makefile.am: Test added.

svn path=/branches/mono-2-2/mono/; revision=121836
2008-12-19 10:39:22 +00:00
Gonzalo Paniagua Javier 4bf06608d3 2008-11-18 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: remove CWL. When reusing, BeginReadRequest might
	throw if the client closes.
	* HttpListenerResponse.cs: close the connection for 1.0 clients.

	Backported from HEAD. Fixes bug #459432.

svn path=/branches/mono-2-2/mcs/; revision=121830
2008-12-19 04:38:03 +00:00
Marek Habersack 3aad6c2f07 Backport of r121819.
svn path=/branches/mono-2-2/mcs/; revision=121820
2008-12-18 23:39:41 +00:00
Marek Safar 26f04c283d 2008-12-18 Marek Safar <[email protected]>
A fix for bug #457087
	* generic.cs: Don't crash when constraint comes from type
	declaration.


svn path=/branches/mono-2-2/mcs/; revision=121769
2008-12-18 10:57:12 +00:00
Marek Habersack e03981495b Backport of r121752.
svn path=/branches/mono-2-2/mcs/; revision=121753
2008-12-18 01:19:10 +00:00
Veerapuram Varadhan 0f766fceaf * OciDefineHandle.cs (GetValue): Use connection's environment
handle instead of Parent handle.


svn path=/branches/mono-2-2/mcs/; revision=121734
2008-12-17 23:09:58 +00:00
Geoff Norton cd51852dd8 2008-12-17 Geoff Norton <[email protected]>
* threadpool.c: Ensure that the io_queue_lock is initialized
        in all circumstances, as we always attempt to cleanup against it.

svn path=/branches/mono-2-2/mono/; revision=121724
2008-12-17 20:10:09 +00:00
Miguel de Icaza 0a5a292db4 Backport 2008-12-17 Miguel de Icaza <[email protected]>
* icall.c (ves_icall_System_Environment_get_Platform): For
	compatibility reasons for existing client code we will keep
	returning 4 for a while.   

	For how long will depend on the documentation being updated, and
	for us to give client code a chance to be updated.

	This reverts the original decison on #433108 since we did not
	catch roughly 33 instances of the broken code in our own source
	code base, we did not catch failures on the buildbots, and QA did
	not bring this as a problem.

	Only today I found some customer's code breaking due to our own
	class libraries not being fully updated and tracked it down to
	this change.  I am reverting it because if we could not even get
	our story straight in our own code base, how can we hope that our
	end user code be fixed?

	As of this morning, our Wiki page that documents how to detect
	Unix had not been fixed.    

svn path=/branches/mono-2-2/mono/; revision=121716
2008-12-17 18:14:40 +00:00
Rolf Bjarne Kvinge b3c5bdfa7f 2008-12-12 Rolf Bjarne Kvinge <[email protected]>
* Makefile.am, vbnc.1: Remove vbnc.1. It's living in the
	  mono-basic module now.

	  [Backport of r121406.]


svn path=/branches/mono-2-2/mono/; revision=121678
2008-12-17 12:08:43 +00:00
Martin Baulig fc77b903af 2008-12-16 Martin Baulig <[email protected]>
Backport of r120438.

	* method-to-ir.c (mono_method_to_ir): Disable debugging
	information for the init locals block to make the debugger stop
	after all locals have been initalized.


svn path=/branches/mono-2-2/mono/; revision=121640
2008-12-16 22:08:59 +00:00
Martin Baulig ff74079dc1 2008-12-02 Martin Baulig <[email protected]>
Backport of r120419.

	* mini.c (mini_method_compile): Disable MONO_OPT_DEADCE when
	running inside the debugger.


svn path=/branches/mono-2-2/mono/; revision=121639
2008-12-16 22:06:18 +00:00
Martin Baulig ed3174a8b7 2008-12-16 Martin Baulig <[email protected]>
Backport of r120407 from Zoltan Varga.

	* mini.c (mini_method_compile): Only run local deadce if MONO_OPT_DEADCE
	is enabled.

	* method-to-ir.c (mono_method_to_ir): Fix invalid code generated by the 
	alu->alu imm optimization which only shows if deadce is disabled.


svn path=/branches/mono-2-2/mono/; revision=121638
2008-12-16 22:03:08 +00:00
Marek Habersack 4485172658 Backport of r121636.
svn path=/branches/mono-2-2/mcs/; revision=121637
2008-12-16 22:01:42 +00:00
Martin Baulig 7ca53d801a 2008-11-29 Martin Baulig <[email protected]>
Backport of r120260.

	* mini-exceptions.c (mono_handle_native_sigsegv): Check
	mono_debug_using_mono_debugger() in addition to the
	`no_gdb_backtrace' flag in the `MonoDebugOptions'.


svn path=/branches/mono-2-2/mono/; revision=121635
2008-12-16 21:51:34 +00:00
Marek Habersack b34dcd83c4 Backport of r121629.
svn path=/branches/mono-2-2/mono/; revision=121630
2008-12-16 21:06:06 +00:00
Gonzalo Paniagua Javier 07d8da1481 revert
svn path=/branches/mono-2-2/mcs/; revision=121628
2008-12-16 20:38:58 +00:00
Marek Habersack ae5b023940 Backport of r121621.
svn path=/branches/mono-2-2/mcs/; revision=121622
2008-12-16 19:00:52 +00:00
Zoltan Varga 9fa4d42782 2008-12-14 Zoltan Varga <[email protected]>
Backport of r120389.
	
	* method-to-ir.c (mono_method_to_ir): Set the type of the value pushed on
	the stack in CEE_LDFLDA. Fixes #450542.

	* generics.cs: Add a new test.

svn path=/branches/mono-2-2/mono/; revision=121564
2008-12-16 00:11:01 +00:00
Marek Habersack 98bcd46dd1 Backport of r121557.
svn path=/branches/mono-2-2/mono/; revision=121560
2008-12-15 22:44:51 +00:00
Zoltan Varga c373ddd111 2008-12-14 Zoltan Varga <[email protected]>
Backport of r121496.
	
	* liveness.c (mono_analyze_liveness): Avoid eliminating the 'this' var in
	gshared code. Fixes #458947.

	* generics.cs: Add a test.

svn path=/branches/mono-2-2/mono/; revision=121497
2008-12-14 09:50:57 +00:00
Zoltan Varga b93c12250d 2008-12-12 Zoltan Varga <[email protected]>
Backport of r121457.
	
	* mini-arm.c tramp-arm.c: Fix calls to mono_arch_flush_icache.

svn path=/branches/mono-2-2/mono/; revision=121458
2008-12-12 19:51:40 +00:00
Dean Brettle 67a9b038c5 Changes approved via private email from Marek Habersack <[email protected]> on 2008-10-05.
In System.Web.Configuration_2.0:
2008-12-11  Owen Brady <[email protected]>
	* nBrowser/File.cs, nBrowser/Identification.cs, nBrowser/Node.cs, nBrowser/NodeTypes.cs,
	nBrowser/Result.cs, nBrowser/Build.cs, nBrowser/Exception.cs, CapabilitiesBuild.cs, 
	CapabilitiesResult.cs: Updated Copyright information to include updated contact information.
	
	* nBrowser/Build.cs: Removed LoadDefaultEmbeddedResource function, the embeded resource
	it is referring too was never included in Mono. And was designed for a free standing 
	browser identification libary.

	* nBrowser/Exception.cs: Removed Compile Attributes and related comments which were left
	in from the original free standing browser libary.
	
	* CapabilitiesBuild.cs: Removed Header Checksum related coding since it is not required
	for the Mono implementation.

	* CapabilitiesResult.cs: Updated Copyright information to include updated contact information. 
	Removed functions which were designed to make use of features of a embeded browser file which
	is not present in Mono.
	
	* CapabilitiesChecksum.cs, RandomRoboBotKeywords.txt: Deleted

In .:
2008-12-11  Dean Brettle  <[email protected]>

	* System.Web.dll.sources: deleted
	System.Web.Configuration_2.0/CapabilitiesChecksum.cs
	
	* Makefile (RESOURCE_FILES_2): deleted
	System.Web.Configuration_2.0/RandomRoboBotKeywords.txt


svn path=/branches/mono-2-2/mcs/; revision=121384
2008-12-12 00:52:06 +00:00
Rodrigo Kumpera dc330f3d57 In tests:
2008-12-08  Rodrigo Kumpera  <[email protected]>

	* bug457574.il: New regression test.

	* Makefile.am: Test added.

	Backported from trunk r121174.

In mini:
2008-12-10  Rodrigo Kumpera  <[email protected]>

	* ssa.c (fold_ins): branch opt can kill dummy switch ops so we can't
	expect that an OP_BR_REG will be there.

	* branch-opts.c (remove_block_if_useless): Use MONO_IS_BRANCH_OP instead of checking
	for the many branch ops. The original check miss OP_BR_REG.

	Fixes #457574.

	Backported from trunk r121173 and r121175


svn path=/branches/mono-2-2/mono/; revision=121210
2008-12-10 13:09:08 +00:00
Zoltan Varga 9fe47f55e3 2008-12-09 Zoltan Varga <[email protected]>
Backport of r121150.
	
	* aot-runtime.c (load_method): Avoid calling decode_exception_debug_info
	while holding the aot lock.

svn path=/branches/mono-2-2/mono/; revision=121152
2008-12-09 20:14:00 +00:00
Andrés G. Aragoneses 657e5df419 fix changelog
svn path=/branches/mono-2-2/mcs/; revision=121118
2008-12-09 17:08:37 +00:00
Zoltan Varga 1511ce89c6 2008-12-09 Zoltan Varga <[email protected]>
Backport of r121103.
	
	* aot-runtime.c (decode_exception_debug_info): Acquire the domain
	lock when calling mono_domain_alloc (). Hopefully fixes #415608.

svn path=/branches/mono-2-2/mono/; revision=121104
2008-12-09 16:07:01 +00:00
Marek Habersack 05e0f11430 Backport of r121064.
svn path=/branches/mono-2-2/mcs/; revision=121065
2008-12-08 23:44:55 +00:00
Zoltan Varga 06cddce9b0 2008-12-08 Zoltan Varga <[email protected]>
Backport of r120999.
	
	* mini-exceptions.c (mono_print_thread_dump): Mark threadpool threads
	as such. Fixes #456669.

svn path=/branches/mono-2-2/mono/; revision=121000
2008-12-08 15:03:39 +00:00
Zoltan Varga 3e3c9edc91 2008-12-08 Zoltan Varga <[email protected]>
Backport of r120995.
	
	* SQLite3.cs: Avoid IntPtr.ToInt32 () to convert between IntPtr's and integers
	since it is not 64 bit safe. Fixes #457038.

svn path=/branches/mono-2-2/mcs/; revision=120996
2008-12-08 14:50:59 +00:00
Marek Habersack 24d7fea4ca Backport of r120988.
svn path=/branches/mono-2-2/mcs/; revision=120989
2008-12-08 12:04:01 +00:00
Marek Habersack 691a2cf225 Backport of r120880
svn path=/branches/mono-2-2/mono/; revision=120883
2008-12-05 20:37:26 +00:00
Marek Habersack 296607e9b1 Fix a test run issue for 1.1
svn path=/branches/mono-2-2/mcs/; revision=120860
2008-12-05 18:05:44 +00:00
Gonzalo Paniagua Javier ee79b6f908 2008-12-05 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: support parameter names with or without a leading '@'.


svn path=/branches/mono-2-2/mcs/; revision=120855
2008-12-05 17:18:56 +00:00
Marek Habersack 9844a237ea Backport of r120823.
svn path=/branches/mono-2-2/mcs/; revision=120825
2008-12-05 12:01:37 +00:00
Marek Habersack 9a817effa9 Backport of r120822.
svn path=/branches/mono-2-2/mcs/; revision=120824
2008-12-05 12:00:14 +00:00
Miguel de Icaza 9a2e1ccef4 Backport ReaderWriterLockSlim for MEF
svn path=/branches/mono-2-2/mcs/; revision=120768
2008-12-04 22:03:09 +00:00
Zoltan Varga fbfb1742ed 2008-12-04 Zoltan Varga <[email protected]>
Backport of r120756.
	
	* aot-compiler.c (add_wrappers): Add pinvoke wrappers.

	* mini.c (mono_resolve_patch_target): Allow pinvoke methods in 
	MONO_PATCH_INFO_ICALL_ADDR.

svn path=/branches/mono-2-2/mono/; revision=120757
2008-12-04 21:04:20 +00:00
Zoltan Varga 547f83ca27 2008-12-04 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
	wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
	instruction instead of a pointer constant.

svn path=/branches/mono-2-2/mono/; revision=120750
2008-12-04 20:48:32 +00:00
Marek Safar 73bd2d2941 2008-12-03 Marek Safar <[email protected]>
* typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
	to be imported from any assembly.


svn path=/branches/mono-2-2/mcs/; revision=120629
2008-12-03 19:49:33 +00:00
Gonzalo Paniagua Javier e6a317bc40 2008-12-03 Gonzalo Paniagua Javier <[email protected]>
* UdpClientTest.cs: test closing a UDP socket while receiving.


svn path=/branches/mono-2-2/mcs/; revision=120605
2008-12-03 15:35:50 +00:00
Gonzalo Paniagua Javier bfdcf61509 2008-12-03 Gonzalo Paniagua Javier <[email protected]>
* UdpClient.cs: don't Poll() in Receive(), the call to ReceiveFrom
	will block anyway. Fixes bug #455894.

2008-11-12 Gonzalo Paniagua Javier <[email protected]>

	* Socket.cs: mark the socket as not connected when there is a pending
	error or exception about to be thrown.
	Bug #443346 fixed.


svn path=/branches/mono-2-2/mcs/; revision=120602
2008-12-03 15:33:28 +00:00
Mark Probst a1f8c0800d 2008-12-03 Mark Probst <[email protected]>
Backport of r120589.

	* method-to-ir.c (mono_method_to_ir): Handle ldtoken of an open
	generic type (via a typedef or typeref) correctly.

2008-12-03  Mark Probst  <[email protected]>

	Backport of r120589.

	* generic-typedef.2.cs: New test for ldtoken of open generic
	types.

	* Makefile.am: Test added.

svn path=/branches/mono-2-2/mono/; revision=120595
2008-12-03 14:22:24 +00:00
Marek Habersack 861c4f8f12 Backport of r120592.
svn path=/branches/mono-2-2/mcs/; revision=120593
2008-12-03 13:55:22 +00:00
Marek Habersack 7af8c9351d Backport of r120590.
svn path=/branches/mono-2-2/mcs/; revision=120591
2008-12-03 13:33:22 +00:00
Rodrigo Kumpera 7155c65bfd 2008-12-03 Rodrigo Kumpera <[email protected]>
* mono-property-hash.c (mono_property_hash_destroy): Release
	the root hashtable as well.

	Backported from trunk.


svn path=/branches/mono-2-2/mono/; revision=120587
2008-12-03 12:31:09 +00:00
Gonzalo Paniagua Javier f20c4ece0c 2008-12-02 Gonzalo Paniagua Javier <[email protected]>
* AspParser.cs: reset to the next character in a partial match in case
	of failure. Fixes bug #314688.

svn path=/branches/mono-2-2/mcs/; revision=120552
2008-12-03 00:17:54 +00:00
Gonzalo Paniagua Javier 45efaf51b3 2008-12-02 Gonzalo Paniagua Javier <[email protected]>
* Page.cs: make sure we don't return null in Title.


svn path=/branches/mono-2-2/mcs/; revision=120551
2008-12-03 00:17:25 +00:00
Marek Habersack de0321f109 Backport of r120545.
svn path=/branches/mono-2-2/mono/; revision=120546
2008-12-02 23:13:43 +00:00
Zoltan Varga 71864e55c4 2008-12-03 Zoltan Varga <[email protected]>
Backport of r120543.
	
	* mini-trampolines.c (mono_magic_trampoline): Add some debugging code to help
	diagnose an assertion failure.

svn path=/branches/mono-2-2/mono/; revision=120544
2008-12-02 23:04:35 +00:00
Miguel de Icaza 92aa367629 backport the fix for erase/delete for OSX
svn path=/branches/mono-2-2/mcs/; revision=120539
2008-12-02 21:57:01 +00:00
Marek Habersack a7e3109c66 Backport of r120485.
svn path=/branches/mono-2-2/mcs/; revision=120486
2008-12-02 14:28:23 +00:00
Marek Habersack 0c68cd806a Backport of r120442.
svn path=/branches/mono-2-2/mcs/; revision=120444
2008-12-02 01:36:46 +00:00
Marek Habersack 8098dbe758 Backport of r120436.
svn path=/branches/mono-2-2/mcs/; revision=120437
2008-12-02 01:08:01 +00:00
Rodrigo Kumpera 50619fe4f4 2008-12-01 Rodrigo Kumpera <[email protected]>
* main.c (get_uninitialized_data_type): Make crappy static analyzers happy.

	Backported from trunk.


svn path=/branches/mono-2-2/mono/; revision=120417
2008-12-01 23:28:37 +00:00
Marek Habersack b4c5181a77 Backport of r120376.
svn path=/branches/mono-2-2/mcs/; revision=120377
2008-12-01 19:33:50 +00:00
Marek Habersack f20b93ecf7 Backport of r120353.
svn path=/branches/mono-2-2/mcs/; revision=120354
2008-12-01 14:45:31 +00:00
Marek Habersack 2023460027 Backport of r120345.
svn path=/branches/mono-2-2/mcs/; revision=120346
2008-12-01 12:35:03 +00:00
Zoltan Varga d44a27c9e1 2008-11-29 Zoltan Varga <[email protected]>
Backport of r120273.
	
	* mini.h aot-runtime.c: Fix building with DISABLE_AOT.

svn path=/branches/mono-2-2/mono/; revision=120283
2008-11-29 20:28:25 +00:00
Zoltan Varga cf1ccdc254 2008-11-29 Zoltan Varga <[email protected]>
Backport of r120273.
	
	* mini.h aot-runtime.c: Fix building with DISABLE_AOT.

svn path=/branches/mono-2-2/mono/; revision=120274
2008-11-29 17:00:46 +00:00
Marek Habersack ce427d5af1 Backport of r120199
svn path=/branches/mono-2-2/mcs/; revision=120200
2008-11-28 01:44:16 +00:00
Marek Habersack a78027248b Backport of r120047
svn path=/branches/mono-2-2/mcs/; revision=120107
2008-11-27 02:04:58 +00:00
Gonzalo Paniagua Javier 7d3335da20 2008-11-25 Gonzalo Paniagua Javier <[email protected]>
* pedump.c: initialize perf. counters. Fixes a segv.


svn path=/branches/mono-2-2/mono/; revision=119980
2008-11-25 17:41:38 +00:00
Marek Safar a21f8151eb 2008-11-25 Marek Safar <[email protected]>
A fix for bug #447027
	* anonymous.cs (HoistedVariable): Cache also outer access to deal
	with context variables stored as expression instances.


svn path=/branches/mono-2-2/mcs/; revision=119967
2008-11-25 16:29:53 +00:00
Gonzalo Paniagua Javier ddb21259f1 2008-11-13 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequestTest.cs: the upload test now passes with the MS
	runtime. Added another test for download.



svn path=/branches/mono-2-2/mcs/; revision=119913
2008-11-25 02:13:22 +00:00
Gonzalo Paniagua Javier 2664cc24dc 2008-11-13 Gonzalo Paniagua Javier <[email protected]>
* FtpDataStream.cs: use the socket for reading until the end of a
	stream that wasn't read entirely. Remove unused ManualResetEvent.
	* FtpWebRequest.cs: set the file_name when downloading. Update the
	response status after every SendCommand. Send a "OPTS utf8 on" as MS
	does (the control cnc reader should do something with UTF8)


svn path=/branches/mono-2-2/mcs/; revision=119912
2008-11-25 02:10:49 +00:00
Marek Habersack f445544ba8 those need to be in there as well
svn path=/branches/mono-2-2/mcs/; revision=119911
2008-11-25 01:47:27 +00:00
Marek Habersack fe7bbc9da1 This needs to be here too :P
svn path=/branches/mono-2-2/mcs/; revision=119910
2008-11-25 01:46:30 +00:00
Marek Habersack 1b3d62f26e This needs to be here too :P
svn path=/branches/mono-2-2/mcs/; revision=119909
2008-11-25 01:44:55 +00:00
Marek Habersack 1b578615c6 Backport of r119699
svn path=/branches/mono-2-2/mcs/; revision=119908
2008-11-25 01:28:55 +00:00
Marek Habersack 54c0e1e47f Backport of r119893
svn path=/branches/mono-2-2/mcs/; revision=119906
2008-11-25 01:27:45 +00:00
Marek Habersack cd105f51c1 Backport of r119800
svn path=/branches/mono-2-2/mcs/; revision=119905
2008-11-25 01:27:24 +00:00
Marek Habersack af1e7f3096 Backport of r119673
svn path=/branches/mono-2-2/mcs/; revision=119904
2008-11-25 01:26:37 +00:00
Marek Habersack 544c381f9f Backport of r119661
svn path=/branches/mono-2-2/mcs/; revision=119902
2008-11-25 01:23:35 +00:00
Marek Habersack 64c2b9fea8 Backport of r119126
svn path=/branches/mono-2-2/mcs/; revision=119901
2008-11-25 01:22:48 +00:00
Marek Habersack ad443c3edf Backport of r119378
svn path=/branches/mono-2-2/mcs/; revision=119898
2008-11-25 01:10:41 +00:00
Marek Habersack f83478e9f0 Backport of r119269
svn path=/branches/mono-2-2/mcs/; revision=119897
2008-11-25 01:10:13 +00:00
Marek Habersack 6ff666ba9f Backport of r119233
svn path=/branches/mono-2-2/mcs/; revision=119896
2008-11-25 01:09:43 +00:00
Marek Habersack 5a4faa0dbe Backport of r119130
svn path=/branches/mono-2-2/mcs/; revision=119895
2008-11-25 01:09:06 +00:00
Marek Habersack 560afb2c8c Backport of r118917
svn path=/branches/mono-2-2/mcs/; revision=119894
2008-11-25 01:08:29 +00:00
Marek Habersack df6dcb4bc3 Backport of r119827
svn path=/branches/mono-2-2/mcs/; revision=119829
2008-11-24 18:48:26 +00:00
Jonathan Pobst ae55ffa9b3 2008-11-24 Jonathan Pobst <[email protected]>
* Form.cs: Don't change min/max size if it is empty.
	[Fixes bug #447873]

2008-11-23  Jonathan Pobst  <[email protected]>

	* FormTest.cs: Add test for bug #447873.

svn path=/branches/mono-2-2/mcs/; revision=119813
2008-11-24 17:05:25 +00:00
Jonathan Pobst 3fd6b5713d 2008-11-21 Jonathan Pobst <[email protected]>
* XPlatUI.cs: Take new Platform.MacOSX into account.
	[Fixes bug #447663]

svn path=/branches/mono-2-2/mcs/; revision=119638
2008-11-21 17:07:43 +00:00
Rodrigo Kumpera 71fbfc7a0a 2008-11-21 Rodrigo Kumpera <[email protected]>
* icall.c (mono_method_get_equivalent_method): Make sure
	method->klass->methods is inited before looping over it.

	Backported from trunk.


svn path=/branches/mono-2-2/mono/; revision=119613
2008-11-21 14:15:07 +00:00
Andreia Gaita 2d97201acc * Mono.Mozilla/DOM/ContentListener.cs: Added (oops)
2008-11-21  Andreia Gaita <[email protected]>

svn path=/branches/mono-2-2/mcs/; revision=119612
2008-11-21 14:06:56 +00:00
Andreia Gaita d6717fd548 * System.Drawing/Image.cs: On win32, when cloning images initialized from
resources, also clone the underlying stream, since it needs to stay
  around for the life of the image (gdi doesn't clone the underlying
  stream when cloning images, so when the gc disposes the original, it
  will also dispose the stream, which invalidates the clone).

* System.Drawing/Bitmap.cs: Save the underlying stream when creating bitmaps from a
  clone under win32

* System.Drawing.Imaging/Metafile.cs: Save the underlying stream when creating from a
  clone under win32

[fixes #438886, Backported from r119580]

2008-11-21  Andreia Gaita  <[email protected]>

svn path=/branches/mono-2-2/mcs/; revision=119581
2008-11-21 05:50:55 +00:00
Jonathan Pobst 4e17e21b2a 2008-11-20 Jonathan Pobst <[email protected]>
* ComboBox.cs: Call HideWindow instead of Hide when closing the dropdown
	through DroppedDown so the proper events get called and state gets reset.
	[Fixes bug #446805]

svn path=/branches/mono-2-2/mcs/; revision=119561
2008-11-21 00:23:09 +00:00
Andreia Gaita 3dc556e23b * Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: Support script
execution directly in the browser object
  [Backported, r118685]

2008-11-20  Andreia Gaita <[email protected]>

svn path=/branches/mono-2-2/mcs/; revision=119494
2008-11-20 19:19:56 +00:00
Andreia Gaita 24b03dbeb3 * Mono.Mozilla/DOM/Node.cs, Mono.Mozilla/DOM/Window.cs: Fix equality
operators
  [Backported, r118684, r119336]

2008-11-20  Andreia Gaita <[email protected]>

svn path=/branches/mono-2-2/mcs/; revision=119493
2008-11-20 19:19:51 +00:00
Andreia Gaita ce37fb5dfb * Mono.WebBrowser.dll.sources, Mono.WebBrowser2K5.csproj,
Mono.Mozilla/interfaces/nsIURIContentListener.cs,
  Mono.Mozilla/DOM/ContentListener.cs: New class added to listen for load
  requests and handle content types
* Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: New
  NavigationRequested event to catch load requests

[Backported, r118617]

2008-11-20  Andreia Gaita <[email protected]>

svn path=/branches/mono-2-2/mcs/; revision=119492
2008-11-20 19:19:47 +00:00
Zoltan Varga f4bb6280cd 2008-11-20 Zoltan Varga <[email protected]>
Backport of r119444.
	
	* arm/Makefile.am (libmonoarch_arm_la_SOURCES): Don't build tramp.c, it is only
	used by the interpreter.

svn path=/branches/mono-2-2/mono/; revision=119445
2008-11-20 14:30:04 +00:00
Zoltan Varga bc76b7d785 2008-11-20 Zoltan Varga <[email protected]>
Backport of r119398.
	
	* pinvoke2.cs: Add a test for passing/receiving generic struct instances.

svn path=/branches/mono-2-2/mono/; revision=119400
2008-11-20 00:22:29 +00:00
Zoltan Varga e538bc771d 2008-11-20 Zoltan Varga <[email protected]>
Backport of r119397.
	
	* marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
	Fixes #444715. Fix a warning.

svn path=/branches/mono-2-2/mono/; revision=119399
2008-11-20 00:21:27 +00:00
Jonathan Pryor 5334d00d47 * Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
mono-tools{.config,.source} (fixes the build).

svn path=/branches/mono-2-2/mono/; revision=119304
2008-11-19 13:09:00 +00:00
Jonathan Pryor e43c207e12 * docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
mono-tool{.tree,.zip} files.
	* mono-file-formats.config, mono-tools.config: Alter paths to man
	  pages so that they're valid for building from mono/docs.
	* monoapi.make: Rename to docs.make.

svn path=/branches/mono-2-2/mono/; revision=119260
2008-11-19 02:27:54 +00:00
Jonathan Pryor ea6508481f * docs/Makefile: Don't build mono-file-formats.*, mono-tools.*
* docs/mono-file-formats.config, docs/mono-file-formats.source, 
	  docs/mono-tools.config, docs/mono-tools.source: Removed (now located 
	  in mono/docs).

svn path=/branches/mono-2-2/mcs/; revision=119259
2008-11-19 02:27:31 +00:00
Jonathan Pryor 6ed0b0bd5d These files need to move into mono/docs to fix
https://bugzilla.novell.com/show_bug.cgi?id=445156

svn path=/branches/mono-2-2/mono/; revision=119256
2008-11-19 02:22:52 +00:00
Bill Holmes 2514e975c3 2008-11-17 Bill Holmes <[email protected]>
Backport of 119064 and 119081.

	* marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
	  free threaded marshaler when QueryInterface is called on a COM callable
	  wrapper requesting the IMarshal interface.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-2/mono/; revision=119088
2008-11-17 21:05:37 +00:00
Rodrigo Kumpera 882ffb10b4 2008-11-17 Rodrigo Kumpera <[email protected]>
* FieldInfoTest.cs: Test FieldInfo::GetValue on a constant of an open
	generic type.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=119079
2008-11-17 18:55:56 +00:00
Rodrigo Kumpera a1a664dbcd 2008-11-17 Rodrigo Kumpera <[email protected]>
* MonoField.cs (GetValue): Don't check for open generic types if the field
	is a constant.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=119078
2008-11-17 18:55:16 +00:00
Rodrigo Kumpera 9ff5304841 2008-11-17 Rodrigo Kumpera <[email protected]>
* simd-intrinsics.c (vector2l_intrinsics): CompareGreaterThan requires sse 4.2
	and not 4.1. 

	Backported from trunk.


svn path=/branches/mono-2-2/mono/; revision=119065
2008-11-17 18:00:08 +00:00
Rodrigo Kumpera bac3152d94 2008-11-17 Rodrigo Kumpera <[email protected]>
* Vector2l.cs (CompareGreaterThan): This method requires sse 4.2
	and 4.1.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=119062
2008-11-17 17:22:18 +00:00
Marek Safar 02f76440bb 2008-11-17 Marek Safar <[email protected]>
A fix for bug #445303
	* location.cs (IsConditionalDefined): Handle undefined global
	defines.


svn path=/branches/mono-2-2/mcs/; revision=119040
2008-11-17 15:39:41 +00:00
Marek Safar bb0e7fc708 2008-11-17 Marek Safar <[email protected]>
A fix for bug #444678
	* expression.cs (TryReduceConstant): Always create new constant
	instance.


svn path=/branches/mono-2-2/mcs/; revision=119028
2008-11-17 14:45:40 +00:00
Marek Safar 800ae747f2 2008-11-17 Marek Safar <[email protected]>
A fix for bug #444673
	* ecore.cs: Ignore open generic types when used as generic type
	instance fields.


svn path=/branches/mono-2-2/mcs/; revision=119016
2008-11-17 13:19:46 +00:00
Zoltan Varga 6d986cfd7a 2008-11-17 Zoltan Varga <[email protected]>
Merge r118977 from HEAD.

	* mini-amd64.h: Change the monitor fastpath defines to check for
	!PLATFORM_WIN32 so they work on *bsd too.

svn path=/branches/mono-2-2/mono/; revision=118978
2008-11-17 00:39:13 +00:00
Gonzalo Paniagua Javier 88068708ab 2008-11-14 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
	HttpWebRequest to avoid a deadlock if the web service uses Session.
	Bug #444343 fixed.
	re: miguel


svn path=/branches/mono-2-2/mono/; revision=118834
2008-11-14 06:31:29 +00:00
Marek Habersack 7a9e96f166 Backport of r118813
svn path=/branches/mono-2-2/mcs/; revision=118815
2008-11-14 02:09:17 +00:00
Marek Habersack e7ec701595 Backport of r118799
svn path=/branches/mono-2-2/mcs/; revision=118800
2008-11-14 00:41:19 +00:00
Veerapuram Varadhan eed1a21d6d reset the connection on timeout exception from TDS
svn path=/branches/mono-2-2/mcs/; revision=118762
2008-11-13 20:22:23 +00:00
Veerapuram Varadhan 7246c849af instead of executing sp_reset_connection, set reset connection bit.
svn path=/branches/mono-2-2/mcs/; revision=118760
2008-11-13 20:17:48 +00:00
Veerapuram Varadhan d39d766bf9 Tests ported from trunk.
svn path=/branches/mono-2-2/mcs/; revision=118759
2008-11-13 20:15:34 +00:00
Bill Holmes 3a2bd00f10 2008-11-13 Bill Holmes <[email protected]>
Backport of r118724.

	* process.h : Adding method declaration for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* process.c : Adding implementation for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
	  to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* wait.h : Adding method declaration for WaitForInputIdle.

	* wait.c : Adding implementation for WaitForInputIdle.

	* Process.cs : Adding an implementation for WaitForInputIdle
	  to call the an internal call.  The internal call is only
	  implemented properly on Windows.

	Code is contributed under MIT/X11 license.   


svn path=/branches/mono-2-2/mcs/; revision=118743
2008-11-13 18:00:06 +00:00
Bill Holmes 9341400101 2008-11-13 Bill Holmes <[email protected]>
Backport of r118724.

	* process.h : Adding method declaration for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* process.c : Adding implementation for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
	  to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* wait.h : Adding method declaration for WaitForInputIdle.

	* wait.c : Adding implementation for WaitForInputIdle.

	* Process.cs : Adding an implementation for WaitForInputIdle
	  to call the an internal call.  The internal call is only
	  implemented properly on Windows.

	Code is contributed under MIT/X11 license.   


svn path=/branches/mono-2-2/mono/; revision=118743
2008-11-13 18:00:06 +00:00
Veerapuram Varadhan 42b1712b66 Backported fix for bug#428139 from trunk
svn path=/branches/mono-2-2/mcs/; revision=118738
2008-11-13 17:31:07 +00:00
Zoltan Varga 1f16a62cf9 2008-11-13 Zoltan Varga <[email protected]>
Backport r118729 from HEAD.
	
	* RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841.

svn path=/branches/mono-2-2/mcs/; revision=118732
2008-11-13 17:15:35 +00:00
Marek Safar 7f4be72fcc 2008-11-13 Marek Safar <[email protected]>
A fix for bug #444271
	* anonymous.cs: Rescan parent storeys when best candidate was
	undone.


svn path=/branches/mono-2-2/mcs/; revision=118720
2008-11-13 15:30:22 +00:00
Rodrigo Kumpera e521732831 2008-11-11 Rodrigo Kumpera <[email protected]>
* ModuleTest.cs : Add test for ResolveMethod with a methodspec
	token.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=118545
2008-11-11 20:18:38 +00:00
Rodrigo Kumpera fc81aabdab 2008-11-11 Rodrigo Kumpera <[email protected]>
* Module.cs (ResolveMethod): Use internal method 
	GetMethodFromHandleNoGenericCheck to avoid the generic type
	limitation of GetMethodFromHandle.

	Fixes #443763.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=118544
2008-11-11 20:18:13 +00:00
Rodrigo Kumpera fcfc9108ba 2008-11-11 Rodrigo Kumpera <[email protected]>
* ConstructorOnTypeBuilderInstTest.cs: Add test for
	MetadataToken under compilation context.

	Backported from trunk.


svn path=/branches/mono-2-2/mcs/; revision=118519
2008-11-11 17:15:57 +00:00
Rodrigo Kumpera b462d915a2 Wrong date in the changelog
svn path=/branches/mono-2-2/mcs/; revision=118518
2008-11-11 17:15:29 +00:00
Rodrigo Kumpera e8d73281a2 2008-11-12 Rodrigo Kumpera <[email protected]>
* ConstructorOnTypeBuilderInst.cs (MetadataToken): Make this
        * property
        work under compiler context. Same hack as the one applied to
        MethodOnTypeBuilderInst.

        Fixes #442610.

        Backported from trunk.



svn path=/branches/mono-2-2/mcs/; revision=118517
2008-11-11 17:14:31 +00:00
Zoltan Varga ff0399cfbe 2008-11-11 Zoltan Varga <[email protected]>
Backport r118484 from HEAD.
	
	* CILCompiler.cs: Implement Reference opcode.

svn path=/branches/mono-2-2/mcs/; revision=118485
2008-11-11 11:21:15 +00:00
Andrew Jorgensen a30aa5462d Bump versions to 2.2
svn path=/branches/mono-2-2/mono/; revision=118446
2008-11-11 00:24:15 +00:00
302 changed files with 7168 additions and 1913 deletions

No files matched your search

+22
View File
@@ -1,3 +1,25 @@
2009-01-05 Zoltan Varga <[email protected]>
* configure.in: Disable sigaltstack on freebsd as it doesn't seem to work.
2008-12-15 Marek Habersack <[email protected]>
* data/Makefile.am (EXTRA_DIST): added
system.web.extensions_1.0.pc.in. Also added to pkgconfig_DATA
* data/system.web.extensions_1.0.pc.in: added. This file serves
the purpose of making MonoDevelop see the 1.0 version of the
System.Web.Extensions assembly in the project references
editor. This will also make legacy 2.0 ASP.NET apps not fail when
they reference the 1.0 version of the assembly in their project
files.
* configure.in: added data/system.web.extensions_1.0.pc to AC_OUTPUT
2008-12-05 Marek Habersack <[email protected]>
* configure.in: check whether round (3) and rint (3) are present
in the C library.
Mon Nov 10 17:37:08 CET 2008 Paolo Molaro <[email protected]>
+2 -1
View File
@@ -500,4 +500,5 @@ This is Mono.
If the directory ../olive is present (as an
independent checkout) from the Mono module, that
directory is automatically configured to share the
same prefix than this module gets.
same prefix than this module gets
+8 -2
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.1)
AM_INIT_AUTOMAKE(mono,2.2)
AM_MAINTAINER_MODE
API_VER=1.0
@@ -119,7 +119,8 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
libdl=
libgc_threads=pthreads
with_sigaltstack=yes
# This doesn't seem to work as of 7.0 on amd64
with_sigaltstack=no
# TLS is only partially implemented on -CURRENT (compiler support
# but NOT library support)
#
@@ -1582,6 +1583,9 @@ if test "x$ac_cv_truncl" != "xyes"; then
AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL, 1, [Has the 'aintl' function]) LIBS="$LIBS -lsunmath"])
fi
AC_CHECK_FUNCS(round)
AC_CHECK_FUNCS(rint)
dnl ****************************
dnl *** Look for /dev/random ***
dnl ****************************
@@ -2325,6 +2329,8 @@ data/dotnet35.pc
data/wcf.pc
data/cecil.pc
data/smcs.pc
data/system.web.extensions_1.0.pc
data/system.web.extensions.design_1.0.pc
samples/Makefile
support/Makefile
data/config
+7 -4
View File
@@ -7,21 +7,24 @@ EXTRA_DIST = \
browscap.ini mono.supp mono.d README \
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
mono-lineeditor.pc.in
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
else
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
mono_DATA = config \
browscap.ini
+12
View File
@@ -1,3 +1,15 @@
2008-12-03 Marek Habersack <[email protected]>
* machine.config: rename serviceModelHostingEnvironment to
serviceHostingEnvironment.
2008-11-14 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
HttpWebRequest to avoid a deadlock if the web service uses Session.
Bug #444343 fixed.
re: miguel
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
* web.config: default values for httpRuntime are different in 2.0
+92 -63
View File
@@ -34,6 +34,73 @@
<%@ Page debug="true" %>
<html>
<script language="javascript" type="text/javascript">
var req;
function getXML (command, url, qs) {
if (url == "" || url.substring (0, 4) != "http")
return;
var post_data = null;
req = getReq ();
req.onreadystatechange = stateChange;
if (command == "GET") {
url = url + "?" + qs;
} else {
post_data = qs;
}
req.open (command, url, true);
if (command == "POST")
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send (post_data);
}
function stateChange () {
if (req.readyState == 4) {
var node = document.getElementById("testresult_div");
var text = "";
if (req.status == 200) {
node.innerHTML = "<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
} else {
var ht = "<b style='color: red'>" + formatXml (req.status + " - " + req.statusText) + "</b>";
if (req.responseText != "")
ht = ht + "\n<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
node.innerHTML = ht;
}
}
}
function formatXml (text)
{
var re = / /g;
text = text.replace (re, "&nbsp;");
re = /\t/g;
text = text.replace (re, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
text = text.replace (re,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
re = /{(\w*):(.*?)}/g;
text = text.replace (re,"<span style='color:$1'>$2</span>");
re = /"(.*?)"/g;
text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
re = /\r\n|\r|\n/g;
text = text.replace (re, "<br/>");
return text;
}
function getReq () {
if (window.XMLHttpRequest) {
return new XMLHttpRequest(); // Firefox, Safari, ...
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
</script>
<script language="C#" runat="server">
ServiceDescriptionCollection descriptions;
@@ -329,21 +396,31 @@ class NoCheckCertificatePolicy : ICertificatePolicy {
}
}
string GetTestResult ()
{
if (!HasFormResult) return null;
string GetOrPost ()
{
return (CurrentOperationProtocols.IndexOf ("HttpGet") >= 0) ? "GET" : "POST";
}
string GetQS ()
{
bool fill = false;
string qs = "";
for (int n=0; n<Request.QueryString.Count; n++)
{
NameValueCollection query_string = Request.QueryString;
for (int n = 0; n < query_string.Count; n++) {
if (fill) {
if (qs != "") qs += "&";
qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
qs += query_string.GetKey(n) + "=" + Server.UrlEncode (query_string [n]);
}
if (Request.QueryString.GetKey(n) == "ext") fill = true;
if (query_string.GetKey(n) == "ext") fill = true;
}
return qs;
}
string GetTestResultUrl ()
{
if (!HasFormResult) return "";
string location = null;
ServiceDescription desc = descriptions [0];
Service service = desc.Services[0];
@@ -358,59 +435,7 @@ string GetTestResult ()
if (location == null)
return "Could not locate web service";
try
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
WebRequest req;
if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
req = WebRequest.Create (url);
req.Method="POST";
if (!String.IsNullOrEmpty (qs)) {
req.ContentType = "application/x-www-form-urlencoded";
byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
req.ContentLength = postBuffer.Length;
using (Stream requestStream = req.GetRequestStream())
requestStream.Write (postBuffer, 0, postBuffer.Length);
}
}
else
req = WebRequest.Create (url + "?" + qs);
if (url.StartsWith ("https:"))
ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
CookieContainer container = new CookieContainer ();
for (int i = 0; i < last; i++) {
HttpCookie hcookie = cookies [i];
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
container.Add (uri, cookie);
}
((HttpWebRequest) req).CookieContainer = container;
}
WebResponse resp = req.GetResponse();
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
catch (Exception ex)
{
string res = "<b style='color:red'>" + ex.Message + "</b>";
WebException wex = ex as WebException;
if (wex != null)
{
WebResponse resp = wex.Response;
if (resp != null) {
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
sr.Close ();
res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
}
}
return res;
}
return location + "/" + CurrentOperationName;
}
string GenerateOperationMessages (string protocol, bool generateInput)
@@ -1747,7 +1772,11 @@ This service does not contain any public web method.
</form>
<div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
The web service returned the following result:<br/><br/>
<div class="codePanel"><%=GetTestResult()%></div>
<div class="codePanel" id="testresult_div">
</div>
<script language="javascript">
getXML ("<%= GetOrPost () %>", "<%= GetTestResultUrl () %>", "<%= GetQS () %>");
</script>
</div>
<% } else {%>
The test form is not available for this operation because it has parameters with a complex structure.
+1 -1
View File
@@ -81,7 +81,7 @@
<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="diagnostic" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceModelHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -0,0 +1,4 @@
Name: System.Web.Extensions.Design
Description: System.Web.Extensions.Design ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions.Design/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.Design.dll
+4
View File
@@ -0,0 +1,4 @@
Name: System.Web.Extensions
Description: System.Web.Extensions ASP.NET 2.0 add-on
Version: 1.0.61025.0
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.dll
+21
View File
@@ -1,3 +1,24 @@
2008-11-18 Jonathan Pryor <[email protected]>
* Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
mono-tools{.config,.source} (fixes the build).
2008-11-18 Jonathan Pryor <[email protected]>
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
mono-tool{.tree,.zip} files.
* mono-file-formats.config, mono-tools.config: Alter paths to man
pages so that they're valid for building from mono/docs.
* monoapi.make: Rename to docs.make.
2008-11-18 Jonathan Pryor <[email protected]>
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
mono-tool{.tree,.zip} files.
* mono-file-formats.config, mono-tools.config: Alter paths to man
pages so that they're valid for building from mono/docs.
* monoapi.make: Rename to docs.make.
2008-11-01 Raja R Harinath <[email protected]>
* Makefile.am: Clean up for srcdir != builddir.
+21 -6
View File
@@ -5,6 +5,8 @@ sources_DATA = \
$(ASSEMBLED_DOCS)
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
EXTRA_DIST = \
@@ -18,6 +20,7 @@ EXTRA_DIST = \
convert.cs \
current-api \
deploy \
docs.make \
documented \
embedded-api \
exception-handling.txt \
@@ -39,8 +42,11 @@ EXTRA_DIST = \
mini-doc.txt \
mini-porting.txt \
mono-api-metadata.html \
mono-file-formats.config\
mono-file-formats.source\
mono_handle_d \
monoapi.make \
mono-tools.config \
mono-tools.source \
monoapi.source \
new-regalloc \
object-layout \
@@ -73,9 +79,18 @@ clean-local:
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe*
-cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
monoapi.tree monoapi.zip: monoapi.make Makefile.am toc.xml $(srcdir)/deploy/.stamp
cp $(srcdir)/api-style.css $(srcdir)/deploy/
cd $(srcdir) && $(MAKE) -f monoapi.make topdir=$(mcs_topdir_from_srcdir) assemble
monoapi.zip : monoapi.tree
monoapi.tree: docs.make Makefile.am toc.xml deploy/.stamp
cp api-style.css deploy
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
mono-tools.zip : mono-tools.tree
mono-tools.tree: docs.make Makefile.am deploy/.stamp
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
mono-file-formats.zip : mono-file-formats.tree
mono-file-formats.tree: docs.make Makefile.am deploy/.stamp
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
$(srcdir)/deploy/.stamp: convert.exe Makefile.am
$(mkdir_p) $(srcdir)/html
@@ -85,6 +100,6 @@ $(srcdir)/deploy/.stamp: convert.exe Makefile.am
extract: $(srcdir)/deploy/.stamp
convert.exe: monoapi.make convert.cs Makefile.am
cd $(srcdir) && $(MAKE) -f monoapi.make topdir=$(mcs_topdir_from_srcdir) convert.exe
convert.exe: docs.make convert.cs Makefile.am
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
+26
View File
@@ -0,0 +1,26 @@
thisdir = docs
SUBDIRS =
include $(topdir)/build/rules.make
ASSEMBLED_DOCS = \
mono-file-formats.tree mono-file-formats.zip \
mono-tools.tree mono-tools.zip \
monoapi.tree monoapi.zip
convert.exe: convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
monoapi.zip : monoapi.tree
monoapi.tree: toc.xml docs.make
$(MDOC) assemble -o monoapi -f hb $<
mono-tools.zip : mono-tools.tree
mono-tools.tree: mono-tools.config docs.make
$(MDOC) assemble -o mono-tools -f man $<
mono-file-formats.zip : mono-file-formats.tree
mono-file-formats.tree: mono-file-formats.config docs.make
$(MDOC) assemble -o mono-file-formats -f man $<
.doc-stamp:
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<manpages>
<manpage name="mdoc(5)" page="../man/mdoc.5" />
<manpage name="mono-config(5)" page="../man/mono-config.5" />
</manpages>
File renamed without changes.
+55
View File
@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<manpages>
<manpage name="al(1)" page="../man/al.1" />
<manpage name="caspol(1)" page="../man/caspol.1" />
<manpage name="cert2spc(1)" page="../man/cert2spc.1" />
<manpage name="certmgr(1)" page="../man/certmgr.1" />
<manpage name="chktrust(1)" page="../man/chktrust.1" />
<manpage name="cilc(1)" page="../man/cilc.1" />
<manpage name="disco(1)" page="../man/disco.1" />
<manpage name="dtd2xsd(1)" page="../man/dtd2xsd.1" />
<manpage name="gacutil(1)" page="../man/gacutil.1" />
<manpage name="genxs(1)" page="../man/genxs.1" />
<manpage name="httpcfg(1)" page="../man/httpcfg.1" />
<manpage name="ilasm(1)" page="../man/ilasm.1" />
<manpage name="macpack(1)" page="../man/macpack.1" />
<manpage name="makecert(1)" page="../man/makecert.1" />
<manpage name="mconfig(1)" page="../man/mconfig.1" />
<manpage name="mcs(1)" page="../man/mcs.1" />
<manpage name="mdassembler(1)" page="../man/mdassembler.1" />
<manpage name="mdcs2ecma(1)" page="../man/mdcs2ecma.1" />
<manpage name="mdnormalizer(1)" page="../man/mdnormalizer.1" />
<manpage name="mdoc(1)" page="../man/mdoc.1" />
<manpage name="mdoc-assemble(1)" page="../man/mdoc-assemble.1" />
<manpage name="mdoc-export-html(1)" page="../man/mdoc-export-html.1" />
<manpage name="mdoc-export-msxdoc(1)" page="../man/mdoc-export-msxdoc.1" />
<manpage name="mdoc-update(1)" page="../man/mdoc-update.1" />
<manpage name="mdoc-validate(1)" page="../man/mdoc-validate.1" />
<manpage name="mdvalidator(1)" page="../man/mdvalidator.1" />
<manpage name="mkbundle(1)" page="../man/mkbundle.1" />
<manpage name="mono(1)" page="../man/mono.1" />
<manpage name="mono-service(1)" page="../man/mono-service.1" />
<manpage name="mono-shlib-cop(1)" page="../man/mono-shlib-cop.1" />
<manpage name="monodocer(1)" page="../man/monodocer.1" />
<manpage name="monodocs2html(1)" page="../man/monodocs2html.1" />
<manpage name="monolinker(1)" page="../man/monolinker.1" />
<manpage name="monop(1)" page="../man/monop.1" />
<manpage name="monostyle(1)" page="../man/monostyle.1" />
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
<manpage name="mozroots(1)" page="../man/mozroots.1" />
<manpage name="oldmono(1)" page="../man/oldmono.1" />
<manpage name="permview(1)" page="../man/permview.1" />
<manpage name="prj2make(1)" page="../man/prj2make.1" />
<manpage name="resgen(1)" page="../man/resgen.1" />
<manpage name="secutil(1)" page="../man/secutil.1" />
<manpage name="setreg(1)" page="../man/setreg.1" />
<manpage name="sgen(1)" page="../man/sgen.1" />
<manpage name="signcode(1)" page="../man/signcode.1" />
<manpage name="sn(1)" page="../man/sn.1" />
<manpage name="soapsuds(1)" page="../man/soapsuds.1" />
<manpage name="sqlsharp(1)" page="../man/sqlsharp.1" />
<manpage name="vbnc(1)" page="../man/vbnc.1" />
<manpage name="wsdl(1)" page="../man/wsdl.1" />
<manpage name="wsdl2(1)" page="../man/wsdl2.1" />
<manpage name="xsd(1)" page="../man/xsd.1" />
</manpages>
File renamed without changes.
-12
View File
@@ -1,12 +0,0 @@
thisdir = docs
SUBDIRS =
include $(topdir)/build/rules.make
assemble: toc.xml
$(MDOC) assemble -o monoapi -f hb toc.xml
convert.exe: convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
.doc-stamp:
+13
View File
@@ -1,3 +1,16 @@
2008-12-31 Massimiliano Mantione <[email protected]>
* mono.1: Merged the profiler documentation from trunk (r122288),
removing the "ts" option (it does not exist anymore) and explaining
the defaults for allocation and heap profiling.
2008-12-12 Rolf Bjarne Kvinge <[email protected]>
* Makefile.am, vbnc.1: Remove vbnc.1. It's living in the
mono-basic module now.
[Backport of r121406.]
2008-10-18 Jonathan Pryor <[email protected]>
* Makefile.am (man_MANS): Remove unpackaged files.
-1
View File
@@ -48,7 +48,6 @@ man_MANS = \
sn.1 \
soapsuds.1 \
sqlsharp.1 \
vbnc.1 \
wsdl.1 \
xsd.1
+60 -20
View File
@@ -548,7 +548,7 @@ repository.
.PP
This profiler is activated passing the \fB--profile=logging\fR option to
the mono runtime, and is controlled attaching further options, like
\fB--profile=logging:stat\fR for doing statistical profiling (multiple
\fB--profile=logging:statistical\fR for doing statistical profiling (multiple
options are separated by commas).
.PP
As a quick primer, here are a few examples of the most common usage modes:
@@ -557,32 +557,70 @@ To write the resulting data to "mydata.mprof" (defaults to statistical
profiling):
.nf
mono --profile=logging:o=mydata.mprof program.exe
mono --profile=logging:output=mydata.mprof program.exe
.fi
.PP
To perform statistical profiling, inspecting call chains up to depth 8:
.nf
mono --profile=logging:s=8 program.exe
mono --profile=logging:statistical=8 program.exe
.fi
.PP
To profile allocations with caller method attribution:
To profile allocations (by default the call stack will be analized for
each allocation, producing detailed caller method attribution infornation):
.nf
mono --profile=logging:a,ts program.exe
mono --profile=logging:allocations program.exe
.fi
.PP
To profile garbage collection activity (collection time and objects freed
at each collection):
To profile garbage collection activity at a high level (collection time and objects freed
at each collection for each class are reported, but heap snapshots are not saved to disk):
.nf
mono --profile=logging:g,as program.exe
mono --profile=logging:allocations-summary program.exe
.fi
.PP
To perform heap profiling taking heap snapshots:
.nf
mono --profile=logging:heap=all program.exe
mono --profile=logging:heap=<signal> program.exe
.fi
If "all" is specified, a heap snapshot is taken at each collection.
If, instead, a signal name or number is given (one of SIGUSR1, SIGUSR2 and
SIGPROF, remembering that SIGPROF is not compatible with the statistical
profiler), a garbage collection is forced and a snapshot is taken every
time the signal is received.
Heap profiling also enables full allocation profiling (with call stacks),
and each allocation can be related to its corresponding object in the
snapshots, enabling investigations like "find all objects of a given class
allocated by a given method and still live at a given collection, and then
find all objects referencing them".
.PP
Then you would need to invoke the decoder \fImprof-decoder(1)\fR
on the output file to see the profiling results.
on the output file to see the profiling results, or to examine heap
snapshots and allocations in detail \fImprof-heap-viewer(1)\fR.
.PP
These are all the available oprions, organized by category:
The operating modes described above are the default ones, and are sufficient
to use the profiler.
.PP
To further customize the profiler behavior there are more options, described
below.
These options can be individually enabled and disabled prefixing them with
an (optional) '+' character or a '-' character.
For instance, the "allocations" option by default records also the full call
stack at each allocation.
If only the caller is wanted, one should use "allocations,-save-allocation-stack",
or to disable call tracking completely (making the profiler less intrusive)
"allocations,-save-allocation-caller,-save-allocation-stack".
In practice the "allocation" option by default behaves like
"allocations,save-allocation-caller,save-allocation-stack", but the user can
tune this to his needs.
.PP
These are all the available options, organized by category:
.PP
\fBExecution profiling modes\fR
.RS
@@ -618,18 +656,20 @@ will use the stack data).
.TP
\fIallocations\fR, \fIalloc\fR or \fIa\fR
Collect information about each allocation (object class and size).
If combined with the "ts" option, for each allocation the profiler will
also show the responsible method (and also correctly dintinguish allocations
performed during JIT time).
These information are also available when combining the "a" and "c" options,
but since "c" is much more intrusive "ts" should be preferred.
By default this also implies "+save-allocation-caller" and
"+save-allocation-stack".
.TP
\fIsave-allocation-caller\fR, \fIsac\fR
Save the direct caller of each allocation. The profiler filters out wrapper
methods, and also recognizes if the allocation has been performed by the
runtime while jitting a method.
.TP
\fIsave-allocation-stack\fR, \fIsas\fR
Save the execution stack at each allocation. While the "ts" option saves the
direct caller, this one records the whole stack trace. Note that for technical
reasons the decoder will correctly ignore wrapper methods only using the data
saved by the "ts" option (the stack traces still contain all the wrappers).
Anyway the "ts" and "sas" options can be combined, and the decoder will
Save the full managed execution stack at each allocation.
While the "sac" option saves the direct caller, this one records the whole
stack trace.
Note that in the call stack the wrapper methods are not filtered out.
Anyway the "sac" and "sas" options can be combined, and the decoder will
attribute the allocation to the correct method even if the wrapper is at the
top of the stack trace.
.TP
-162
View File
@@ -1,162 +0,0 @@
.TH vbnc 1 "21 February 2006"
.SH NAME
vbnc \- Mono Visual Basic Compiler.
.SH SYNOPSIS
.B vbnc
[option] [source-files]
.SH DESCRIPTION
.PP
.I (vbnc)
is a CIL compiler for the VisualBasic.NET language.
.PP
Applications developed on Windows with vbc can execute on Mono and applications
compiled with 'vbnc' can be executed on .NET runtime.
.PP
The Mono Visual Basic compiler accepts the same options as
the Microsoft VB.NET compiler. Those options can start with a slash or a
dash (/checked is the same as -checked).
.PP
Visual Basic.NET source files normally ends with a ".vb" extension.
Compilation of VB.NET source code requires all the files that make
up a library, module or executable to be provided on the command line.
There is no support for partial compilation. To achieve the benefits
of partial compilation, you should compile programs into their own
assemblies, and later reference them with the "-r" flag.
.PP
The Mono Basic compiler generates images (.exe files) that contain
CIL byte code that can be executed by any system that implements a Common
Language Infrastructure virtual machine such as the Microsoft .NET
runtime engine on Windows or the Mono runtime engine on Unix systems.
Executables are not bound to a specific CPU or operating system.
.PP
The Mono Basic compiler by default only references these assemblies:
mscorlib.dll, Microsoft.VisualBasic.dll, System.dll and System.Xml.dll.
If you want to reference extra libraries you must manually specify
them using the the -r: command line option.
.PP
.SH OPTIONS
.TP
.I \-addmodule:MODULE1[,MODULE2]
Includes the specified modules in the resulting assembly.
.TP
.I -codepage:ID
Specifies the code page used to process the input files from the
point it is specified on. By default files will be processed in the
current code page. The compiler will also automatically detect
Unicode/UTF8 files that have an embedded byte mark at the beginning.
.TP
Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
.TP
.I \-define:SYMLIST, -d:SYMLIST
Defines the symbol listed by the semi-colon separeted list SYMLIST
SYMBOL. This can be tested in the source code by the pre-processor,
or can be used by methods that have been tagged with the Conditional
attribute.
.TP
.I \-debug:AMOUNT
Specify the amount of debugging information to emit. Possible values for
AMOUNT are "full" and "pdbonly".
.TP
.I \-imports:import-list
Declare global Imports for listed namespaces.
.TP
.I \-ignorewarn:XXXX
Ignores warning number XXXX.
.TP
.I -lib:PATHLIST, -libpath:PATHLIST
Each path specified in the comma-separated list will direct the
compiler to look for libraries in that specified path.
.TP
.I \-main:CLASS
Tells the compiler which CLASS or MODULE contains the entry point. Useful when
you are compiling several classes with a Main method.
.TP
.I \-nologo
Suppress printing copyright information on startup.
.TP
.I \-nostdlib, -nostdlib+
Use this flag if you want to compile the core library. This makes the
compiler load its internal types from the assembly being compiled.
.TP
.I \-noconfig, \-noconfig+
Disables the default compiler configuration to be loaded. The
compiler by default has references to the system assemblies.
.TP
.I \-nowarn
Makes the compiler ignore warnings.
.TP
.I \-optioncompare:binary, \-optioncompare:text
Select between binary and text string comparisons. The default is binary
string comparisons.
.TP
.I \-optionexplicit[+|-]
Require explicit declaration of variables
.TP
.I \-optionstrict[+|-]
Enforce strict language semantics
.TP
.I \-out:FNAME, -o FNAME
Names the output file to be generated.
.TP
.I -q -quiet
Commands the compiler to show only error messages for syntax-related errors
and warnings.
.TP
.I -resource:RESOURCE[,ID]
Embeds to the given resource file. The optional ID can be used to
give a different name to the resource. If not specified, the resource
name will be the file name.
.TP
.I -linkresource:RESOURCE[,ID]
Links to the specified RESOURCE. The optional ID can be used to give
a name to the linked resource.
.TP
.I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
Reference the named assemblies. Use this to use classes from the named
assembly in your program. The assembly will be loaded from either the
system directory where all the assemblies live, or from the path
explicitly given with the -L option.
.PP
You can also use a semicolon to separate the assemblies instead of a
comma.
.TP
.I \-removeintchecks[+|-]
Remove integer checks. Default off.
.TP
.I \-rootnamespace:namespace
Specifies the root namespace for all type declarations
.TP
.I \-target:KIND, \-t:KIND
Used to specify the desired target. The possible values are: exe
(plain executable), winexe (Windows.Forms executable), library
(component libraries) and module (partial library).
.TP
.I \-utf8output[+|-]
Emit compiler output in UTF8 character encoding. Currently ignored.
.TP
.I \-\-version
Shows the compiler version.
.TP
.I \-warnaserror, \-warnaserror+
Treat warnings as errors.
.SH STABILITY
As of early 2007, the Mono Visual Basic compiler is still considered preview
software. The compiler is almost feature-complete (targeting the Microsoft
Visual Basic 8 compiler), only lacking support for the 'My' namespace.
Frequent crashes are still occuring, especially with incorrect code.
.PP
.SH AUTHORS
See the ChangeLog for authors
.PP
.SH LICENSE
The Mono Visual Basic compiler is released under the terms of the GNU LGPL.
Alternative licenses are available from Novell.
.PP
.SH SEE ALSO
mcs(1), mono(1), mint(1), sn(1)
.PP
.SH BUGS
To report bugs in the compiler, you can file bug reports in our
bug tracking system: http://bugzilla.ximian.com.
.SH MAILING LIST
The Mono Basic Mailing List is available at: [email protected]
+7
View File
@@ -1,3 +1,10 @@
2008-11-18 Jonathan Pryor <[email protected]>
* docs/Makefile: Don't build mono-file-formats.*, mono-tools.*
* docs/mono-file-formats.config, docs/mono-file-formats.source,
docs/mono-tools.config, docs/mono-tools.source: Removed (now located
in mono/docs).
2008-11-02 Jonathan Pryor <[email protected]>
* docs/Makefile (MONO_DIRS): Add Mono.Simd.
+1 -1
View File
@@ -22,7 +22,7 @@
* System.Windows.Forms.dll.resources: Removed unused dialog-*.png images.
2008-09-18 Mike Gorse <<[email protected]>
2008-09-18 Mike Gorse <[email protected]>
* System.Windows.Forms.dll.sources: Added IKeyFilter.cs.
@@ -1,3 +1,26 @@
2008-11-30 Ivan N. Zlatev <[email protected]>
* GroupBoxRenderer.cs: Fix when VisualStyles disabled:
- No caption text is drawn because Color.Empty is used.
- Fix top and height off by 1.
[Fixes bug #448764]
2008-11-24 Jonathan Pobst <[email protected]>
* Form.cs: Don't change min/max size if it is empty.
[Fixes bug #447873]
2008-11-21 Jonathan Pobst <[email protected]>
* XPlatUI.cs: Take new Platform.MacOSX into account.
[Fixes bug #447663]
2008-11-20 Jonathan Pobst <[email protected]>
* ComboBox.cs: Call HideWindow instead of Hide when closing the dropdown
through DroppedDown so the proper events get called and state gets reset.
[Fixes bug #446805]
2008-11-10 Jonathan Pobst <[email protected]>
* TextControl.cs: Add some order of operation to our math so
@@ -509,7 +509,7 @@ namespace System.Windows.Forms
if (value)
DropDownListBox ();
else
listbox_ctrl.Hide ();
listbox_ctrl.HideWindow ();
}
}
@@ -2765,4 +2765,4 @@ namespace System.Windows.Forms
#endregion Private Methods
}
}
}
}
@@ -891,10 +891,12 @@ namespace System.Windows.Forms {
maximum_size = value;
// If this is smaller than the min, adjust the min
if (maximum_size.Width <= minimum_size.Width)
minimum_size.Width = maximum_size.Width;
if (maximum_size.Height <= minimum_size.Height)
minimum_size.Height = maximum_size.Height;
if (!minimum_size.IsEmpty) {
if (maximum_size.Width <= minimum_size.Width)
minimum_size.Width = maximum_size.Width;
if (maximum_size.Height <= minimum_size.Height)
minimum_size.Height = maximum_size.Height;
}
OnMaximumSizeChanged(EventArgs.Empty);
if (IsHandleCreated) {
@@ -1077,11 +1079,13 @@ namespace System.Windows.Forms {
minimum_size = value;
// If this is bigger than the max, adjust the max
if (minimum_size.Width >= maximum_size.Width)
maximum_size.Width = minimum_size.Width;
if (minimum_size.Height >= maximum_size.Height)
maximum_size.Height = minimum_size.Height;
if (!maximum_size.IsEmpty) {
if (minimum_size.Width >= maximum_size.Width)
maximum_size.Width = minimum_size.Width;
if (minimum_size.Height >= maximum_size.Height)
maximum_size.Height = minimum_size.Height;
}
if ((Size.Width < value.Width) || (Size.Height < value.Height)) {
Size = new Size(Math.Max(Size.Width, value.Width), Math.Max(Size.Height, value.Height));
}
@@ -99,7 +99,7 @@ namespace System.Windows.Forms
// part of the bounds as height, they use it as the bottom, so the boxes are drawn in completely different
// places. Rather than emulate this bug, we do it correctly. After googling for a while, I don't think
// anyone has ever actually used this class for anything, so it should be fine. :)
Rectangle new_bounds = new Rectangle (bounds.Left, bounds.Top + (int)(font_size.Height / 2) - 1, bounds.Width, bounds.Height - (int)(font_size.Height / 2) + 1);
Rectangle new_bounds = new Rectangle (bounds.Left, bounds.Top + (int)(font_size.Height / 2), bounds.Width, bounds.Height - (int)(font_size.Height / 2));
// Don't paint over the background where we are going to put the text
Region old_clip = g.Clip;
@@ -109,8 +109,11 @@ namespace System.Windows.Forms
g.Clip = old_clip;
if (groupBoxText != String.Empty)
if (groupBoxText != String.Empty) {
if (textColor == Color.Empty)
textColor = SystemColors.ControlText;
TextRenderer.DrawText (g, groupBoxText, font, new Point (bounds.Left + 8, bounds.Top), textColor, flags);
}
}
}
@@ -120,7 +120,7 @@ namespace System.Windows.Forms {
public static bool RunningOnUnix {
get {
#if NET_2_0
return (Environment.OSVersion.Platform == PlatformID.Unix);
return (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX);
#else
int platform = (int) Environment.OSVersion.Platform;
return (platform == 128);
@@ -1,3 +1,7 @@
2008-11-23 Jonathan Pobst <[email protected]>
* FormTest.cs: Add test for bug #447873.
2008-11-07 Jonathan Pobst <[email protected]>
* DefaultLayoutTest.cs: Add some tests from Jonathan Anderson
@@ -2327,6 +2327,20 @@ namespace MonoTests.System.Windows.Forms
f.Dispose ();
}
[Test]
public void MinSizeIssue ()
{
Form f = new Form ();
f.MinimumSize = new Size (100, 100);
f.Show ();
Assert.AreEqual (new Size (300, 300), f.Size, "A1");
f.Dispose ();
}
[Test] // Bug #81582
[Category ("NotWorking")]
+7 -1
View File
@@ -116,7 +116,13 @@ namespace Cairo {
{
get { return NativeMethods.cairo_pattern_status (pattern); }
}
public Extend Extend
{
get { return NativeMethods.cairo_pattern_get_extend (pattern); }
set { NativeMethods.cairo_pattern_set_extend (pattern, value); }
}
public Matrix Matrix {
set {
NativeMethods.cairo_pattern_set_matrix (pattern, value);
@@ -1,3 +1,10 @@
2008-12-08 Zoltan Varga <[email protected]>
Backport of r120995.
* SQLite3.cs: Avoid IntPtr.ToInt32 () to convert between IntPtr's and integers
since it is not 64 bit safe. Fixes #457038.
2008-07-06 Sebastien Pouliot <[email protected]>
* SqliteDataSourceEnumerator.cs: Replace a few Type.GetType by typeof
@@ -472,9 +472,11 @@ namespace Mono.Data.Sqlite
if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart;
if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;
if (nCopied > 0)
Marshal.Copy((IntPtr)(ptr.ToInt32() + nDataOffset), bDest, nStart, nCopied);
else nCopied = 0;
unsafe {
if (nCopied > 0)
Marshal.Copy((IntPtr)((byte*)ptr + nDataOffset), bDest, nStart, nCopied);
else nCopied = 0;
}
return nCopied;
}
@@ -551,9 +553,11 @@ namespace Mono.Data.Sqlite
if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart;
if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;
if (nCopied > 0)
Marshal.Copy((IntPtr)(ptr.ToInt32() + nDataOffset), bDest, nStart, nCopied);
else nCopied = 0;
unsafe {
if (nCopied > 0)
Marshal.Copy((IntPtr)((byte*)ptr + nDataOffset), bDest, nStart, nCopied);
else nCopied = 0;
}
return nCopied;
}
@@ -1,3 +1,26 @@
2008-12-05 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: support parameter names with or without a leading '@'.
2008-11-13 Veerapuram Varadhan <[email protected]>
* TdsComm.cs (ResetConnection, IsConnected): Added a property and
method. IsConnected will check for any connection-reset occurrance
from other end-point of the underlying socket. ResetConnection
adds the "reset" bit in the Status flag field of packet header.
Set socket option to keep alive, whereever supported and also, let
the socket close along with the underlying stream.
* Tds70.cs (Reset): Use the new ResetConnection property instead
of executing sp_reset_connection. Saves a round-trip.
2008-11-11 Gert Driesen <[email protected]>
* Tds70.cs: Support writing negative (small)money values. Added
overflow check for smallmoney values. Fixes bug #428139.
* Tds.cs: Fixed reading negative (small)money values.
2008-11-09 Gert Driesen <[email protected]>
* TdsConnectionPool.cs: Added TdsConnectionPoolManager.GetConnection
@@ -1139,12 +1139,23 @@ namespace Mono.Data.Tds.Protocol
}
switch (len) {
case 4:
return new Decimal (Comm.GetTdsInt (), 0, 0, false, 4);
case 4: {
int val = Comm.GetTdsInt ();
bool negative = val < 0;
if (negative)
val = ~(val - 1);
return new Decimal (val, 0, 0, negative, 4);
}
case 8:
int hi = Comm.GetTdsInt ();
int lo = Comm.GetTdsInt ();
return new Decimal (lo, hi, 0, false, 4);
bool negative = hi < 0;
if (negative) {
hi = ~hi;
lo = ~(lo - 1);
}
return new Decimal (lo, hi, 0, negative, 4);
default:
return DBNull.Value;
}
@@ -33,10 +33,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using Mono.Security.Protocol.Ntlm;
using System;
using System.Globalization;
using System.Text;
using Mono.Security.Protocol.Ntlm;
namespace Mono.Data.Tds.Protocol
{
public sealed class Tds70 : Tds
@@ -44,6 +46,8 @@ namespace Mono.Data.Tds.Protocol
#region Fields
public readonly static TdsVersion Version = TdsVersion.tds70;
static readonly decimal SMALLMONEY_MIN = -214748.3648m;
static readonly decimal SMALLMONEY_MAX = 214748.3647m;
#endregion // Fields
@@ -79,14 +83,15 @@ namespace Mono.Data.Tds.Protocol
StringBuilder result = new StringBuilder ();
foreach (TdsMetaParameter p in Parameters) {
string includeAt = "@";
if (p.ParameterName [0] == '@')
includeAt = string.Empty;
string parameterName = p.ParameterName;
if (parameterName [0] == '@') {
parameterName = parameterName.Substring (1);
}
if (p.Direction != TdsParameterDirection.ReturnValue) {
if (result.Length > 0)
result.Append (", ");
if (p.Direction == TdsParameterDirection.InputOutput)
result.Append (String.Format("{0}{1}={1} output", includeAt, p.ParameterName));
result.AppendFormat ("@{0}={0} output", parameterName);
else
result.Append (FormatParameter (p));
}
@@ -355,21 +360,13 @@ namespace Mono.Data.Tds.Protocol
{
// Check validity of the connection - a false removes
// the connection from the pool
if (!Comm.stream.CanWrite)
// NOTE: MS implementation will throw a connection-reset error as it will
// try to use the same connection
if (!Comm.IsConnected ())
return false;
try {
ExecProc ("sp_reset_connection");
base.Reset ();
} catch (Exception e) {
System.Reflection.PropertyInfo pinfo = e.GetType ().GetProperty ("Class");
if (pinfo != null && pinfo.PropertyType == typeof (byte)) {
byte klass = (byte) pinfo.GetValue (e, null);
// 11 to 16 indicates error that can be fixed by the user such as 'Invalid object name'
if (klass < 11 || klass > 16)
return false;
}
}
// Set "reset-connection" bit for the next message packet
Comm.ResetConnection = true;
return true;
}
@@ -400,8 +397,14 @@ namespace Mono.Data.Tds.Protocol
foreach (TdsMetaParameter param in parameters) {
if (param.Direction == TdsParameterDirection.ReturnValue)
continue;
Comm.Append ( (byte) param.ParameterName.Length );
Comm.Append (param.ParameterName);
string pname = param.ParameterName;
if (pname != null && pname.Length > 0 && pname [0] == '@') {
Comm.Append ( (byte) pname.Length);
Comm.Append (pname);
} else {
Comm.Append ( (byte) (pname.Length + 1));
Comm.Append ("@" + pname);
}
short status = 0; // unused
if (param.Direction != TdsParameterDirection.Input)
status |= 0x01; // output
@@ -463,13 +466,30 @@ namespace Mono.Data.Tds.Protocol
case "money" : {
Decimal val = (decimal) param.Value;
int[] arr = Decimal.GetBits (val);
int sign = (val>0 ? 1: -1);
Comm.Append (sign * arr[1]);
Comm.Append (sign * arr[0]);
if (val >= 0) {
Comm.Append (arr[1]);
Comm.Append (arr[0]);
} else {
Comm.Append (~arr[1]);
Comm.Append (~arr[0] + 1);
}
break;
}
case "smallmoney": {
Decimal val = (decimal) param.Value;
if (val < SMALLMONEY_MIN || val > SMALLMONEY_MAX)
throw new OverflowException (string.Format (
CultureInfo.InvariantCulture,
"Value '{0}' is not valid for SmallMoney."
+ " Must be between {1:N4} and {2:N4}.",
#if NET_2_0
val,
#else
val.ToString (CultureInfo.CurrentCulture),
#endif
SMALLMONEY_MIN, SMALLMONEY_MAX));
int[] arr = Decimal.GetBits (val);
int sign = (val>0 ? 1: -1);
Comm.Append (sign * arr[0]);
@@ -512,11 +532,12 @@ namespace Mono.Data.Tds.Protocol
private string FormatParameter (TdsMetaParameter parameter)
{
string includeAt = "@";
if (parameter.ParameterName [0] == '@')
includeAt = string.Empty;
string parameterName = parameter.ParameterName;
if (parameterName [0] == '@') {
parameterName = parameterName.Substring (1);
}
if (parameter.Direction == TdsParameterDirection.Output)
return String.Format ("{0}{1}={1} output", includeAt, parameter.ParameterName);
return String.Format ("@{0}={0} output", parameterName);
if (parameter.Value == null || parameter.Value == DBNull.Value)
return parameter.ParameterName + "=NULL";
@@ -573,7 +594,7 @@ namespace Mono.Data.Tds.Protocol
break;
}
return includeAt + parameter.ParameterName + "=" + value;
return "@" + parameterName + "=" + value;
}
public override string Prepare (string commandText, TdsMetaParameterCollection parameters)
@@ -39,9 +39,10 @@ namespace Mono.Data.Tds.Protocol {
{
#region Fields
internal NetworkStream stream;
NetworkStream stream;
int packetSize;
TdsPacketType packetType = TdsPacketType.None;
bool connReset;
Encoding encoder;
string dataSource;
@@ -112,7 +113,16 @@ namespace Mono.Data.Tds.Protocol {
else if (timeout > 0 && !connected.WaitOne ())
throw Tds.CreateTimeoutException (dataSource, "Open()");
stream = new NetworkStream (socket);
try {
// MS sets these socket option
socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
} catch (SocketException se) {
// Some platform may throw an exception, so
// eat all socket exception, yeaowww!
}
// Let the stream own the socket and take the pleasure of closing it
stream = new NetworkStream (socket, true);
} catch (SocketException e) {
throw new TdsInternalException ("Server does not exist or connection refused.", e);
}
@@ -327,9 +337,15 @@ namespace Mono.Data.Tds.Protocol {
public void Close ()
{
connReset = false;
stream.Close ();
}
public bool IsConnected ()
{
return !(socket.Poll (0, SelectMode.SelectRead) && socket.Available == 0);
}
private void ConnectCallback (IAsyncResult ar)
{
Socket s = (Socket) ar.AsyncState;
@@ -550,19 +566,32 @@ namespace Mono.Data.Tds.Protocol {
}
}
public bool ResetConnection {
get { return connReset; }
set { connReset = value; }
}
public void SendPacket ()
{
// Reset connection flag is only valid for SQLBatch/RPC/DTC messages
if (packetType != TdsPacketType.Query && packetType != TdsPacketType.RPC)
connReset = false;
SendPhysicalPacket (true);
nextOutBufferIndex = 0;
packetType = TdsPacketType.None;
// Reset connection-reset flag to false - as any exception would anyway close
// the whole connection
connReset = false;
}
private void SendPhysicalPacket (bool isLastSegment)
{
if (nextOutBufferIndex > headerLength || packetType == TdsPacketType.Cancel) {
byte status = (byte) ((isLastSegment ? 0x01 : 0x00) | (connReset ? 0x08 : 0x00));
// packet type
Store (0, (byte) packetType);
Store (1, (byte) (isLastSegment ? 1 : 0));
Store (1, status);
Store (2, (short) nextOutBufferIndex );
Store (4, (byte) 0);
Store (5, (byte) 0);
+14
View File
@@ -1,3 +1,17 @@
2009-01-07 Rodrigo Kumpera <[email protected]>
* Vector*.cs: Use explicit layout to avoid the runtime
miscalculating the size of vector types.
Backported from trunk.
2008-11-17 Rodrigo Kumpera <[email protected]>
* Vector2l.cs (CompareGreaterThan): This method requires sse 4.2
and 4.1.
Backported from trunk.
2008-11-04 Rodrigo Kumpera <[email protected]>
* Vector*.cs: Use a better name for the prefetch
+33 -2
View File
@@ -29,10 +29,41 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
public struct Vector16b
{
private byte v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
[ FieldOffset(0) ]
internal byte v0;
[ FieldOffset(1) ]
internal byte v1;
[ FieldOffset(2) ]
internal byte v2;
[ FieldOffset(3) ]
internal byte v3;
[ FieldOffset(4) ]
internal byte v4;
[ FieldOffset(5) ]
internal byte v5;
[ FieldOffset(6) ]
internal byte v6;
[ FieldOffset(7) ]
internal byte v7;
[ FieldOffset(8) ]
internal byte v8;
[ FieldOffset(9) ]
internal byte v9;
[ FieldOffset(10) ]
internal byte v10;
[ FieldOffset(11) ]
internal byte v11;
[ FieldOffset(12) ]
internal byte v12;
[ FieldOffset(13) ]
internal byte v13;
[ FieldOffset(14) ]
internal byte v14;
[ FieldOffset(15) ]
internal byte v15;
public Vector16b (byte v0, byte v1, byte v2, byte v3, byte v4, byte v5, byte v6, byte v7, byte v8, byte v9, byte v10, byte v11, byte v12, byte v13, byte v14, byte v15)
{
this.v0 = v0;
+34 -2
View File
@@ -29,11 +29,43 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
[CLSCompliant(false)]
public struct Vector16sb
{
private sbyte v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
[ FieldOffset(0) ]
internal sbyte v0;
[ FieldOffset(1) ]
internal sbyte v1;
[ FieldOffset(2) ]
internal sbyte v2;
[ FieldOffset(3) ]
internal sbyte v3;
[ FieldOffset(4) ]
internal sbyte v4;
[ FieldOffset(5) ]
internal sbyte v5;
[ FieldOffset(6) ]
internal sbyte v6;
[ FieldOffset(7) ]
internal sbyte v7;
[ FieldOffset(8) ]
internal sbyte v8;
[ FieldOffset(9) ]
internal sbyte v9;
[ FieldOffset(10) ]
internal sbyte v10;
[ FieldOffset(11) ]
internal sbyte v11;
[ FieldOffset(12) ]
internal sbyte v12;
[ FieldOffset(13) ]
internal sbyte v13;
[ FieldOffset(14) ]
internal sbyte v14;
[ FieldOffset(15) ]
internal sbyte v15;
public Vector16sb (sbyte v0, sbyte v1, sbyte v2, sbyte v3, sbyte v4, sbyte v5, sbyte v6, sbyte v7, sbyte v8, sbyte v9, sbyte v10, sbyte v11, sbyte v12, sbyte v13, sbyte v14, sbyte v15)
{
this.v0 = v0;
+5 -3
View File
@@ -31,11 +31,13 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector2d
{
private double x;
private double y;
[ FieldOffset(0) ]
internal double x;
[ FieldOffset(8) ]
internal double y;
public double X { get { return x; } set { x = value; } }
public double Y { get { return y; } set { y = value; } }
+6 -4
View File
@@ -29,11 +29,13 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector2l
{
private long x;
private long y;
[ FieldOffset(0) ]
internal long x;
[ FieldOffset(8) ]
internal long y;
public long X { get { return x; } set { x = value; } }
public long Y { get { return y; } set { y = value; } }
@@ -113,7 +115,7 @@ namespace Mono.Simd
return new Vector2l ((long)(v1.x == v2.x ? -1 : 0), (long)(v1.y == v2.y ? -1 : 0));
}
[Acceleration (AccelMode.SSE41)]
[Acceleration (AccelMode.SSE42)]
public static Vector2l CompareGreaterThan (Vector2l v1, Vector2l v2)
{
return new Vector2l ((long)(v1.x > v2.x ? -1 : 0), (long)(v1.y > v2.y ? -1 : 0));
+5 -3
View File
@@ -29,12 +29,14 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector2ul
{
private ulong x;
private ulong y;
[ FieldOffset(0) ]
internal ulong x;
[ FieldOffset(8) ]
internal ulong y;
public ulong X { get { return x; } set { x = value; } }
public ulong Y { get { return y; } set { y = value; } }
+9 -5
View File
@@ -86,13 +86,17 @@ namespace Mono.Simd
Replace Shuffle with less bug prone methods
*/
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector4f
{
private float x;
private float y;
private float z;
private float w;
[ FieldOffset(0) ]
internal float x;
[ FieldOffset(4) ]
internal float y;
[ FieldOffset(8) ]
internal float z;
[ FieldOffset(12) ]
internal float w;
public float X { get { return x; } set { x = value; } }
public float Y { get { return y; } set { y = value; } }
+9 -5
View File
@@ -29,13 +29,17 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector4i
{
private int x;
private int y;
private int z;
private int w;
[ FieldOffset(0) ]
internal int x;
[ FieldOffset(4) ]
internal int y;
[ FieldOffset(8) ]
internal int z;
[ FieldOffset(12) ]
internal int w;
public int X { get { return x; } set { x = value; } }
public int Y { get { return y; } set { y = value; } }
+9 -5
View File
@@ -29,14 +29,18 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector4ui
{
private uint x;
private uint y;
private uint z;
private uint w;
[ FieldOffset(0) ]
internal uint x;
[ FieldOffset(4) ]
internal uint y;
[ FieldOffset(8) ]
internal uint z;
[ FieldOffset(12) ]
internal uint w;
public uint X { get { return x; } set { x = value; } }
public uint Y { get { return y; } set { y = value; } }
+18 -2
View File
@@ -29,10 +29,26 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector8s
{
private short v0, v1, v2, v3, v4, v5, v6, v7;
[ FieldOffset(0) ]
internal short v0;
[ FieldOffset(2) ]
internal short v1;
[ FieldOffset(4) ]
internal short v2;
[ FieldOffset(6) ]
internal short v3;
[ FieldOffset(8) ]
internal short v4;
[ FieldOffset(10) ]
internal short v5;
[ FieldOffset(12) ]
internal short v6;
[ FieldOffset(14) ]
internal short v7;
public Vector8s (short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)
{
this.v0 = v0;
+18 -2
View File
@@ -29,11 +29,27 @@ using System.Runtime.InteropServices;
namespace Mono.Simd
{
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector8us
{
private ushort v0, v1, v2, v3, v4, v5, v6, v7;
[ FieldOffset(0) ]
internal ushort v0;
[ FieldOffset(2) ]
internal ushort v1;
[ FieldOffset(4) ]
internal ushort v2;
[ FieldOffset(6) ]
internal ushort v3;
[ FieldOffset(8) ]
internal ushort v4;
[ FieldOffset(10) ]
internal ushort v5;
[ FieldOffset(12) ]
internal ushort v6;
[ FieldOffset(14) ]
internal ushort v7;
public Vector8us (ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)
{
this.v0 = v0;
@@ -1,3 +1,8 @@
2008-12-19 Marek Habersack <[email protected]>
* SettingsMappingManager.cs: make sure _runningOnWindows is set
correctly on MacOS/X.
2008-09-18 Marek Habersack <[email protected]>
* SettingsMappingManager.cs: take care of a small race condition
@@ -70,7 +70,7 @@ namespace Mono.Web.Util
{
_mappingFile = Path.Combine (Path.GetDirectoryName (RuntimeEnvironment.SystemConfigurationFile), settingsMapFileName);
PlatformID pid = Environment.OSVersion.Platform;
_runningOnWindows = ((int) pid != 128 && (int) pid != 4);
_runningOnWindows = ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
}
+26
View File
@@ -1,3 +1,29 @@
2008-11-21 Andreia Gaita <[email protected]>
* Mono.Mozilla/DOM/ContentListener.cs: Added (oops)
2008-11-20 Andreia Gaita <[email protected]>
* Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: Support script
execution directly in the browser object
[Backported, r118685]
2008-11-20 Andreia Gaita <[email protected]>
* Mono.Mozilla/DOM/Node.cs, Mono.Mozilla/DOM/Window.cs: Fix equality
operators
[Backported, r118684, r119336]
2008-11-20 Andreia Gaita <[email protected]>
* Mono.WebBrowser.dll.sources, Mono.WebBrowser2K5.csproj,
Mono.Mozilla/interfaces/nsIURIContentListener.cs,
Mono.Mozilla/DOM/ContentListener.cs: New class added to listen for load
requests and handle content types
* Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: New
NavigationRequested event to catch load requests
[Backported, r118617]
2008-11-08 Andreia Gaita <[email protected]>
* Mono.WebBrowser/Manager.cs: Use new webkit backend if requested. If it
@@ -0,0 +1,121 @@
//Permission is hereby granted, free of charge, to any person obtaining
//a copy of this software and associated documentation files (the
//"Software"), to deal in the Software without restriction, including
//without limitation the rights to use, copy, modify, merge, publish,
//distribute, sublicense, and/or sell copies of the Software, and to
//permit persons to whom the Software is furnished to do so, subject to
//the following conditions:
//
//The above copyright notice and this permission notice shall be
//included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
//MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
//LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
//OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
//WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//Copyright (c) 2008 Novell, Inc.
//
//Authors:
// Andreia Gaita ([email protected])
//
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Mono.WebBrowser;
namespace Mono.Mozilla.DOM
{
internal class ContentListener : nsIURIContentListener
{
WebBrowser owner;
public ContentListener (WebBrowser instance) {
owner = instance;
}
EventHandlerList events;
public EventHandlerList Events {
get {
if (events == null)
events = new EventHandlerList ();
return events;
}
}
public void AddHandler (NavigationRequestedEventHandler value) {
if (Events[WebBrowser.NavigationRequestedEvent] == null) {
if (owner.Navigation != null) {
nsIWebBrowser browser = (nsIWebBrowser) owner.navigation.navigation;
browser.setParentURIContentListener (this);
}
}
Events.AddHandler (WebBrowser.NavigationRequestedEvent, value);
}
public void RemoveHandler (NavigationRequestedEventHandler value) {
Events.RemoveHandler (WebBrowser.NavigationRequestedEvent, value);
}
bool nsIURIContentListener.onStartURIOpen (nsIURI aURI)
{
NavigationRequestedEventHandler eh = (NavigationRequestedEventHandler) (Events[WebBrowser.NavigationRequestedEvent]);
if (eh != null) {
AsciiString uri = new Mono.Mozilla.AsciiString ("");
aURI.getSpec (uri.Handle);
NavigationRequestedEventArgs args = new NavigationRequestedEventArgs (uri.ToString ());
eh (this, args);
return args.Cancel;
}
return true;
}
bool nsIURIContentListener.doContent (string aContentType,
bool aIsContentPreferred,
nsIRequest aRequest,
out nsIStreamListener aContentHandler)
{
aContentHandler = null;
return true;
}
bool nsIURIContentListener.isPreferred (string aContentType,
ref string aDesiredContentType)
{
return true;
}
bool nsIURIContentListener.canHandleContent (string aContentType,
bool aIsContentPreferred,
ref string aDesiredContentType)
{
return true;
}
[return: MarshalAs (UnmanagedType.Interface)] IntPtr nsIURIContentListener.getLoadCookie ()
{
return IntPtr.Zero;
}
void nsIURIContentListener.setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value)
{
return;
}
nsIURIContentListener nsIURIContentListener.getParentContentListener ()
{
return null;
}
void nsIURIContentListener.setParentContentListener (nsIURIContentListener value)
{
return;
}
}
}
@@ -382,8 +382,12 @@ namespace Mono.Mozilla.DOM
public static bool operator == (Node left, Node right)
{
if (left == null || right == null)
if ((object)left == (object)right)
return true;
if ((object)left == null || (object)right == null)
return false;
return left.hashcode == right.hashcode;
}
@@ -182,8 +182,12 @@ namespace Mono.Mozilla.DOM
public static bool operator == (Window left, Window right)
{
if (left == null || right == null)
if ((object)left == (object)right)
return true;
if ((object)left == null || (object)right == null)
return false;
return left.hashcode == right.hashcode;
}
@@ -148,7 +148,15 @@ namespace Mono.Mozilla
return events;
}
}
Mono.Mozilla.DOM.ContentListener contentListener;
Mono.Mozilla.DOM.ContentListener ContentListener {
get {
if (contentListener == null)
contentListener = new Mono.Mozilla.DOM.ContentListener (this);
return contentListener;
}
}
nsIServiceManager servMan;
internal nsIServiceManager ServiceManager {
@@ -294,7 +302,10 @@ namespace Mono.Mozilla
stream.closeStream ();
}
public void ExecuteScript (string script) {
Base.EvalScript (this, script);
}
internal void AttachEvent (INode node, string eve, EventHandler handler) {
string key = String.Intern (node.GetHashCode() + ":" + eve);
@@ -342,6 +353,7 @@ namespace Mono.Mozilla
internal static object ProgressEvent = new object ();
internal static object ContextMenuEvent = new object ();
internal static object NavigationRequestedEvent = new object ();
public event NodeEventHandler KeyDown
{
@@ -467,6 +479,12 @@ namespace Mono.Mozilla
remove { Events.RemoveHandler (ContextMenuEvent, value); }
}
public event NavigationRequestedEventHandler NavigationRequested
{
add { ContentListener.AddHandler (value); }
remove { ContentListener.RemoveHandler (value); }
}
internal static object GenericEvent = new object ();
internal event EventHandler Generic
{
@@ -475,7 +493,5 @@ namespace Mono.Mozilla
}
#endregion
}
}
@@ -38,47 +38,35 @@ namespace Mono.Mozilla {
internal interface nsIURIContentListener {
#region nsIURIContentListener
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int onStartURIOpen (
[MarshalAs (UnmanagedType.Interface)] nsIURI aURI, out bool ret);
bool onStartURIOpen ([MarshalAs (UnmanagedType.Interface)] nsIURI aURI);
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int doContent (
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler, out bool ret);
bool doContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler);
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int isPreferred (
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType, out bool ret);
bool isPreferred ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType);
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int canHandleContent (
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType, out bool ret);
bool canHandleContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType);
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int getLoadCookie ( out IntPtr ret);
[return: MarshalAs (UnmanagedType.Interface)] IntPtr getLoadCookie ();
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int setLoadCookie ( IntPtr value);
void setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value);
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int getParentContentListener ([MarshalAs (UnmanagedType.Interface)] out nsIURIContentListener ret);
[return: MarshalAs (UnmanagedType.Interface)] nsIURIContentListener getParentContentListener ();
[PreserveSigAttribute]
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
int setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value);
void setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value);
#endregion
}
@@ -92,3 +80,76 @@ namespace Mono.Mozilla {
}
}
}
#if example
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Text;
internal class URIContentListener : nsIURIContentListener {
#region nsIURIContentListener
bool nsIURIContentListener.onStartURIOpen ([MarshalAs (UnmanagedType.Interface)] nsIURI aURI)
{
return ;
}
bool nsIURIContentListener.doContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler)
{
return ;
}
bool nsIURIContentListener.isPreferred ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType)
{
return ;
}
bool nsIURIContentListener.canHandleContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
bool aIsContentPreferred,
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType)
{
return ;
}
[return: MarshalAs (UnmanagedType.Interface)] IntPtr nsIURIContentListener.getLoadCookie ()
{
return IntPtr.Zero;
}
void nsIURIContentListener.setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value)
{
return IntPtr.Zero;
}
[return: MarshalAs (UnmanagedType.Interface)] nsIURIContentListener nsIURIContentListener.getParentContentListener ()
{
return null;
}
void nsIURIContentListener.setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value)
{
return null;
}
#endregion
}
#endif
@@ -3,6 +3,7 @@ Assembly/AssemblyInfo.cs
Mono.Mozilla/AsciiString.cs
Mono.Mozilla/Base.cs
Mono.Mozilla/Callback.cs
Mono.Mozilla/DOM/ContentListener.cs
Mono.Mozilla/DOM/DocumentEncoder.cs
Mono.Mozilla/DOM/DocumentType.cs
Mono.Mozilla/DOM/DOMImplementation.cs
@@ -61,6 +61,8 @@ namespace Mono.WebBrowser
void Render (byte[] data);
void Render (string html);
void Render (string html, string uri, string contentType);
void ExecuteScript (string script);
bool Initialized { get; }
IWindow Window { get; }
@@ -96,6 +98,8 @@ namespace Mono.WebBrowser
event SecurityChangedEventHandler SecurityChanged;
event ContextMenuEventHandler ContextMenuShown;
event NavigationRequestedEventHandler NavigationRequested;
}
public enum ReloadOption : uint
@@ -409,6 +413,17 @@ namespace Mono.WebBrowser
this.x = x;
this.y = y;
}
}
}
public delegate void NavigationRequestedEventHandler (object sender, NavigationRequestedEventArgs e);
public class NavigationRequestedEventArgs : System.ComponentModel.CancelEventArgs {
private string uri;
public string Uri {
get {return uri;}
}
public NavigationRequestedEventArgs (string uri) {
this.uri = uri;
}
}
#endregion
}
@@ -82,6 +82,7 @@
<Compile Include="Mono.Mozilla\AsciiString.cs" />
<Compile Include="Mono.Mozilla\Base.cs" />
<Compile Include="Mono.Mozilla\Callback.cs" />
<Compile Include="Mono.Mozilla\DOM\ContentListener.cs" />
<Compile Include="Mono.Mozilla\DOM\DocumentEncoder.cs" />
<Compile Include="Mono.Mozilla\DOM\DocumentType.cs" />
<Compile Include="Mono.Mozilla\DOM\DOMImplementation.cs" />
-2
View File
@@ -21,8 +21,6 @@ LIB_MCS_FLAGS = \
$(RESX_RES:%=/res:%)
endif
NO_TEST = yes
include ../../build/library.make
RESULTCODE_MESSAGES = Novell.Directory.Ldap.Utilclass/ResultCodeMessages.resources
@@ -1,3 +1,9 @@
2008-12-20 Jeroen Asselman <[email protected]>
* Connection.cs: Apply patch from #436775, there is no need to
free the semaphores both in the catch clauses as well as the
finally clause.
2006-12-28 Jon Larimer <[email protected]>
* Connection.cs: Add a try/finally section to release the
@@ -813,7 +813,6 @@ namespace Novell.Directory.Ldap
catch (System.Net.Sockets.SocketException se)
{
// Unable to connect to server host:port
freeWriteSemaphore(semId);
sock = null;
socket = null;
throw new LdapException(ExceptionMessages.CONNECTION_ERROR, new System.Object[] { host, port }, LdapException.CONNECT_ERROR, null, se);
@@ -821,7 +820,6 @@ namespace Novell.Directory.Ldap
catch (System.IO.IOException ioe)
{
// Unable to connect to server host:port
freeWriteSemaphore(semId);
sock = null;
socket = null;
throw new LdapException(ExceptionMessages.CONNECTION_ERROR, new System.Object[]{host, port}, LdapException.CONNECT_ERROR, null, ioe);
@@ -81,4 +81,5 @@ System.Security.Cryptography/SHA512Cng.cs
System.Security.Cryptography/SHA512CryptoServiceProvider.cs
System.Threading/LockRecursionException.cs
System.Threading/LockRecursionPolicy.cs
System.Threading/ReaderWriterLockSlim.cs
@@ -0,0 +1,474 @@
//
// System.Threading.ReaderWriterLockSlim.cs
//
// Authors:
// Miguel de Icaza ([email protected])
// Dick Porter ([email protected])
// Jackson Harper ([email protected])
// Lluis Sanchez Gual ([email protected])
// Marek Safar ([email protected])
//
// Copyright 2004-2008 Novell, Inc (http://www.novell.com)
// Copyright 2003, Ximian, Inc.
//
// NoRecursion code based on the blog post from Vance Morrison:
// http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx
//
// Recursion code based on Mono's implementation of ReaderWriterLock.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Diagnostics;
using System.Threading;
namespace System.Threading {
//
// This implementation is based on the light-weight
// Reader/Writer lock sample from Vance Morrison's blog:
//
// http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx
//
// And in Mono's ReaderWriterLock
//
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)]
public class ReaderWriterLockSlim : IDisposable {
// Are we on a multiprocessor?
static readonly bool smp;
// Lock specifiation for myLock: This lock protects exactly the local fields associted
// instance of MyReaderWriterLock. It does NOT protect the memory associted with the
// the events that hang off this lock (eg writeEvent, readEvent upgradeEvent).
int myLock;
// Who owns the lock owners > 0 => readers
// owners = -1 means there is one writer, Owners must be >= -1.
int owners;
Thread upgradable_thread;
// These variables allow use to avoid Setting events (which is expensive) if we don't have to.
uint numWriteWaiters; // maximum number of threads that can be doing a WaitOne on the writeEvent
uint numReadWaiters; // maximum number of threads that can be doing a WaitOne on the readEvent
uint numUpgradeWaiters; // maximum number of threads that can be doing a WaitOne on the upgradeEvent (at most 1).
// conditions we wait on.
EventWaitHandle writeEvent; // threads waiting to aquire a write lock go here.
EventWaitHandle readEvent; // threads waiting to aquire a read lock go here (will be released in bulk)
EventWaitHandle upgradeEvent; // thread waiting to upgrade a read lock to a write lock go here (at most one)
//int lock_owner;
// Only set if we are a recursive lock
//Dictionary<int,int> reader_locks;
readonly LockRecursionPolicy recursionPolicy;
bool is_disposed;
static ReaderWriterLockSlim ()
{
smp = Environment.ProcessorCount > 1;
}
public ReaderWriterLockSlim ()
{
// NoRecursion (0) is the default value
}
public ReaderWriterLockSlim (LockRecursionPolicy recursionPolicy)
{
this.recursionPolicy = recursionPolicy;
if (recursionPolicy != LockRecursionPolicy.NoRecursion){
//reader_locks = new Dictionary<int,int> ();
throw new NotImplementedException ("recursionPolicy != NoRecursion not currently implemented");
}
}
public void EnterReadLock ()
{
TryEnterReadLock (-1);
}
public bool TryEnterReadLock (int millisecondsTimeout)
{
if (millisecondsTimeout < Timeout.Infinite)
throw new ArgumentOutOfRangeException ("millisecondsTimeout");
if (is_disposed)
throw new ObjectDisposedException (null);
EnterMyLock ();
while (true){
// Easy case, no contention
// owners >= 0 means there might be readers (but no writer)
if (owners >= 0 && numWriteWaiters == 0){
owners++;
break;
}
// If the request is to probe.
if (millisecondsTimeout == 0){
ExitMyLock ();
return false;
}
// We need to wait. Mark that we have waiters and wait.
if (readEvent == null) {
LazyCreateEvent (ref readEvent, false);
// since we left the lock, start over.
continue;
}
if (!WaitOnEvent (readEvent, ref numReadWaiters, millisecondsTimeout))
return false;
}
ExitMyLock ();
return true;
}
public bool TryEnterReadLock (TimeSpan timeout)
{
int ms = CheckTimeout (timeout);
return TryEnterReadLock (ms);
}
//
// TODO: What to do if we are releasing a ReadLock and we do not own it?
//
public void ExitReadLock ()
{
EnterMyLock ();
Debug.Assert(owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken");
--owners;
ExitAndWakeUpAppropriateWaiters ();
}
public void EnterWriteLock ()
{
TryEnterWriteLock (-1);
}
public bool TryEnterWriteLock (int millisecondsTimeout)
{
EnterMyLock ();
while (true){
// There is no contention, we are done
if (owners == 0){
// Indicate that we have a writer
owners = -1;
break;
}
// If we are the thread that took the Upgradable read lock
if (owners == 1 && upgradable_thread == Thread.CurrentThread){
owners = -1;
break;
}
// If the request is to probe.
if (millisecondsTimeout == 0){
ExitMyLock ();
return false;
}
// We need to wait, figure out what kind of waiting.
if (upgradable_thread == Thread.CurrentThread){
// We are the upgradable thread, register our interest.
if (upgradeEvent == null){
LazyCreateEvent (ref upgradeEvent, false);
// since we left the lock, start over.
continue;
}
if (numUpgradeWaiters > 0){
ExitMyLock ();
throw new ApplicationException ("Upgrading lock to writer lock already in process, deadlock");
}
if (!WaitOnEvent (upgradeEvent, ref numUpgradeWaiters, millisecondsTimeout))
return false;
} else {
if (writeEvent == null){
LazyCreateEvent (ref writeEvent, true);
// since we left the lock, retry
continue;
}
if (!WaitOnEvent (writeEvent, ref numWriteWaiters, millisecondsTimeout))
return false;
}
}
Debug.Assert (owners == -1, "Owners is not -1");
ExitMyLock ();
return true;
}
public bool TryEnterWriteLock (TimeSpan timeout)
{
return TryEnterWriteLock (CheckTimeout (timeout));
}
public void ExitWriteLock ()
{
EnterMyLock ();
Debug.Assert (owners == -1, "Calling ReleaseWriterLock when no write lock is held");
Debug.Assert (numUpgradeWaiters > 0);
upgradable_thread = null;
owners = 0;
ExitAndWakeUpAppropriateWaiters ();
}
public void EnterUpgradeableReadLock ()
{
TryEnterUpgradeableReadLock (-1);
}
//
// Taking the Upgradable read lock is like taking a read lock
// but we limit it to a single upgradable at a time.
//
public bool TryEnterUpgradeableReadLock (int millisecondsTimeout)
{
EnterMyLock ();
while (true){
if (owners == 0 && numWriteWaiters == 0 && upgradable_thread == null){
owners++;
upgradable_thread = Thread.CurrentThread;
break;
}
// If the request is to probe
if (millisecondsTimeout == 0){
ExitMyLock ();
return false;
}
if (readEvent == null){
LazyCreateEvent (ref readEvent, false);
// since we left the lock, start over.
continue;
}
if (!WaitOnEvent (readEvent, ref numReadWaiters, millisecondsTimeout))
return false;
}
ExitMyLock ();
return true;
}
public bool TryEnterUpgradeableReadLock (TimeSpan timeout)
{
return TryEnterUpgradeableReadLock (CheckTimeout (timeout));
}
public void ExitUpgradeableReadLock ()
{
EnterMyLock ();
Debug.Assert (owners > 0, "Releasing an upgradable lock, but there was no reader!");
--owners;
upgradable_thread = null;
ExitAndWakeUpAppropriateWaiters ();
}
public void Dispose ()
{
is_disposed = true;
}
public bool IsReadLockHeld {
get { throw new NotImplementedException (); }
}
public bool IsWriteLockHeld {
get { throw new NotImplementedException (); }
}
public bool IsUpgradeableReadLockHeld {
get { throw new NotImplementedException (); }
}
public int CurrentReadCount {
get { throw new NotImplementedException (); }
}
public int RecursiveReadCount {
get { throw new NotImplementedException (); }
}
public int RecursiveUpgradeCount {
get { throw new NotImplementedException (); }
}
public int RecursiveWriteCount {
get { throw new NotImplementedException (); }
}
public int WaitingReadCount {
get { throw new NotImplementedException (); }
}
public int WaitingUpgradeCount {
get { throw new NotImplementedException (); }
}
public int WaitingWriteCount {
get { throw new NotImplementedException (); }
}
public LockRecursionPolicy RecursionPolicy {
get { return recursionPolicy; }
}
#region Private methods
void EnterMyLock ()
{
if (Interlocked.CompareExchange(ref myLock, 1, 0) != 0)
EnterMyLockSpin ();
}
void EnterMyLockSpin ()
{
for (int i = 0; ;i++) {
if (i < 3 && smp)
Thread.SpinWait (20); // Wait a few dozen instructions to let another processor release lock.
else
Thread.Sleep (0); // Give up my quantum.
if (Interlocked.CompareExchange(ref myLock, 1, 0) == 0)
return;
}
}
void ExitMyLock()
{
Debug.Assert (myLock != 0, "Exiting spin lock that is not held");
myLock = 0;
}
bool MyLockHeld { get { return myLock != 0; } }
/// <summary>
/// Determines the appropriate events to set, leaves the locks, and sets the events.
/// </summary>
private void ExitAndWakeUpAppropriateWaiters()
{
Debug.Assert (MyLockHeld);
// First a writing thread waiting on being upgraded
if (owners == 1 && numUpgradeWaiters != 0){
// Exit before signaling to improve efficiency (wakee will need the lock)
ExitMyLock ();
// release all upgraders (however there can be at most one).
upgradeEvent.Set ();
//
// TODO: What does the following comment mean?
// two threads upgrading is a guarenteed deadlock, so we throw in that case.
} else if (owners == 0 && numWriteWaiters > 0) {
// Exit before signaling to improve efficiency (wakee will need the lock)
ExitMyLock ();
// release one writer.
writeEvent.Set ();
}
else if (owners >= 0 && numReadWaiters != 0) {
// Exit before signaling to improve efficiency (wakee will need the lock)
ExitMyLock ();
// release all readers.
readEvent.Set();
} else
ExitMyLock();
}
/// <summary>
/// A routine for lazily creating a event outside the lock (so if errors
/// happen they are outside the lock and that we don't do much work
/// while holding a spin lock). If all goes well, reenter the lock and
/// set 'waitEvent'
/// </summary>
void LazyCreateEvent(ref EventWaitHandle waitEvent, bool makeAutoResetEvent)
{
Debug.Assert (MyLockHeld);
Debug.Assert (waitEvent == null);
ExitMyLock ();
EventWaitHandle newEvent;
if (makeAutoResetEvent)
newEvent = new AutoResetEvent (false);
else
newEvent = new ManualResetEvent (false);
EnterMyLock ();
// maybe someone snuck in.
if (waitEvent == null)
waitEvent = newEvent;
}
/// <summary>
/// Waits on 'waitEvent' with a timeout of 'millisceondsTimeout.
/// Before the wait 'numWaiters' is incremented and is restored before leaving this routine.
/// </summary>
bool WaitOnEvent (EventWaitHandle waitEvent, ref uint numWaiters, int millisecondsTimeout)
{
Debug.Assert (MyLockHeld);
waitEvent.Reset ();
numWaiters++;
bool waitSuccessful = false;
// Do the wait outside of any lock
ExitMyLock();
try {
waitSuccessful = waitEvent.WaitOne (millisecondsTimeout, false);
} finally {
EnterMyLock ();
--numWaiters;
if (!waitSuccessful)
ExitMyLock ();
}
return waitSuccessful;
}
static int CheckTimeout (TimeSpan timeout)
{
try {
return checked((int) timeout.TotalMilliseconds);
} catch (System.OverflowException) {
throw new ArgumentOutOfRangeException ("timeout");
}
}
#endregion
}
}
@@ -1,3 +1,8 @@
2008-12-02 Marek Habersack <[email protected]>
* System.Data.DataSetExtensions_test.dll.sources: added
System.Data/DataRowExtensionsTest.cs
2008-10-17 Jonathan Pryor <[email protected]>
* Test/Makefile: Add doc-update target support.
@@ -1,3 +1,4 @@
System.Data/DataRowComparerTest.cs
System.Data/DataRowExtensionsTest.cs
System.Data/DataTableExtensionsTest.cs
System.Data/EnumerableRowCollectionTest.cs
@@ -1,3 +1,10 @@
2008-12-02 Marek Habersack <[email protected]>
* DataRowExtensions.cs: when Field <T> is specialized on a
nullable type (either a reference or an instance of Nullable <T>)
do not throw exception for column value being DBNull but return
null instead.
2008-05-14 Atsushi Enomoto <[email protected]>
* DataTableExtensions.cs :
@@ -43,8 +43,15 @@ namespace System.Data
public static T Field<T> (this DataRow row, int columnIndex, DataRowVersion version)
{
object ret = row [columnIndex, version];
if (ret == DBNull.Value)
throw new StrongTypingException ("Cannot get strong typed value since it is DB null.", null);
if (ret == DBNull.Value) {
Type type = typeof (T);
Type genericTypeDef = type.IsGenericType ? type.GetGenericTypeDefinition () : null;
if (!type.IsValueType || genericTypeDef != null && genericTypeDef == typeof (Nullable <>))
return default (T);
throw new StrongTypingException ("Cannot get strong typed value since it is DB null. Please use a nullable type.", null);
}
return (T) ret;
}
@@ -1,3 +1,7 @@
2008-12-02 Marek Habersack <[email protected]>
* DataRowExtensionsTest.cs: added
2008-05-14 Atsushi Enomoto <[email protected]>
* DataTableExtensionsTest.cs : new test.
@@ -0,0 +1,82 @@
//
// DataRowExtensionsTest.cs
//
// Author:
// Marek Habersack ([email protected])
//
// Copyright (C) 2008 Novell, Inc. http://www.novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Data;
using NUnit.Framework;
namespace MonoTests.System.Data
{
[TestFixture]
public class DataRowExtensionsTest
{
DataRow SetupRow ()
{
DataTable dt = new DataTable ("TestTable");
DataColumn dc = new DataColumn ("Column1", typeof (string));
dc.AllowDBNull = true;
dt.Columns.Add (dc);
dc = new DataColumn ("Column2", typeof (int));
dc.AllowDBNull = true;
dt.Columns.Add (dc);
DataRow row = dt.NewRow ();
dt.Rows.Add (row);
return row;
}
[Test]
public void Field_T_DBNullFieldValue ()
{
DataRow row = SetupRow ();
row ["Column1"] = null;
row ["Column2"] = DBNull.Value;
string s = row.Field <string> ("Column1");
Assert.AreEqual (null, s, "#A1");
int? i = row.Field <int?> ("Column2");
Assert.AreEqual (null, i, "#A2");
}
[Test]
[ExpectedException (typeof (StrongTypingException))]
public void Field_T_DBNullFieldValue_ValueType ()
{
DataRow row = SetupRow ();
row ["Column1"] = null;
row ["Column2"] = DBNull.Value;
int i = row.Field <int> ("Column2");
}
}
}
@@ -458,7 +458,7 @@ namespace System.Data.OracleClient.Oci
return Decimal.Parse (String.Copy ((string) tmp), formatProvider);
break;
case OciDataType.TimeStamp:
return dateTimeDesc.GetDateTime (Parent.Parent, dateTimeDesc.ErrorHandle);
return dateTimeDesc.GetDateTime (conn.Environment, dateTimeDesc.ErrorHandle);
case OciDataType.Date:
return UnpackDate ();
case OciDataType.Raw:
+4
View File
@@ -1,3 +1,7 @@
2008-12-21 Veerapuram Varadhan <[email protected]>
* System.Data_test.dll.sources: Add the new SqlXmlTest.cs
2008-08-27 Daniel Morgan <[email protected]>
* System.Data.SqlClient/SqlConnectionStringBuilder.cs: modified -
@@ -1,3 +1,7 @@
2008-11-13 Veerapuram Varadhan <[email protected]>
* SqlCommand.cs: Reset connection when timeout occurs.
2008-11-09 Gert Driesen <[email protected]>
* SqlConnection.cs (ClearPool): Added null check.
@@ -453,6 +453,7 @@ namespace System.Data.SqlClient {
try {
Connection.Tds.ExecProc (sql, localParameters.MetaParameters, 0, true);
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -514,6 +515,7 @@ namespace System.Data.SqlClient {
// 2) Somebody has an exclusive lock on Table/DB
// In any of these cases, don't close the connection. Let the user do it
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
Connection.Tds.Reset ();
} catch (TdsInternalException ex) {
Connection.Close ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
@@ -529,6 +531,7 @@ namespace System.Data.SqlClient {
try {
Connection.Tds.Execute (sql, parms, CommandTimeout, wantResults);
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -541,7 +544,8 @@ namespace System.Data.SqlClient {
try {
Connection.Tds.ExecPrepared (preparedStatement, parms, CommandTimeout, wantResults);
} catch (TdsTimeoutException ex) {
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
@@ -563,6 +567,7 @@ namespace System.Data.SqlClient {
Execute (false);
result = Connection.Tds.RecordsAffected;
} catch (TdsTimeoutException e) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) e);
}
@@ -614,6 +619,7 @@ namespace System.Data.SqlClient {
GetOutputParameters ();
}
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -633,6 +639,7 @@ namespace System.Data.SqlClient {
try {
Execute (true);
} catch (TdsTimeoutException e) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) e);
}
@@ -836,6 +843,7 @@ namespace System.Data.SqlClient {
callback,
state);
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -850,6 +858,7 @@ namespace System.Data.SqlClient {
else
ar = Connection.Tds.BeginExecuteNonQuery (sql, parms, callback, state);
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -862,6 +871,7 @@ namespace System.Data.SqlClient {
try {
Connection.Tds.ExecPrepared (preparedStatement, parms, CommandTimeout, wantResults);
} catch (TdsTimeoutException ex) {
Connection.Tds.Reset ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
} catch (TdsInternalException ex) {
Connection.Close ();
@@ -1,3 +1,11 @@
2008-12-21 Veerapuram Varadhan <[email protected]>
* SqlXml.cs (CreateReader): Better use
ConformanceLevel.Fragment while creating the reader as column
values are not really Xml documents. Also, throw
SqlNullValueException when data is null.
(.ctor): Take good care of empty XmlReaders.
2008-09-24 Veerapuram Varadhan <[email protected]>
* SqlXml.cs (.ctor): Use unicode encoding instead of ASCII.
@@ -97,8 +97,11 @@ namespace System.Data.SqlTypes
notNull = false;
xmlValue = null;
} else {
value.MoveToContent ();
xmlValue = value.ReadOuterXml();
if (value.Read ()) {
value.MoveToContent ();
xmlValue = value.ReadOuterXml();
} else
xmlValue = String.Empty;
notNull = true;
}
}
@@ -129,10 +132,12 @@ namespace System.Data.SqlTypes
public XmlReader CreateReader ()
{
if (notNull)
return XmlTextReader.Create (new StringReader (xmlValue));
else
return null;
if (notNull) {
XmlReaderSettings xs = new XmlReaderSettings ();
xs.ConformanceLevel = ConformanceLevel.Fragment;
return XmlTextReader.Create (new StringReader (xmlValue), xs);
} else
throw new SqlNullValueException ();
}
[MonoTODO]
@@ -14,6 +14,7 @@ System.Data.SqlTypes/SqlDateTimeTest.cs
System.Data.SqlTypes/SqlGuidTest.cs
System.Data.SqlTypes/SqlDecimalTest.cs
System.Data.SqlTypes/SqlStringTest.cs
System.Data.SqlTypes/SqlXmlTest.cs
System.Xml/XmlDataDocumentTest.cs
System.Xml/XmlDataDocumentTest2.cs
System.Data/BinarySerializationTest.cs
@@ -1,3 +1,13 @@
2008-11-11 Gert Driesen <[email protected]>
* SqlCommandTest.cs: Added (SMALL)MONEY rounding tests.
2008-11-11 Gert Driesen <[email protected]>
* SqlCommandTest.cs: Added tests for bug #428139. Added test for
SMALLMONEY overflows. Added workaround for Assert.AreEqual bug in
NUnit v2.2.0.
2008-11-09 Gert Driesen <[email protected]>
* SqlConnectionTest.cs: Added tests for ClearPool and ClearAllPools.
@@ -35,6 +35,9 @@ using System.Data.Common;
using System.Data.SqlClient;
#if NET_2_0
using System.Data.Sql;
#endif
using System.Globalization;
#if NET_2_0
using System.Xml;
#endif
@@ -50,6 +53,9 @@ namespace MonoTests.System.Data.SqlClient
SqlCommand cmd;
string connectionString = ConnectionManager.Singleton.ConnectionString;
static readonly decimal SMALLMONEY_MAX = 214748.3647m;
static readonly decimal SMALLMONEY_MIN = -214748.3648m;
[TearDown]
public void TearDown ()
{
@@ -1392,7 +1398,9 @@ namespace MonoTests.System.Data.SqlClient
cmd.Parameters ["@fname"].Value = TestPar;
Assert.AreEqual(1,cmd.ExecuteNonQuery());
} finally {
DBHelper.ExecuteNonQuery (conn, DROP_TMP_SP_TEMP_INSERT_PERSON);
DBHelper.ExecuteNonQuery (conn, string.Format (
CultureInfo.InvariantCulture,
DROP_STORED_PROCEDURE, "#sp_temp_insert_employee"));
DBHelper.ExecuteSimpleSP (conn, "sp_clean_person_table");
ConnectionManager.Singleton.CloseConnection ();
}
@@ -1576,7 +1584,8 @@ namespace MonoTests.System.Data.SqlClient
public void StoredProc_ParameterTest ()
{
string create_query = CREATE_TMP_SP_PARAM_TEST;
string drop_query = DROP_TMP_SP_PARAM_TEST;
string drop_query = string.Format (CultureInfo.InvariantCulture,
DROP_STORED_PROCEDURE, "#tmp_sp_param_test");
SqlConnection conn = new SqlConnection (connectionString);
@@ -1669,14 +1678,11 @@ namespace MonoTests.System.Data.SqlClient
DBHelper.ExecuteNonQuery (conn,
String.Format (create_query, "decimal(10,2)"));
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
10.665, 10.67, 11);
// FIXME: NUnit 2.2.0 bug
/*
10.665, 10.67m, 11m);
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
0m, 0m, 0m);
*/
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
-5.657, -5.66m, -6);
-5.657, -5.66m, -6m);
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
DBNull.Value, DBNull.Value,
DBNull.Value);
@@ -1690,7 +1696,7 @@ namespace MonoTests.System.Data.SqlClient
rpc_helper_function (cmd, SqlDbType.Float, 0,
10.54, 10.54, 10.54);
rpc_helper_function (cmd, SqlDbType.Float, 0,
0, 0, 0);
0, 0d, 0d);
rpc_helper_function (cmd, SqlDbType.Float, 0,
-5.34, -5.34, -5.34);
rpc_helper_function (cmd, SqlDbType.Float, 0,
@@ -1731,22 +1737,68 @@ namespace MonoTests.System.Data.SqlClient
// Test Money Param
DBHelper.ExecuteNonQuery (conn,
String.Format (create_query, "money"));
// FIXME: NUnit 2.2.0 bug
/*
rpc_helper_function (cmd, SqlDbType.Money, 0,
10m, 10m, 10m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
10.54, 10.54m, 10.54m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
0, 0m, 0m);
*/
/*
rpc_helper_function (cmd, SqlDbType.Money, 0,
-5.34, -5.34m, -5.34m);
*/
rpc_helper_function (cmd, SqlDbType.Money, 0,
5.34, 5.34m, 5.34m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-10.1234m, -10.1234m, -10.1234m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
10.1234m, 10.1234m, 10.1234m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-2000000000m, -2000000000m, -2000000000m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
2000000000m, 2000000000m, 2000000000m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.2345m, -200000000.2345m, -200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.2345m, 200000000.2345m, 200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
DBNull.Value, DBNull.Value,
DBNull.Value);
// rounding tests
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234561m, -200000000.2346m, -200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234551m, -200000000.2346m, -200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234541m, -200000000.2345m, -200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234561m, 200000000.2346m, 200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234551m, 200000000.2346m, 200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234541m, 200000000.2345m, 200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234461m, -200000000.2345m, -200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234451m, -200000000.2345m, -200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234441m, -200000000.2344m, -200000000.2344m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234461m, 200000000.2345m, 200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234451m, 200000000.2345m, 200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234441m, 200000000.2344m, 200000000.2344m);
// FIXME: we round toward even in SqlParameter.ConvertToFrameworkType
/*
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234550m, -200000000.2346m, -200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234550m, 200000000.2346m, 200000000.2346m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
-200000000.234450m, -200000000.2345m, -200000000.2345m);
rpc_helper_function (cmd, SqlDbType.Money, 0,
200000000.234450m, 200000000.2345m, 200000000.2345m);
*/
break;
case 23 :
// Test NChar Param
@@ -1797,23 +1849,23 @@ namespace MonoTests.System.Data.SqlClient
DBHelper.ExecuteNonQuery (conn,
String.Format (create_query, "real"));
rpc_helper_function (cmd, SqlDbType.Real, 0,
10m, 10m, 10m);
10m, 10f, 10f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
10d, 10m, 10m);
10d, 10f, 10f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
0, 0m, 0m);
0, 0f, 0f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
3.54d, 3.54m, 3.54m);
3.54d, 3.54f, 3.54f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
10, 10m, 10m);
10, 10f, 10f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
10.5f, 10.5m, 10.5m);
10.5f, 10.5f, 10.5f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
3.5d, 3.5m, 3.5m);
3.5d, 3.5f, 3.5f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
4.54m, 4.54m, 4.54m);
4.54m, 4.54f, 4.54f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
-4.54m, -4.54m, -4.54m);
-4.54m, -4.54f, -4.54f);
rpc_helper_function (cmd, SqlDbType.Real, 0,
DBNull.Value, DBNull.Value, DBNull.Value);
break;
@@ -1834,9 +1886,9 @@ namespace MonoTests.System.Data.SqlClient
DBHelper.ExecuteNonQuery (conn,
String.Format (create_query, "smallint"));
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
10, 10, 10);
10, (short) 10, (short) 10);
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
-10, -10, -10);
-10, (short) -10, (short) -10);
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
short.MaxValue, short.MaxValue,
short.MaxValue);
@@ -1851,8 +1903,6 @@ namespace MonoTests.System.Data.SqlClient
// Test SmallMoney Param
DBHelper.ExecuteNonQuery (conn,
String.Format (create_query, "smallmoney"));
// FIXME: NUnit 2.2.0 bug
/*
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
10.0d, 10m, 10m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
@@ -1869,9 +1919,49 @@ namespace MonoTests.System.Data.SqlClient
4.54m, 4.54m, 4.54m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.54m, -4.54m, -4.54m);
*/
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-214748.3648m, -214748.3648m, -214748.3648m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
214748.3647m, 214748.3647m, 214748.3647m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
DBNull.Value, DBNull.Value, DBNull.Value);
// rounding tests
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543361m, -4.5434m, -4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543351m, -4.5434m, -4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543341m, -4.5433m, -4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543361m, 4.5434m, 4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543351m, 4.5434m, 4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543341m, 4.5433m, 4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543261m, -4.5433m, -4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543251m, -4.5433m, -4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543241m, -4.5432m, -4.5432m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543261m, 4.5433m, 4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543251m, 4.5433m, 4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543241m, 4.5432m, 4.5432m);
// FIXME: we round toward even in SqlParameter.ConvertToFrameworkType
/*
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543350m, -4.5434m, -4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543350m, 4.5434m, 4.5434m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
-4.543250m, -4.5433m, -4.5433m);
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
4.543250m, 4.5433m, 4.5433m);
*/
break;
case 16 :
// Test Text Param
@@ -1898,9 +1988,9 @@ namespace MonoTests.System.Data.SqlClient
DBHelper.ExecuteNonQuery (conn,
String.Format(create_query,"tinyint"));
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
10.0d, 10m, 10m);
10.0d, (byte) 10, (byte) 10);
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
0, 0, 0);
0, (byte) 0, (byte) 0);
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
byte.MaxValue, byte.MaxValue, byte.MaxValue);
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
@@ -1957,9 +2047,9 @@ namespace MonoTests.System.Data.SqlClient
label = -2;
break;
}
}catch (AssertionException ex) {
} catch (AssertionException ex) {
error += String.Format (" Case {0} INCORRECT VALUE : {1}\n", label, ex.ToString ());
}catch (Exception ex) {
} catch (Exception ex) {
error += String.Format (" Case {0} NOT WORKING : {1}\n", label, ex.ToString ());
}
@@ -1997,11 +2087,11 @@ namespace MonoTests.System.Data.SqlClient
cmd.CommandType = CommandType.StoredProcedure;
using (SqlDataReader reader = cmd.ExecuteReader ()) {
Assert.IsTrue (reader.Read (), "#1");
Assert.AreEqual (expectedRead, reader.GetValue (0), "#2");
AreEqual (expectedRead, reader.GetValue (0), "#2");
Assert.IsFalse (reader.Read (), "#3");
}
Assert.AreEqual (expectedOut, param2.Value, "#4");
Assert.AreEqual (5, retval.Value, "#5");
AreEqual (expectedOut, param2.Value, "#4");
AreEqual (5, retval.Value, "#5");
}
[Test]
@@ -2140,6 +2230,108 @@ namespace MonoTests.System.Data.SqlClient
}
}
[Test]
public void SmallMoney_Overflow_Max ()
{
conn = new SqlConnection (connectionString);
conn.Open ();
DBHelper.ExecuteNonQuery (conn, string.Format (
CultureInfo.InvariantCulture, CREATE_TMP_SP_TYPE_TEST,
"SMALLMONEY"));
//decimal overflow = 214748.36471m;
decimal overflow = 214748.3648m;
cmd = conn.CreateCommand ();
cmd.CommandText = "#tmp_sp_type_test";
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter param = cmd.Parameters.Add ("@param",
SqlDbType.SmallMoney);
param.Value = overflow;
try {
cmd.ExecuteScalar ();
Assert.Fail ("#1");
} catch (OverflowException ex) {
// SqlDbType.SmallMoney overflow. Value '214748.36471'
// is out of range. Must be between -214,748.3648 and 214,748.3647
Assert.AreEqual (typeof (OverflowException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
#if NET_2_0
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "'{0}'",
overflow)) != -1, "#5:" + ex.Message);
#else
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.CurrentCulture, "'{0}'",
overflow)) != -1, "#5:" + ex.Message);
#endif
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "{0:N4}",
SMALLMONEY_MIN)) != -1, "#6:" + ex.Message);
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "{0:N4}",
SMALLMONEY_MAX)) != -1, "#7:" + ex.Message);
} finally {
DBHelper.ExecuteNonQuery (conn, string.Format (
CultureInfo.InvariantCulture,
DROP_STORED_PROCEDURE, "#tmp_sp_type_test"));
}
}
[Test]
public void SmallMoney_Overflow_Min ()
{
conn = new SqlConnection (connectionString);
conn.Open ();
DBHelper.ExecuteNonQuery (conn, string.Format (
CultureInfo.InvariantCulture, CREATE_TMP_SP_TYPE_TEST,
"SMALLMONEY"));
//decimal overflow = -214748.36481m;
decimal overflow = -214748.3649m;
cmd = conn.CreateCommand ();
cmd.CommandText = "#tmp_sp_type_test";
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter param = cmd.Parameters.Add ("@param",
SqlDbType.SmallMoney);
param.Value = overflow;
try {
cmd.ExecuteScalar ();
Assert.Fail ("#1");
} catch (OverflowException ex) {
// SqlDbType.SmallMoney overflow. Value '-214748,36481'
// is out of range. Must be between -214,748.3648 and 214,748.3647
Assert.AreEqual (typeof (OverflowException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
#if NET_2_0
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "'{0}'",
overflow)) != -1, "#5:" + ex.Message);
#else
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.CurrentCulture, "'{0}'",
overflow)) != -1, "#5:" + ex.Message);
#endif
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "{0:N4}",
SMALLMONEY_MIN)) != -1, "#6:" + ex.Message);
Assert.IsTrue (ex.Message.IndexOf (string.Format (
CultureInfo.InvariantCulture, "{0:N4}",
SMALLMONEY_MAX)) != -1, "#7:" + ex.Message);
} finally {
DBHelper.ExecuteNonQuery (conn, string.Format (
CultureInfo.InvariantCulture,
DROP_STORED_PROCEDURE, "#tmp_sp_type_test"));
}
}
#if NET_2_0
[Test]
public void NotificationTest ()
@@ -2365,15 +2557,50 @@ namespace MonoTests.System.Data.SqlClient
Assert.AreEqual (100, param0Val);
}
// used as workaround for bugs in NUnit 2.2.0
static void AreEqual (object x, object y, string msg)
{
if (x == null && y == null)
return;
if ((x == null || y == null))
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
"Expected: {0}, but was: {1}. {2}",
x == null ? "<null>" : x, y == null ? "<null>" : y, msg));
bool isArrayX = x.GetType ().IsArray;
bool isArrayY = y.GetType ().IsArray;
if (isArrayX && isArrayY) {
Array arrayX = (Array) x;
Array arrayY = (Array) y;
if (arrayX.Length != arrayY.Length)
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
"Length of arrays differs. Expected: {0}, but was: {1}. {2}",
arrayX.Length, arrayY.Length, msg));
for (int i = 0; i < arrayX.Length; i++) {
object itemX = arrayX.GetValue (i);
object itemY = arrayY.GetValue (i);
if (!itemX.Equals (itemY))
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
"Arrays differ at position {0}. Expected: {1}, but was: {2}. {3}",
i, itemX, itemY, msg));
}
} else if (!x.Equals (y)) {
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
"Expected: {0} ({1}), but was: {2} ({3}). {4}",
x, x.GetType (), y, y.GetType (), msg));
}
}
private enum Status
{
OK = 0,
Error = 3
}
private readonly string CREATE_TMP_SP_PARAM_TEST = "create procedure #tmp_sp_param_test (@param1 {0}, @param2 {0} output) as begin select @param1 set @param2=@param1 return 5 end";
private readonly string DROP_TMP_SP_PARAM_TEST = "drop procedure #tmp_sp_param_test";
private static readonly string CREATE_TMP_SP_PARAM_TEST = "create procedure #tmp_sp_param_test (@param1 {0}, @param2 {0} output) as begin select @param1 set @param2=@param1 return 5 end";
private readonly string CREATE_TMP_SP_TEMP_INSERT_PERSON = ("create procedure #sp_temp_insert_employee ( " + Environment.NewLine +
"@fname varchar (20)) " + Environment.NewLine +
"as " + Environment.NewLine +
@@ -2384,10 +2611,12 @@ namespace MonoTests.System.Data.SqlClient
"insert into employee (id, fname, dob, doj) values (@id, @fname, '1980-02-11', getdate ());" + Environment.NewLine +
"return @id;" + Environment.NewLine +
"end");
private readonly string DROP_TMP_SP_TEMP_INSERT_PERSON = ("if exists (select name from sysobjects where " + Environment.NewLine +
"name = '#sp_temp_insert_employee' and type = 'P') " + Environment.NewLine +
"drop procedure #sp_temp_insert_employee; ");
private static readonly string CREATE_TMP_SP_TYPE_TEST =
"CREATE PROCEDURE #tmp_sp_type_test " +
"(" +
" @param {0}" +
") AS SELECT @param";
private static readonly string DROP_STORED_PROCEDURE =
"DROP PROCEDURE {0}";
}
}
@@ -1,3 +1,11 @@
2008-12-22 Veerapuram Varadhan <[email protected]>
* SqlXmlTest.cs: Available only in 2.0 and above
2008-12-21 Veerapuram Varadhan <[email protected]>
* SqlXmlTest.cs: Tests for SqlXml type. New addition.
2008-06-12 Atsushi Enomoto <[email protected]>
* SqlBooleanTest.cs : oops, was running wrong test harness. Fixed it.
@@ -0,0 +1,198 @@
//
// SqlXmlTest.cs - NUnit Test Cases for System.Data.SqlTypes.SqlXml
//
// Authors:
// Veerapuram Varadhan ([email protected])
//
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System;
using System.Xml;
using System.Data.SqlTypes;
using System.Threading;
using System.Globalization;
using System.Text;
using System.Xml.Serialization;
using System.IO;
namespace MonoTests.System.Data.SqlTypes
{
[TestFixture]
public class SqlXmlTest
{
[SetUp]
public void SetUp ()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
}
// Test constructor
[Test]
public void SqlXml_ctor_StreamTest()
{
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
MemoryStream stream = new MemoryStream (Encoding.Unicode.GetBytes (xmlStr));
SqlXml xmlSql = new SqlXml (stream);
Assert.AreEqual (xmlStr, xmlSql.Value, "#A01");
}
[Test]
public void SqlXml_ctor_XmlReaderTest()
{
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
XmlReader xrdr = new XmlTextReader (new StringReader (xmlStr));
SqlXml xmlSql = new SqlXml (xrdr);
Assert.AreEqual (xmlStr, xmlSql.Value, "#A02");
}
[Test]
public void SqlXml_ctor_ZeroLengthStreamTest()
{
MemoryStream ms = new MemoryStream ();
SqlXml xmlSql = new SqlXml (ms);
Assert.AreEqual (false, xmlSql.IsNull, "#A03");
}
[Test]
public void SqlXml_ctor_ZeroLengthXmlReaderTest()
{
XmlReaderSettings xs = new XmlReaderSettings ();
xs.ConformanceLevel = ConformanceLevel.Fragment;
XmlReader xrdr = XmlReader.Create (new StringReader (String.Empty), xs);
SqlXml xmlSql = new SqlXml (xrdr);
Assert.AreEqual (false, xmlSql.IsNull, "#A04");
}
[Test]
[ExpectedException (typeof (SqlNullValueException))]
public void SqlXml_getValue_ZeroLengthStreamTest()
{
MemoryStream ms = null;
SqlXml xmlSql = new SqlXml (ms);
string str = xmlSql.Value;
}
[Test]
[ExpectedException (typeof (SqlNullValueException))]
public void SqlXml_getValue_ZeroLengthXmlReaderTest()
{
XmlReader xrdr = null;
SqlXml xmlSql = new SqlXml (xrdr);
string str = xmlSql.Value;
}
[Test]
public void SqlXml_fromStream_CreateReaderTest()
{
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
MemoryStream stream = new MemoryStream (Encoding.Unicode.GetBytes (xmlStr));
SqlXml xmlSql = new SqlXml (stream);
XmlReader xrdr = xmlSql.CreateReader ();
xrdr.MoveToContent ();
Assert.AreEqual (xmlStr, xrdr.ReadOuterXml(), "#A05");
}
[Test]
public void SqlXml_fromXmlReader_CreateReaderTest()
{
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
XmlReader rdr = new XmlTextReader (new StringReader (xmlStr));
SqlXml xmlSql = new SqlXml (rdr);
XmlReader xrdr = xmlSql.CreateReader ();
xrdr.MoveToContent ();
Assert.AreEqual (xmlStr, xrdr.ReadOuterXml(), "#A06");
}
[Test]
public void SqlXml_fromZeroLengthStream_CreateReaderTest()
{
MemoryStream stream = new MemoryStream ();
SqlXml xmlSql = new SqlXml (stream);
XmlReader xrdr = xmlSql.CreateReader ();
Assert.AreEqual (false, xrdr.Read(), "#A07");
}
[Test]
public void SqlXml_fromZeroLengthXmlReader_CreateReaderTest_withFragment()
{
XmlReaderSettings xs = new XmlReaderSettings ();
xs.ConformanceLevel = ConformanceLevel.Fragment;
XmlReader rdr = XmlReader.Create (new StringReader (String.Empty), xs);
SqlXml xmlSql = new SqlXml (rdr);
XmlReader xrdr = xmlSql.CreateReader ();
Assert.AreEqual (false, xrdr.Read(), "#A07");
}
[Test]
[ExpectedException (typeof (XmlException))]
public void SqlXml_fromZeroLengthXmlReader_CreateReaderTest()
{
XmlReader rdr = new XmlTextReader (new StringReader (String.Empty));
SqlXml xmlSql = new SqlXml (rdr);
XmlReader xrdr = xmlSql.CreateReader ();
Assert.AreEqual (false, xrdr.Read(), "#A07");
}
[Test]
[ExpectedException (typeof (SqlNullValueException))]
public void SqlXml_fromNullStream_CreateReaderTest()
{
MemoryStream stream = null;
SqlXml xmlSql = new SqlXml (stream);
XmlReader xrdr = xmlSql.CreateReader ();
}
[Test]
[ExpectedException (typeof (SqlNullValueException))]
public void SqlXml_fromNullXmlReader_CreateReaderTest()
{
XmlReader rdr = null;
SqlXml xmlSql = new SqlXml (rdr);
XmlReader xrdr = xmlSql.CreateReader ();
}
}
}
#endif
@@ -1,3 +1,8 @@
2008-11-21 Andreia Gaita <[email protected]>
* Metafile.cs: Save the underlying stream when creating from a
clone under win32 (fixes #438886)
2008-10-12 Sebastien Pouliot <[email protected]>
* ColorPalette.cs, ImageFormat.cs: Remove unneeded field
@@ -51,6 +51,17 @@ namespace System.Drawing.Imaging {
nativeObject = ptr;
}
// Usually called when cloning images that need to have
// not only the handle saved, but also the underlying stream
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
internal Metafile (IntPtr ptr, Stream stream)
{
// under Win32 stream is owned by SD/GDI+ code
if (GDIPlus.RunningOnWindows ())
this.stream = stream;
nativeObject = ptr;
}
public Metafile (Stream stream)
{
if (stream == null)
@@ -64,6 +64,17 @@ namespace System.Drawing
nativeObject = ptr;
}
// Usually called when cloning images that need to have
// not only the handle saved, but also the underlying stream
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
internal Bitmap(IntPtr ptr, Stream stream)
{
// under Win32 stream is owned by SD/GDI+ code
if (GDIPlus.RunningOnWindows ())
this.stream = stream;
nativeObject = ptr;
}
public Bitmap (int width, int height) : this (width, height, PixelFormat.Format32bppArgb)
{
}
@@ -1,3 +1,20 @@
2008-11-24 Geoff Norton <[email protected]>
* gdipFunctions.cs: Ensure that System.Drawing works on the mac as
well as unix.
2008-11-21 Andreia Gaita <[email protected]>
* Image.cs: On win32, when cloning images initialized from
resources, also clone the underlying stream, since it needs to stay
around for the life of the image (gdi doesn't clone the underlying
stream when cloning images, so when the gc disposes the original, it
will also dispose the stream, which invalidates the clone).
* Bitmap.cs: Save the underlying stream when creating bitmaps from a
clone under win32
[fixes #438886]
2008-11-01 Sebastien Pouliot <[email protected]>
* Font.cs: Add comment on .ctor(Font,FontStyle) about the lack of
@@ -811,15 +811,43 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
public object Clone ()
{
if (GDIPlus.RunningOnWindows () && stream != null)
return CloneFromStream ();
IntPtr newimage = IntPtr.Zero;
Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);
GDIPlus.CheckStatus (status);
Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);
GDIPlus.CheckStatus (status);
if (this is Bitmap)
return new Bitmap (newimage);
else
return new Metafile (newimage);
}
// On win32, when cloning images that were originally created from a stream, we need to
// clone both the image and the stream to make sure the gc doesn't kill it
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
object CloneFromStream ()
{
byte[] bytes = new byte [stream.Length];
MemoryStream ms = new MemoryStream (bytes);
int count = (stream.Length < 4096 ? (int) stream.Length : 4096);
byte[] buffer = new byte[count];
stream.Position = 0;
do {
count = stream.Read (buffer, 0, count);
ms.Write (buffer, 0, count);
} while (count == 4096);
IntPtr newimage = IntPtr.Zero;
newimage = InitFromStream (ms);
if (this is Bitmap)
return new Bitmap (newimage, ms);
else
return new Metafile (newimage, ms);
}
}
}
@@ -99,7 +99,7 @@ namespace System.Drawing
static GDIPlus ()
{
int platform = (int) Environment.OSVersion.Platform;
if ((platform == 4) || (platform == 128)) {
if ((platform == 4) || (platform == 6) || (platform == 128)) {
if (Environment.GetEnvironmentVariable ("not_supported_MONO_MWF_USE_NEW_X11_BACKEND") != null || Environment.GetEnvironmentVariable ("MONO_MWF_MAC_FORCE_X11") != null) {
UseX11Drawable = true;
} else {
@@ -15,6 +15,8 @@ using System.Threading;
namespace MonoTests.System.Transactions {
[TestFixture]
// https://bugzilla.novell.com/show_bug.cgi?id=463999
[Category ("NotWorking")]
public class AsyncTest {
[SetUp]
@@ -1,3 +1,7 @@
2009-01-07 Zoltan Varga <[email protected]>
* AsyncTest.cs: Disable these tests, they fail randomly (bug #463999).
2007-08-14 Ankit Jain <[email protected]>
* EnlistTest.cs: Add tests for bug #82423.
@@ -1,3 +1,13 @@
2008-12-05 Marek Habersack <[email protected]>
* JsonSerializer.cs: StringBuilder extension methods aren't used
anymore, changed to calls to static methods in
StringBuilderExtensions.
* StringBuilderExtensions.cs: cannot use extension methods here
because this file is also used in the version 1.0 build which
doesn't reference System.Core
2008-10-22 Marek Habersack <[email protected]>
* JsonDeserializer.cs: object can contain more than one unquoted
@@ -101,7 +101,7 @@ namespace System.Web.Script.Serialization
throw new ArgumentException ("Recursion limit has been exceeded while serializing object of type '{0}'", obj != null ? obj.GetType ().ToString () : "[null]");
if (obj == null || DBNull.Value.Equals (obj)) {
output.AppendCount (maxJsonLength, "null");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
return;
}
@@ -111,7 +111,7 @@ namespace System.Web.Script.Serialization
IDictionary <string, object> result = jsc.Serialize (obj, serializer);
if (result == null) {
output.AppendCount (maxJsonLength, "null");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
return;
}
@@ -291,7 +291,7 @@ namespace System.Web.Script.Serialization
void SerializeArbitraryObject (StringBuilder output, object obj, Type type)
{
output.AppendCount (maxJsonLength, "{");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
bool first = true;
if (typeResolver != null) {
@@ -322,27 +322,27 @@ namespace System.Web.Script.Serialization
first = false;
}
output.AppendCount (maxJsonLength, "}");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
}
void SerializeEnumerable (StringBuilder output, IEnumerable enumerable)
{
output.AppendCount (maxJsonLength, "[");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "[");
bool first = true;
foreach (object value in enumerable) {
if (!first)
output.AppendCount (maxJsonLength, ',');
StringBuilderExtensions.AppendCount (output, maxJsonLength, ',');
SerializeValue (value, output);
if (first)
first = false;
}
output.AppendCount (maxJsonLength, "]");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "]");
}
void SerializeDictionary (StringBuilder output, IDictionary dict)
{
output.AppendCount (maxJsonLength, "{");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
bool first = true;
string key;
@@ -352,12 +352,12 @@ namespace System.Web.Script.Serialization
first = false;
}
output.AppendCount (maxJsonLength, "}");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
}
void SerializeGenericDictionary <TKey, TValue> (StringBuilder output, IDictionary <TKey, TValue> dict)
{
output.AppendCount (maxJsonLength, "{");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
bool first = true;
string key;
@@ -367,7 +367,7 @@ namespace System.Web.Script.Serialization
first = false;
}
output.AppendCount (maxJsonLength, "}");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
}
void WriteDictionaryEntry (StringBuilder output, bool skipComma, string key, object value)
@@ -376,10 +376,10 @@ namespace System.Web.Script.Serialization
throw new InvalidOperationException ("Only dictionaries with keys convertible to string are supported.");
if (!skipComma)
output.AppendCount (maxJsonLength, ',');
StringBuilderExtensions.AppendCount (output, maxJsonLength, ',');
WriteValue (output, key);
output.AppendCount (maxJsonLength, ':');
StringBuilderExtensions.AppendCount (output, maxJsonLength, ':');
SerializeValue (value, output);
}
@@ -387,35 +387,35 @@ namespace System.Web.Script.Serialization
{
switch (typeCode) {
case TypeCode.SByte:
output.AppendCount (maxJsonLength, (sbyte)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (sbyte)value);
return;
case TypeCode.Int16:
output.AppendCount (maxJsonLength, (short)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (short)value);
return;
case TypeCode.UInt16:
output.AppendCount (maxJsonLength, (ushort)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (ushort)value);
return;
case TypeCode.Int32:
output.AppendCount (maxJsonLength, (int)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (int)value);
return;
case TypeCode.Byte:
output.AppendCount (maxJsonLength, (byte)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (byte)value);
return;
case TypeCode.UInt32:
output.AppendCount (maxJsonLength, (uint)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (uint)value);
return;
case TypeCode.Int64:
output.AppendCount (maxJsonLength, (long)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (long)value);
return;
case TypeCode.UInt64:
output.AppendCount (maxJsonLength, (ulong)value);
StringBuilderExtensions.AppendCount (output, maxJsonLength, (ulong)value);
return;
default:
@@ -425,12 +425,12 @@ namespace System.Web.Script.Serialization
void WriteValue (StringBuilder output, float value)
{
output.AppendCount (maxJsonLength, value.ToString ("r"));
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
}
void WriteValue (StringBuilder output, double value)
{
output.AppendCount (maxJsonLength, value.ToString ("r"));
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
}
void WriteValue (StringBuilder output, Guid value)
@@ -451,23 +451,23 @@ namespace System.Web.Script.Serialization
value = MinimumJavaScriptDate;
long ticks = (value.Ticks - InitialJavaScriptDateTicks) / (long)10000;
output.AppendCount (maxJsonLength, "\"\\/Date(" + ticks + ")\\/\"");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"\\/Date(" + ticks + ")\\/\"");
}
void WriteValue (StringBuilder output, IConvertible value)
{
output.AppendCount (maxJsonLength, value.ToString (CultureInfo.InvariantCulture));
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString (CultureInfo.InvariantCulture));
}
void WriteValue (StringBuilder output, bool value)
{
output.AppendCount (maxJsonLength, value ? "true" : "false");
StringBuilderExtensions.AppendCount (output, maxJsonLength, value ? "true" : "false");
}
void WriteValue (StringBuilder output, char value)
{
if (value == '\0') {
output.AppendCount (maxJsonLength, "null");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
return;
}
@@ -477,11 +477,11 @@ namespace System.Web.Script.Serialization
void WriteValue (StringBuilder output, string value)
{
if (String.IsNullOrEmpty (value)) {
output.AppendCount (maxJsonLength, "\"\"");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"\"");
return;
}
output.AppendCount (maxJsonLength, "\"");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"");
char c;
for (int i = 0; i < value.Length; i++) {
@@ -489,50 +489,50 @@ namespace System.Web.Script.Serialization
switch (c) {
case '\t':
output.AppendCount (maxJsonLength, @"\t");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\t");
break;
case '\n':
output.AppendCount (maxJsonLength, @"\n");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\n");
break;
case '\r':
output.AppendCount (maxJsonLength, @"\r");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\r");
break;
case '\f':
output.AppendCount (maxJsonLength, @"\f");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\f");
break;
case '\b':
output.AppendCount (maxJsonLength, @"\b");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\b");
break;
case '<':
output.AppendCount (maxJsonLength, @"\u003c");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u003c");
break;
case '>':
output.AppendCount (maxJsonLength, @"\u003e");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u003e");
break;
case '"':
output.AppendCount (maxJsonLength, "\\\"");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\\\"");
break;
case '\'':
output.AppendCount (maxJsonLength, @"\u0027");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u0027");
break;
case '\\':
output.AppendCount (maxJsonLength, @"\\");
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\\");
break;
default:
if (c > '\u001f')
output.AppendCount (maxJsonLength, c);
StringBuilderExtensions.AppendCount (output, maxJsonLength, c);
else {
output.Append("\\u00");
int intVal = (int) c;
output.AppendCount (maxJsonLength, (char) ('0' + (intVal >> 4)));
StringBuilderExtensions.AppendCount (output, maxJsonLength, (char) ('0' + (intVal >> 4)));
intVal &= 0xf;
output.AppendCount (maxJsonLength, (char) (intVal < 10 ? '0' + intVal : 'a' + (intVal - 10)));
StringBuilderExtensions.AppendCount (output, maxJsonLength, (char) (intVal < 10 ? '0' + intVal : 'a' + (intVal - 10)));
}
break;
}
}
output.AppendCount (maxJsonLength, "\"");
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"");
}
}
}
@@ -39,133 +39,133 @@ namespace System.Web.Script.Serialization
throw new InvalidOperationException ("Maximum length exceeded.");
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char[] value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char[] value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, string value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, string value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, bool value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, bool value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, byte value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, byte value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, decimal value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, decimal value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, double value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, double value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, short value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, short value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, int value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, int value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, long value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, long value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, object value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, object value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, sbyte value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, sbyte value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, float value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, float value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, ushort value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, ushort value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, uint value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, uint value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, ulong value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, ulong value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char value)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char value)
{
StringBuilder ret = sb.Append (value);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char value, int repeatCount)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char value, int repeatCount)
{
StringBuilder ret = sb.Append (value, repeatCount);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char[] value, int startIndex, int charCount )
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char[] value, int startIndex, int charCount )
{
StringBuilder ret = sb.Append (value, startIndex, charCount);
CheckCount (sb, maxCount);
return ret;
}
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, string value, int startIndex, int count)
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, string value, int startIndex, int count)
{
StringBuilder ret = sb.Append (value, startIndex, count);
CheckCount (sb, maxCount);
@@ -1,3 +1,7 @@
2008-12-05 Marek Habersack <[email protected]>
* Makefile (LIB_MCS_FLAGS): do not reference System.Core
2008-09-30 Marek Habersack <[email protected]>
* System.Web.Extensions_1.0.dll.sources: added
@@ -34,7 +34,6 @@ LIB_MCS_FLAGS = \
-define:SYSTEM_WEB_EXTENSIONS \
-r:$(corlib) \
-r:System.dll \
-r:System.Core.dll \
-r:System.Drawing.dll \
-r:System.Data.dll \
-r:System.Xml.dll \
+49
View File
@@ -1,3 +1,52 @@
2008-12-11 Dean Brettle <[email protected]>
* System.Web.dll.sources: deleted
System.Web.Configuration_2.0/CapabilitiesChecksum.cs
* Makefile (RESOURCE_FILES_2): deleted
System.Web.Configuration_2.0/RandomRoboBotKeywords.txt
2008-12-03 Marek Habersack <[email protected]>
* System.Web_test.dll.sources: added System.Web.UI/DataBinderTest.cs
2008-12-02 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config.1.1
2008-12-01 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master
(TEST_MCS_FLAGS): added reference to System.Web.Extensions
2008-11-25 Marek Habersack <[email protected]>
* System.Web.dll.sources: added
System.Web.Compilation/AspComponent.cs
2008-11-21 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/InvalidPropertyBind1.aspx
Test/mainsoft/NunitWebResources/InvalidPropertyBind2.aspx
Test/mainsoft/NunitWebResources/InvalidPropertyBind3.aspx
Test/mainsoft/NunitWebResources/InvalidPropertyBind4.aspx
Test/mainsoft/NunitWebResources/ValidPropertyBind1.aspx
Test/mainsoft/NunitWebResources/ValidPropertyBind2.aspx
Test/mainsoft/NunitWebResources/ValidPropertyBind3.aspx
Test/mainsoft/NunitWebResources/ValidPropertyBind4.aspx
Test/mainsoft/NunitWebResources/ReadWritePropertyControl.ascx
* Test/tools/web.config: disabled batch compilation and enabled
debugging.
2008-11-15 Marek Habersack <[email protected]>
* System.Web.dll.sources: added System.Web.UI/INonBindingContainer.cs
2008-10-17 Jonathan Pryor <[email protected]>
* Test/Makefile: Add doc-update target support.
+17 -2
View File
@@ -64,7 +64,6 @@ RESOURCE_FILES_2 = \
resources/transparent.gif \
resources/webform.js \
resources/WebUIValidation_2.0.js \
System.Web.Configuration_2.0/RandomRoboBotKeywords.txt \
System.Web.UI.WebControls/GridView.js \
System.Web.UI.WebControls/DetailsView.js \
System.Web.UI.WebControls/TreeView.js \
@@ -80,6 +79,7 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx.cs \
Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMaster.aspx \
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config \
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config.1.1 \
Test/mainsoft/NunitWebResources/menuclass.aspx \
Test/mainsoft/NunitWebResources/FormView.aspx \
Test/mainsoft/NunitWebResources/PostBackMenuTest.aspx \
@@ -143,8 +143,20 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWebResources/RedirectOnError.aspx \
Test/mainsoft/NunitWebResources/TestCapability.browser \
Test/mainsoft/NunitWebResources/PageWithAdapter.aspx \
Test/mainsoft/NunitWebResources/InvalidPropertyBind1.aspx \
Test/mainsoft/NunitWebResources/InvalidPropertyBind2.aspx \
Test/mainsoft/NunitWebResources/InvalidPropertyBind3.aspx \
Test/mainsoft/NunitWebResources/InvalidPropertyBind4.aspx \
Test/mainsoft/NunitWebResources/ValidPropertyBind1.aspx \
Test/mainsoft/NunitWebResources/ValidPropertyBind2.aspx \
Test/mainsoft/NunitWebResources/ValidPropertyBind3.aspx \
Test/mainsoft/NunitWebResources/ValidPropertyBind4.aspx \
Test/mainsoft/NunitWebResources/ValidPropertyBind5.aspx \
Test/mainsoft/NunitWebResources/ReadWritePropertyControl.ascx \
Test/mainsoft/MainsoftWebTest/nunitweb_config.xml \
Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx
Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx \
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx \
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master
RESX_DIST = resources/TranslationResources.resx
ifeq (net_2_0, $(PROFILE))
@@ -183,6 +195,9 @@ endif
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%)
ifeq (net_2_0, $(PROFILE))
TEST_MCS_FLAGS += -r:System.Web.Extensions.dll
endif
EXTRA_DISTFILES = $(RESOURCE_FILES_2) $(RESOURCE_FILES_1) $(TEST_RESOURCE_FILES) UplevelHelperDefinitions.xml $(RESX_DIST) \
SQLiteProviders_DatabaseSchema.sql
@@ -107,7 +107,9 @@ namespace System.Web.Caching
if (it.SlidingExpiration != NoSlidingExpiration) {
it.AbsoluteExpiration = DateTime.Now + it.SlidingExpiration;
it.Timer.Change ((int)it.SlidingExpiration.TotalMilliseconds, Timeout.Infinite);
// Cast to long is ok since we know that sliding expiration
// is less than 365 days (31536000000ms)
it.Timer.Change ((long)it.SlidingExpiration.TotalMilliseconds, Timeout.Infinite);
} else if (DateTime.Now >= it.AbsoluteExpiration) {
Remove (key, CacheItemRemovedReason.Expired, false);
return null;
@@ -1,3 +1,11 @@
2009-01-09 Marek Habersack <[email protected]>
* Cache.cs: System.Threading.Timer.Change takes a long, not an
int. The maximum value of sliding expiration is 365 days
(31536000000ms) which fits within the value range of long. The
previous cast to int might yield negative values in certain
situations which was the reason for bug #464221. Fixes bug #464221
2008-10-21 Marek Habersack <[email protected]>
* OutputCacheModule.cs: seal the class.
@@ -0,0 +1,49 @@
//
// System.Web.Compilation.AspComponentFoundry
//
// Authors:
// Marek Habersack ([email protected])
//
// (C) 2008 Novell, Inc (http://novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Compilation
{
internal sealed class AspComponent
{
public readonly Type Type;
public readonly string Prefix;
public readonly string Source;
public readonly bool FromConfig;
public readonly string Namespace;
public AspComponent (Type type, string ns, string prefix, string source, bool fromConfig)
{
Type = type;
Namespace = ns;
Prefix = prefix;
Source = source;
FromConfig = fromConfig;
}
}
}
@@ -44,7 +44,30 @@ namespace System.Web.Compilation
internal class AspComponentFoundry
{
Hashtable foundries;
#if NET_2_0
Dictionary <string, AspComponent> components;
#else
Hashtable components;
#endif
#if NET_2_0
Dictionary <string, AspComponent> Components {
get {
if (components == null)
components = new Dictionary <string, AspComponent> (StringComparer.OrdinalIgnoreCase);
return components;
}
}
#else
Hashtable Components {
get {
if (components == null)
components = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant);
return components;
}
}
#endif
public AspComponentFoundry ()
{
#if NET_2_0
@@ -63,42 +86,55 @@ namespace System.Web.Compilation
#endif
}
public Type GetComponentType (string foundryName, string tag)
public AspComponent GetComponent (string tagName)
{
string source;
bool fromConfig;
return GetComponentType (foundryName, tag, out source, out fromConfig);
}
public Type GetComponentType (string foundryName, string tag, out string source, out bool fromConfig)
{
source = null;
fromConfig = false;
object o = foundries [foundryName];
if (tagName == null || tagName.Length == 0)
return null;
if (components != null) {
#if NET_2_0
AspComponent ret;
if (components.TryGetValue (tagName, out ret))
return ret;
#else
if (components.Contains (tagName))
return components [tagName] as AspComponent;
#endif
}
string foundryName, tag;
int colon = tagName.IndexOf (':');
if (colon > -1) {
if (colon == 0)
throw new Exception ("Empty TagPrefix is not valid.");
if (colon + 1 == tagName.Length)
return null;
foundryName = tagName.Substring (0, colon);
tag = tagName.Substring (colon + 1);
} else {
foundryName = String.Empty;
tag = tagName;
}
object o = foundries [foundryName];
if (o == null)
return null;
Foundry foundry = o as Foundry;
if (foundry != null) {
fromConfig = foundry.FromConfig;
return foundry.GetType (tag, out source);
}
if (foundry != null)
return CreateComponent (foundry, tagName, foundryName, tag);
ArrayList af = o as ArrayList;
if (af == null)
return null;
Type t = null;
AspComponent component = null;
Exception e = null;
foreach (Foundry f in af) {
try {
t = f.GetType (tag, out source);
if (t != null) {
fromConfig = f.FromConfig;
return t;
}
component = CreateComponent (f, tagName, foundryName, tag);
if (component != null)
return component;
} catch (Exception ex) {
e = ex;
}
@@ -110,6 +146,25 @@ namespace System.Web.Compilation
return null;
}
AspComponent CreateComponent (Foundry foundry, string tagName, string prefix, string tag)
{
string source, ns;
Type type;
type = foundry.GetType (tag, out source, out ns);
if (type == null)
return null;
AspComponent ret = new AspComponent (type, ns, prefix, source, foundry.FromConfig);
#if NET_2_0
Dictionary <string, AspComponent> components = Components;
#else
Hashtable components = Components;
#endif
components.Add (tagName, ret);
return ret;
}
public void RegisterFoundry (string foundryName, Assembly assembly, string nameSpace)
{
RegisterFoundry (foundryName, assembly, nameSpace, false);
@@ -261,7 +316,7 @@ namespace System.Web.Compilation
set { _fromConfig = value; }
}
public abstract Type GetType (string componentName, out string source);
public abstract Type GetType (string componentName, out string source, out string ns);
}
@@ -290,9 +345,10 @@ namespace System.Web.Compilation
this.type = type;
}
public override Type GetType (string componentName, out string source)
public override Type GetType (string componentName, out string source, out string ns)
{
source = null;
ns = null;
if (0 != String.Compare (componentName, tagName, true))
return null;
@@ -370,9 +426,11 @@ namespace System.Web.Compilation
}
#endif
public override Type GetType (string componentName, out string source)
public override Type GetType (string componentName, out string source, out string ns)
{
source = null;
ns = nameSpace;
#if NET_2_0
if (assembly == null && assemblyName != null)
assembly = GetAssemblyByName (assemblyName, true);
@@ -469,23 +527,23 @@ namespace System.Web.Compilation
tagnames.Add (tagName, foundry);
}
public override Type GetType (string componentName, out string source)
public override Type GetType (string componentName, out string source, out string ns)
{
source = null;
ns = null;
Type type = null;
Foundry foundry = tagnames [componentName] as Foundry;
if (foundry != null)
return foundry.GetType (componentName, out source);
return foundry.GetType (componentName, out source, out ns);
if (assemblyFoundry != null) {
try {
type = assemblyFoundry.GetType (componentName, out source);
type = assemblyFoundry.GetType (componentName, out source, out ns);
return type;
} catch { }
}
string msg = String.Format ("Type {0} not registered for prefix {1}",
componentName, tagPrefix);
string msg = String.Format ("Type {0} not registered for prefix {1}", componentName, tagPrefix);
throw new ApplicationException (msg);
}
}
Loaded 100 of 302 files, more files were not shown because too many files have changed in this diff. Show more