2008-12-09 Christian Hergert <christian.hergert@gmail.com>
authorChristian Hergert <chris@dronelabs.com>
Tue, 9 Dec 2008 23:32:18 +0000 (23:32 -0000)
committerChristian Hergert <chris@dronelabs.com>
Tue, 9 Dec 2008 23:32:18 +0000 (23:32 -0000)
* System/Test/System.Diagnostics/CounterCreationDataTest.cs: Test to verify CounterHelp defaults to String.Empty.
* System/System.Diagnostics/CounterCreationData.cs: Default CounterHelp to String.Empty.

svn path=/trunk/mcs/; revision=121172

mcs/class/System/ChangeLog
mcs/class/System/System.Diagnostics/ChangeLog
mcs/class/System/System.Diagnostics/CounterCreationData.cs
mcs/class/System/System_test.dll.sources
mcs/class/System/Test/ChangeLog
mcs/class/System/Test/System.Diagnostics/CounterCreationDataTest.cs [new file with mode: 0644]

index 8883b5a683319e3bbe5cab40beb6509a519fcb4b..b5cb274c198dbc98e86e9f9cbf92ae0fcef46904 100644 (file)
@@ -1,3 +1,7 @@
+2008-12-09  Christian Hergert <christian.hergert@gmail.com>
+
+       * System_test.dll.sources: Addded CounterCreationDataTest.cs
+
 2008-12-06  Ivan N. Zlatev  <contact@i-nz.net>
 
        * System_test.dll.sources: Addded NullableConverterTest.cs
index f3d1d3038536707a3fba7d001581e402ca06a963..0c9993ed9535a4eabc81ba922bb4bb85eb7f61a7 100644 (file)
@@ -1,4 +1,8 @@
 
+2008-12-09 Christian Hergert <christian.hergert@gmail.com>
+
+       * CounterCreationData.cs: CounterHelp defaults to String.Empty.
+
 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * PerformanceCounter.cs: add 2 workarounds for known problems. I will
index a2c09c86a9d41e40568296f4883ef83376ad9b8c..2523e07fb26abb4b705c68e49d69fd3899c3ee26 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Diagnostics {
        {
 
                // keep the same order of fields: this is used in metadata/mono-perfcounters.c
-               private string help;
+               private string help = String.Empty;
                private string name;
                private PerformanceCounterType type;
 
index 58db9189d747a368d757a705eddcb41acb7d1996..3d3126441aebbabed02de945c16d6aca5f522211 100644 (file)
@@ -184,6 +184,7 @@ System.Diagnostics/PerformanceCounterPermissionAttributeTest.cs
 System.Diagnostics/PerformanceCounterPermissionTest.cs
 System.Diagnostics/ProcessStartInfoTest.cs
 System.Diagnostics/ProcessTest.cs
+System.Diagnostics/CounterCreationDataTest.cs
 System.IO/FileSystemWatcherTest.cs
 System.IO.Compression/DeflateStreamTest.cs
 System.IO.Compression/GzipStreamTest.cs
index 7070a593763f975d02075550102e084b86f2b5e5..6807168467b4a2a922d802282bdfb16aa1eca782 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-09  Christian Hergert <christian.hergert@gmail.com>
+
+       * System.Diagnostics/CounterCreationDataTest.cs: New test to verify
+       that CounterHelp defaults to String.Empty.
+
 2007-12-04  Arina Itkes <arinai@mainsoft.com>
 
        * System_test.dll.sources : added RegexReplaceTests.cs
diff --git a/mcs/class/System/Test/System.Diagnostics/CounterCreationDataTest.cs b/mcs/class/System/Test/System.Diagnostics/CounterCreationDataTest.cs
new file mode 100644 (file)
index 0000000..fa2621f
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// CounterCreationDataTest.cs -
+//      NUnit Test Cases for CounterCreationData
+//
+// Author:
+//      Christian Hergert <christian.hergert@gmail.com>
+//
+// 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 NUnit.Framework;
+using System;
+using System.Diagnostics;
+
+namespace MonoTests.System.Diagnostics {
+
+       [TestFixture]
+       public class CounterCreationDataTest {
+               [Test]
+               public void CounterHelp_Empty () {
+                       CounterCreationData dc = new CounterCreationData();
+                       dc.CounterType = PerformanceCounterType.NumberOfItems32;
+                       dc.CounterName = "Foo";
+                       Assert.AreEqual (dc.CounterHelp, String.Empty);
+               }
+       }
+}