Core/ByteArray: Make constructor taking a size set the size instead of capacity
This commit is contained in:
parent
edac2e4af5
commit
7b0165a7df
|
|
@ -15,7 +15,7 @@ namespace Nz
|
|||
inline ByteArray::ByteArray(size_type n) :
|
||||
m_array()
|
||||
{
|
||||
m_array.reserve(n);
|
||||
m_array.resize(n);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -6,9 +6,10 @@
|
|||
|
||||
SCENARIO("ByteArray", "[CORE][BYTEARRAY]")
|
||||
{
|
||||
GIVEN("Allocate and raw constructor")
|
||||
GIVEN("Reserve memory")
|
||||
{
|
||||
Nz::ByteArray byteArray(3);
|
||||
Nz::ByteArray byteArray;
|
||||
byteArray.Reserve(3);
|
||||
|
||||
THEN("Capacity is 3 and size is 0")
|
||||
{
|
||||
|
|
@ -144,7 +145,8 @@ SCENARIO("ByteArray", "[CORE][BYTEARRAY]")
|
|||
|
||||
GIVEN("One byte array of capacity 10")
|
||||
{
|
||||
Nz::ByteArray capacityArray(10);
|
||||
Nz::ByteArray capacityArray;
|
||||
capacityArray.Reserve(10);
|
||||
|
||||
WHEN("We reserve for 100")
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue