From 0fbcc3a0c7ef4835c77c5d8b87cc8732cc3f90df Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 30 Jul 2021 09:16:27 -0700 Subject: Fixed uninitializsed bug in Bu::Array::setSize. When setCapacity was used before setSize some elements were not being properly initialized in the array. --- src/unit/array.unit | 8 ++++++++ src/unit/string.unit | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'src/unit') 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 unitTest( aInts[j] == j ); } } + + test setSize + { + Bu::Array aStr( 3 ); + aStr.setSize( 3 ); + aStr[1] = "Hello"; + aStr[0] = aStr[1].clone(); + } } diff --git a/src/unit/string.unit b/src/unit/string.unit index 1f4ca7e..6242eff 100644 --- a/src/unit/string.unit +++ b/src/unit/string.unit @@ -586,6 +586,12 @@ suite String { unitTest( Bu::String("0x%{1}00").arg( 75, Bu::Fmt::hex() ).end() == "0x4b00" ); } + + test sharedEmpty1 + { + Bu::String a; + Bu::String b = a.clone(); + } } // 03F09CA4F58AC8CA0E80F0D9D409D0A60700A192270004BC3A99E91D0001034F544603362E35013103313130019CA4F58AC8CA0E0002830800002C4200008AC200EBF7D9D4090127BB010000E3 // -- cgit v1.2.3