diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2021-07-30 09:16:27 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2021-07-30 09:16:27 -0700 |
commit | 0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df (patch) | |
tree | d214ecd864bbef469a9378ac5f3c05f6cd74f4da /src/unit/array.unit | |
parent | 2745b2811b03e83c165b07801704f32fc5bc588d (diff) | |
download | libbu++-0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df.tar.gz libbu++-0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df.tar.bz2 libbu++-0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df.tar.xz libbu++-0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df.zip |
Fixed uninitializsed bug in Bu::Array::setSize.
When setCapacity was used before setSize some elements were not being
properly initialized in the array.
Diffstat (limited to 'src/unit/array.unit')
-rw-r--r-- | src/unit/array.unit | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/unit/array.unit b/src/unit/array.unit index 83401c1..e9f2bdf 100644 --- a/src/unit/array.unit +++ b/src/unit/array.unit | |||
@@ -101,4 +101,12 @@ suite Array | |||
101 | unitTest( aInts[j] == j ); | 101 | unitTest( aInts[j] == j ); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | |||
105 | test setSize | ||
106 | { | ||
107 | Bu::Array<Bu::String> aStr( 3 ); | ||
108 | aStr.setSize( 3 ); | ||
109 | aStr[1] = "Hello"; | ||
110 | aStr[0] = aStr[1].clone(); | ||
111 | } | ||
104 | } | 112 | } |