dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnetlib ChangeLog runtime/System/Array.cs tests...


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnetlib ChangeLog runtime/System/Array.cs tests...
Date: Sat, 03 Jan 2009 14:16:54 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnetlib
Changes by:     Klaus Treichel <ktreichel>      09/01/03 14:16:54

Modified files:
        .              : ChangeLog 
        runtime/System : Array.cs 
        tests/runtime/System: TestArray.cs 

Log message:
        Make Array.Clone an internalcall and add some tests.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/ChangeLog?cvsroot=dotgnu-pnet&r1=1.2548&r2=1.2549
http://cvs.savannah.gnu.org/viewcvs/pnetlib/runtime/System/Array.cs?cvsroot=dotgnu-pnet&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/pnetlib/tests/runtime/System/TestArray.cs?cvsroot=dotgnu-pnet&r1=1.5&r2=1.6

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2548
retrieving revision 1.2549
diff -u -b -r1.2548 -r1.2549
--- ChangeLog   2 Jan 2009 21:07:42 -0000       1.2548
+++ ChangeLog   3 Jan 2009 14:16:53 -0000       1.2549
@@ -1,3 +1,9 @@
+2009-01-03  Klaus Treichel  <address@hidden>
+
+       * runtime/System/Array.cs (Clone): Make Clone method an internalcall.
+
+       * tests/runtime/System/TestArray.cs: Add tests for the Clone method.
+
 2009-01-02  Klaus Treichel  <address@hidden>
 
        * 
runtime/System/Runtime/CompilerServices/CompilationRelaxationsAttribute.cs:

Index: runtime/System/Array.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Array.cs,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- runtime/System/Array.cs     30 Oct 2006 21:56:22 -0000      1.30
+++ runtime/System/Array.cs     3 Jan 2009 14:16:54 -0000       1.31
@@ -1,7 +1,7 @@
 /*
  * Array.cs - Implementation of the "System.Array" class.
  *
- * Copyright (C) 2001, 2002, 2003  Southern Storm Software, Pty Ltd.
+ * Copyright (C) 2001, 2002, 2003, 2009  Southern Storm Software, Pty Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -176,10 +176,8 @@
 #endif
 
        // Clone this array.
-       public virtual Object Clone()
-       {
-               return MemberwiseClone();
-       }
+       [MethodImpl(MethodImplOptions.InternalCall)]
+       extern public virtual Object Clone();
 
        // Copy the contents of one array into another.
        public static void Copy(Array sourceArray, Array destinationArray,

Index: tests/runtime/System/TestArray.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/TestArray.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- tests/runtime/System/TestArray.cs   29 Oct 2006 09:25:52 -0000      1.5
+++ tests/runtime/System/TestArray.cs   3 Jan 2009 14:16:54 -0000       1.6
@@ -1,7 +1,7 @@
 /*
  * TestArray.cs - Tests for the "Array" class.
  *
- * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
+ * Copyright (C) 2003, 2009  Southern Storm Software, Pty Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -255,6 +255,26 @@
                                return true;
                        }
 
+       // Helper to clone an array via the ICloneable interface
+       static private Object CloneObject(ICloneable o)
+                       {
+                               return o.Clone();
+                       }
+
+       // Test Cloning Arrays
+       public void TestArrayClone()
+                       {
+                               int[] a;
+                               int[] b;
+
+                               a = new int [] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+                               b = (int[])a.Clone();
+                               Assert("Clone (1)", SameContents(a, b));
+
+                               b = (int[])CloneObject(a);
+                               Assert("Clone (2)", SameContents(a, b));
+                       }
+
        // Test copying arrays.
        public void TestArrayCopy()
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]