[Mono-dev] patch to add some missing System.Diagnostics trace stuff
Jonathan Pryor
jonpryor at vt.edu
Wed Jan 17 06:21:54 EST 2007
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 <atsushi at ximian.com>
> +
> + * 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
More information about the Mono-devel-list
mailing list