public static int Main(String[] args) { int size = 32; V3[] tmpV3Array = new V3[size]; Object[] VarArray = new Object[size]; for (int i = 0; i < size; i++) VarArray[i] = (new V3(1)); Array.Copy(VarArray, tmpV3Array, size); for (int i = 0; i < size; i++) if (!tmpV3Array[i].Validate()) throw new Exception("tmpV3Array[" + i + "] didn't validate correctly! got: " + tmpV3Array[i] + " expected: " + VarArray[i]); return 100; }
public static int Main(String[] args) { V3[] V3Array = new V3[5]; for (int i = 0; i < V3Array.Length; i++) V3Array[i] = new V3(); /* V3[] clone = null; clone = (V3[]) V3Array.Clone(); if (clone.length != V3Array.length) throw new Exception("V3[] length mismatch! cloned length: "+clone.length); for(int i=0; i<V3Array.length; i++) { clone[i].Validate(); } Console.WriteLine("V3 array test worked"); /* */ return 100; }