Utils: Fix short string capacity

The short string capacity is the data area size minus the size of \0.

Change-Id: Iffb4428bb81fc78bdc4c00218cf9f2c9ac8c25e5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-08-02 19:07:33 +02:00
committed by Tim Jenssen
parent 08711525ec
commit 4c7cc99375
2 changed files with 8 additions and 3 deletions

View File

@@ -1315,3 +1315,10 @@ TEST(SmallString, StringPlusOperator)
ASSERT_THAT(result, "text and more text");
}
TEST(SmallString, ShortStringCapacity)
{
ASSERT_THAT(SmallString().shortStringCapacity(), 30);
ASSERT_THAT(PathString().shortStringCapacity(), 189);
}