Re: [Mono-dev] Please approve commit change toSystem.Web.Hosting/ApplicationHost.cs
Hi Gonzalo and all, I looked further into the need for using the URI object to validate the physical path passed in to the ApplicationHost.CreateApplicationHost method. I found out that there were tests in ApplicationHostTests that failed, and were marked with NotWorking, because of the Uri.Parse. So this patch actually improves the situation. I had to tweak the exceptions thrown by this method to be compatible with MS. Here is a patch (already committed) that includes these tweaks and the tests not marked as NotWorking. If you have any other comments, let me know. Thanks, --- Adar Wesley Mainsoft -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gonzalo Paniagua Javier Sent: Friday, January 12, 2007 8:01 AM To: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Please approve commit change toSystem.Web.Hosting/ApplicationHost.cs On 1/9/07, Adar Wesley [EMAIL PROTECTED] wrote: Hi All, I would like to commit a change to ApplicationHost. The suggested diff follows: I've seen that this patch is already in, but it's wrong. Creating the Uri object was done so that we throw in the same cases that MS does. At least I would add the new Uri (blah) after getting the full path. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ApplicationHost.patch Description: ApplicationHost.patch ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
Hello Andy, Woops, if the patch is possibly useable I should attach it! This time. Your patch works, I have applied it. Many thanks. However I see now that the string created by the Message property isn't good, I hadn't inspected it previously... I can produce another patch, but I'm still working my way towards getting the build working on Windows so I can't test it in situ. :-( (... checking for -Wdeclaration-after-statement option to gcc... yes checking for pkg-config... /cygdrive/d/Projects/SrcMono/build_deps/bin/pkg-config ./configure: line 24699: syntax error near unexpected token `BASE_DEPENDENCIES,' ./configure: line 24699: ` PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 = $GLIB_REQUIRED_VERSION)' ) It's not my style to produce stuff that's not been double-thoroughly tested. Against my better principles I attach it in case it /is/ good enough now. Feel free to reject and discard. Andy using System; using NUnit.Framework; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using System.Text; // // The MSFT v2.0.50727 implementation was analysed and the following unit-tests show the results. // // Where: // y = A non-empty value passed (String/Exception respectively). // N = null passed. // E = String.Empty passed. // // CAD = Cannot access a disposed object. // ON = Object name: 'objectName'. // ODT = Exception of type 'System.ObjectDisposedException' was thrown. // // message // | objectName // | | exception // | | | Resultant 'Message' text // | | | | //-- // #ctor(String) // - y - CAD+ON // - N - CAD // - E - CAD //-- // #ctor(String,String) // y y - M+ON // N y - ODT+ON // E y - +ON // - // y N - M // N N - ODT // E N - // - // y E - M // N E - ODT // E E - //-- // #ctor(String,Exception) // - y y M // - N y ODT // - E y // - // - y - M // - N - ODT // - E - //-- // // They also show that the ObjectName property returns an empty string if it was set to null. // // By-hand analysis of the Binary Serialization output shows the same is true there. // namespace MonoTests.System { [TestFixture] public class ObjectDisposedExceptionMessageAndObjectNamePropertyTest { const string ExOfTypeWasThrown = Exception of type 'System.ObjectDisposedException' was thrown.; //-- const string TestObjectName = oobbjjName; const string TestMessage = Mmssgg; const string TestExceptionMessage = InExMsg; //-- private void DoTestMessage (string expected, Exception ex) { String message = ex.Message; Assert.AreEqual (expected, message); } // This exception has the following constructors: //public ObjectDisposedException (string objectName); //protected ObjectDisposedException (SerializationInfo info, StreamingContext context); //public ObjectDisposedException (string message, Exception innerException); //public ObjectDisposedException (string objectName, string message); //--- //Testing: public ObjectDisposedException (string objectName); //--- [Test] public void String_NonEmpty () { String objectName = TestObjectName; Exception ex = new ObjectDisposedException (objectName); DoTestMessage (Cannot access a disposed object.\r\nObject name: ' + TestObjectName + '., ex); //HACK } [Test] public void String_Null () { String objectName = null; Exception ex = new ObjectDisposedException
Re: [Mono-dev] patch to add some missing System.Diagnostics trace stuff
On Wed, 2007-01-17 at 14:23 +0900, Atsushi Eno wrote: Index: Test/System.Diagnostics/ChangeLog === --- Test/System.Diagnostics/ChangeLog (revision 71034) +++ Test/System.Diagnostics/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2007-01-17 Atsushi Enomoto [EMAIL PROTECTED] + + * TRaceSourceTest.cs, SourceSwitchTest.cs : new tests. You mis-spelled TraceSourceTest.cs. :-) Index: Test/System.Diagnostics/SwitchesTest.cs === --- Test/System.Diagnostics/SwitchesTest.cs (revision 71034) +++ Test/System.Diagnostics/SwitchesTest.cs (working copy) @@ -25,7 +25,7 @@ private StringBuilder ops = new StringBuilder (); private const string expected = .ctor\n + - get_Value\n + + get_ValueFoo\n + Please use TestValue instead of ValueFoo. OnSwitchSettingChanged\n + GetSetting\n; @@ -35,9 +35,9 @@ ops.Append (.ctor\n); } - public string Value { + public string ValueFoo { get { - ops.Append (get_Value\n); + ops.Append (get_ValueFoo\n); // ensure that the .config file is read in int n = base.SwitchSetting; // remove warning about unused variable @@ -136,7 +136,7 @@ #endif public void NewSwitch () { - AssertEquals (#NS:Value, 42, tns.Value); + AssertEquals (#NS:ValueFoo, 42, tns.ValueFoo); Assert (#NS:Validate, tns.Validate()); } } Index: System.Diagnostics/Switch.cs === --- System.Diagnostics/Switch.cs (revision 71034) +++ System.Diagnostics/Switch.cs (working copy) @@ -33,6 +33,7 @@ // using System.Collections; +using System.Collections.Specialized; namespace System.Diagnostics { @@ -63,6 +64,16 @@ this.description = description; } + private string value; + +#if NET_2_0 + protected Switch(string displayName, string description, string defaultSwitchValue) + : this (displayName, description) + { + this.value = defaultSwitchValue; + } +#endif + public string Description { get {return description;} } @@ -89,6 +100,31 @@ } } +#if NET_2_0 + StringDictionary attributes = new StringDictionary (); + + public StringDictionary Attributes { + get { return attributes; } + } + + protected string Value { + get { return value; } + set { + this.value = value; + OnValueChanged (); + } + } + + protected internal virtual string [] GetSupportedAttributes () + { + return null; Shouldn't this return `new string[0]'? At least that would be more consistent with the .NET Framework Design Guidelines. + } + + protected virtual void OnValueChanged () + { + } +#endif + private void GetConfigFileSetting () { try { Otherwise, the changes look fine. Please commit once you've reviewed my comments. - Jon ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Please approve commit change toSystem.Web.Hosting/ApplicationHost.cs
Hello Adar, I looked further into the need for using the URI object to validate the physical path passed in to the ApplicationHost.CreateApplicationHost method. I found out that there were tests in ApplicationHostTests that failed, and were marked with NotWorking, because of the Uri.Parse. So this patch actually improves the situation. I had to tweak the exceptions thrown by this method to be compatible with MS. Here is a patch (already committed) that includes these tweaks and the tests not marked as NotWorking. Ah, great catch. Please commit it. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
Do you have pgk-config installed in cygwin? Try typing 'pkg-config --version' at the console and see what you get. - Jonathan On 1/17/07, Andy Hume [EMAIL PROTECTED] wrote: Hello Andy, Woops, if the patch is possibly useable I should attach it! This time. Your patch works, I have applied it. Many thanks. However I see now that the string created by the Message property isn't good, I hadn't inspected it previously... I can produce another patch, but I'm still working my way towards getting the build working on Windows so I can't test it in situ. :-( (... checking for -Wdeclaration-after-statement option to gcc... yes checking for pkg-config... /cygdrive/d/Projects/SrcMono/build_deps/bin/pkg-config ./configure: line 24699: syntax error near unexpected token `BASE_DEPENDENCIES,' ./configure: line 24699: ` PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 = $GLIB_REQUIRED_VERSION)' ) It's not my style to produce stuff that's not been double-thoroughly tested. Against my better principles I attach it in case it /is/ good enough now. Feel free to reject and discard. Andy ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
On 2007-01-17 Jon Chambers mailto:[EMAIL PROTECTED] wrote: Do you have pgk-config installed in cygwin? Try typing 'pkg-config --version' at the console and see what you get. Thanks Jonathon. Gert Driesen had pointed to me to a thread online (http://archives.devshed.com/forums/development-94/compiling-mono-on-cyg win-1508053.html) that recommended setting ACLOCAL_FLAGS pointing into the build_dep tree. 'make' is running as I write this. :-)) Fingers crossed... Andy On 1/17/07, Andy Hume [EMAIL PROTECTED] wrote: Hello Andy, Woops, if the patch is possibly useable I should attach it! This time. Your patch works, I have applied it. Many thanks. However I see now that the string created by the Message property isn't good, I hadn't inspected it previously... I can produce another patch, but I'm still working my way towards getting the build working on Windows so I can't test it in situ. :-( (... checking for -Wdeclaration-after-statement option to gcc... yes checking for pkg-config... /cygdrive/d/Projects/SrcMono/build_deps/bin/pkg-config ./configure: line 24699: syntax error near unexpected token `BASE_DEPENDENCIES,' ./configure: line 24699: ` PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 = $GLIB_REQUIRED_VERSION)' ) It's not my style to produce stuff that's not been double-thoroughly tested. Against my better principles I attach it in case it /is/ good enough now. Feel free to reject and discard. Andy ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Win tickets to the 2006 FIFA World Cup Germany with Yahoo! Messenger. http://advision.webevents.yahoo.com/fifaworldcup_uk/ ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Code Review (again)
On Tue, 16 Jan 2007 10:27:40 +, Damien Churchill [EMAIL PROTECTED] scribbled: Hey Damien, I've just committed your code to mono, thanks :) marek signature.asc Description: PGP signature ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] multiple target patterns. on cygwin Was: Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
Jon [...] gcc -mno-cygwin -g -I../.. -I../../libgc/include -Id:/Projects/SrcMono/build_dep s/include/glib-2.0 -Id:/Projects/SrcMono/build_deps/lib/glib-2.0/include -Id:/Pr ojects/SrcMono/build_deps/include/glib-2.0 -Id:/Projects/SrcMono/build_deps/lib/ glib-2.0/include -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -g -W all -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wm issing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align - Wwrite-strings -mno-tls-direct-seg-refs -o genmdesc.exe genmdesc-genmdesc.o genm desc-helpers.o ../../mono/metadata/.libs/opcodes.o -L/cygdrive/d/Projects/SrcMo no/build_deps/lib ../../mono/utils/.libs/libmonoutils.a -Ld:/Projects/SrcMono/bu ild_deps/lib -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lws2_32 -lps api -lole32 -loleaut32 ./genmdesc ./cpu-x86.md cpu-x86.h x86_desc make all-am make[4]: Entering directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' .deps/genmdesc-genmdesc.Po:1: *** multiple target patterns. Stop. make[4]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' make[3]: *** [all] Error 2 make[3]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono' make: *** [all] Error 2 I see from the lists that you experienced this problem yourself (http://lists.ximian.com/pipermail/mono-devel-list/2006-July/019583.html , http://lists.ximian.com/pipermail/mono-devel-list/2006-August/019608.htm l). Is the answer (http://lists.ximian.com/pipermail/mono-devel-list/2006-September/020642 .html) still to use an older version of make? I've got 1.81-1. I don't see how to select any other version in cygwin's setup.exe; I'll try and see if adding another source helps -- I only have www.mirror.ac.uk (and prc-tools.sourceforge.net)... Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Hume Sent: 17 January 2007 14:19 To: 'Jon Chambers' Cc: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Patch to add missing v2 System.Exceptionconstructors,and HResult consistency On 2007-01-17 Jon Chambers mailto:[EMAIL PROTECTED] wrote: Do you have pgk-config installed in cygwin? Try typing 'pkg-config --version' at the console and see what you get. Thanks Jonathon. Gert Driesen had pointed to me to a thread online (http://archives.devshed.com/forums/development-94/compiling-m ono-on-cyg win-1508053.html) that recommended setting ACLOCAL_FLAGS pointing into the build_dep tree. 'make' is running as I write this. :-)) Fingers crossed... Andy On 1/17/07, Andy Hume [EMAIL PROTECTED] wrote: Hello Andy, Woops, if the patch is possibly useable I should attach it! This time. Your patch works, I have applied it. Many thanks. However I see now that the string created by the Message property isn't good, I hadn't inspected it previously... I can produce another patch, but I'm still working my way towards getting the build working on Windows so I can't test it in situ. :-( (... checking for -Wdeclaration-after-statement option to gcc... yes checking for pkg-config... /cygdrive/d/Projects/SrcMono/build_deps/bin/pkg-config ./configure: line 24699: syntax error near unexpected token `BASE_DEPENDENCIES,' ./configure: line 24699: ` PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 = $GLIB_REQUIRED_VERSION)' ) It's not my style to produce stuff that's not been double-thoroughly tested. Against my better principles I attach it in case it /is/ good enough now. Feel free to reject and discard. Andy ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Win tickets to the 2006 FIFA World Cup Germany with Yahoo! Messenger. http://advision.webevents.yahoo.com/fifaworldcup_uk/ ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com
Re: [Mono-dev] multiple target patterns. on cygwin Was: Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
Andy Hume wrote: [...] Is the answer (http://lists.ximian.com/pipermail/mono-devel-list/2006-September/020642 .html) still to use an older version of make? Yes. I've got 1.81-1. I don't see how to select any other version in cygwin's setup.exe; I'll try and see if adding another source helps -- I only have www.mirror.ac.uk (and prc-tools.sourceforge.net)... http://www.go-mono.com/archive/helper/make-3.80-1.tar.bz2 The link was taken from this fine cygwin tutorial: http://shana.iidbbs.com/en/mono_cygwin_tutorial.html which in turn is linked from Mono's Wiki: http://mono-project.com/Compiling_Mono#Windows_Compilation Robert ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] multiple target patterns. on cygwin Was: Patch to add missing v2 System.Exceptionconstructors, and HResult consistency
-Original Message- From: [EMAIL PROTECTED] [mailto:mono-devel-list- [EMAIL PROTECTED] On Behalf Of Andy Hume Sent: woensdag 17 januari 2007 18:25 To: 'Jon Chambers' Cc: mono-devel-list@lists.ximian.com Subject: [Mono-dev] multiple target patterns. on cygwin Was: Patch to add missing v2 System.Exceptionconstructors, and HResult consistency Jon [...] gcc -mno-cygwin -g -I../.. -I../../libgc/include - Id:/Projects/SrcMono/build_dep s/include/glib-2.0 - Id:/Projects/SrcMono/build_deps/lib/glib-2.0/include -Id:/Pr ojects/SrcMono/build_deps/include/glib-2.0 -Id:/Projects/SrcMono/build_deps/lib/ glib-2.0/include -g -O2 -fno-strict-aliasing -Wdeclaration-after- statement -g -W all -Wunused -Wmissing-prototypes -Wmissing- declarations -Wstrict-prototypes -Wm issing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align - Wwrite-strings -mno-tls- direct-seg-refs -o genmdesc.exe genmdesc-genmdesc.o genm desc-helpers.o ../../mono/metadata/.libs/opcodes.o -L/cygdrive/d/Projects/SrcMo no/build_deps/lib ../../mono/utils/.libs/libmonoutils.a -Ld:/Projects/SrcMono/bu ild_deps/lib -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lws2_32 -lps api -lole32 -loleaut32 ./genmdesc ./cpu-x86.md cpu-x86.h x86_desc make all-am make[4]: Entering directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' .deps/genmdesc-genmdesc.Po:1: *** multiple target patterns. Stop. make[4]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' make[3]: *** [all] Error 2 make[3]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono/mini' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono/mono' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/cygdrive/d/Projects/SrcMono/mono' make: *** [all] Error 2 I see from the lists that you experienced this problem yourself (http://lists.ximian.com/pipermail/mono-devel-list/2006- July/019583.html , http://lists.ximian.com/pipermail/mono-devel-list/2006- August/019608.htm l). Is the answer (http://lists.ximian.com/pipermail/mono-devel-list/2006- September/020642 .html) still to use an older version of make? I've got 1.81-1. I don't see how to select any other version in cygwin's setup.exe; I'll try and see if adding another source helps -- I only have www.mirror.ac.uk (and prc-tools.sourceforge.net)... You can find it here: http://cygwin.paracoda.com/release/make/ Gert ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Marshalling wchar_t
Hi, I am trying to call a c++ shared library and the specifics of the call are as follows: On the C++ end, I have a function like so: authenticate(WINID window, struct ModuleAndType *modules[], int size, const wchar_t* inToken, wchar_t** outToken) On the C# end, I have the following: [DllImport(AuthController)] private static extern uint authenticate( int hwnd, [MarshalAs(UnmanagedType.LPArray)] ref ModuleAndType[] modules, int size, [MarshalAs(UnmanagedType.LPWStr)] string inToken, [MarshalAs(UnmanagedType.LPWStr)] ref string outToken); This works fine under windows, but I am getting junk characters when running the same code In Suse Linux 10.0. I have Mono JIT 1.1.13.8 intalled. After initial searching on the Internet, I read that it was due to the number of bytes used by wchar_t in Windows and Linux. Mono seems to be marshalling it like windows wchar_t even on Linux and thus the junk characters. Is there a way I can get wchar_t to work through marshalling? Thanks in advance for your help, Cheers, Rajesh ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] patch to add some missing System.Diagnostics trace stuff
Hi, Thanks for the comments :) +* TRaceSourceTest.cs, SourceSwitchTest.cs : new tests. You mis-spelled TraceSourceTest.cs. :-) oops ;-) +protected internal virtual string [] GetSupportedAttributes () +{ +return null; Shouldn't this return `new string[0]'? At least that would be more consistent with the .NET Framework Design Guidelines. Actually I just implemented it along with MSDN documentation. Now I have added another test case for it in SwitchesTest.cs. I will checkin soon. Atsushi Eno ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list