diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2023-03-22 21:05:36 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2023-03-22 21:05:36 +0000 |
commit | bf122fe985ce89d3ce91df2edae4c29088dfebf0 (patch) | |
tree | 6acd08d87fd12794c066c9f5e10baa966ebf98d0 /Examples | |
parent | 0c56f3557eeeee24ce438c78e35439dada5f5001 (diff) | |
parent | 20f7309220a774e1c2b5b0ec3cf94f4d09c192bd (diff) | |
download | swig-bf122fe985ce89d3ce91df2edae4c29088dfebf0.tar.gz |
Merge branch 'bda_standardize_vector_array'
* bda_standardize_vector_array:
std_array.i std_vector.i tweaks
Lib/csharp: Better standardized std_vector.i and std_array.i
Diffstat (limited to 'Examples')
-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"); } } |