diff options
Diffstat (limited to 'Examples/test-suite/csharp/cpp11_std_array_runme.cs')
-rw-r--r-- | Examples/test-suite/csharp/cpp11_std_array_runme.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/cpp11_std_array_runme.cs b/Examples/test-suite/csharp/cpp11_std_array_runme.cs index ee7c5ee24..649e06206 100644 --- a/Examples/test-suite/csharp/cpp11_std_array_runme.cs +++ b/Examples/test-suite/csharp/cpp11_std_array_runme.cs @@ -78,5 +78,20 @@ public class cpp11_std_array_runme catch (ArgumentOutOfRangeException) { } + + // ICollection constructor, differently sized + ai = new ArrayInt6(new int[] {1, 2, 3}); + compareContainers(ai, new int[] { 1, 2, 3, 0, 0, 0}); + ai = new ArrayInt6(new int[] {1, 2, 3, 4, 5, 6, 7, 8}); + compareContainers(ai, new int[] { 1, 2, 3, 4, 5, 6}); + + // ToArray test + int[] aiArray = ai.ToArray(); + for (int i=0; i<ai.Count; i++) { + if (aiArray[i] != ai[i]) + throw new Exception("ToArray failed, index:" + i); + } + if (ai.Count != aiArray.Length) + throw new Exception("ToArray lengths mismatch"); } } |