aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2018-03-26 17:10:17 +0200
committerMarco Bubke <marco.bubke@qt.io>2018-04-04 13:34:20 +0000
commitb6cb22899c1e221397649b635a3e07c191971b93 (patch)
tree2e02839c647fbc6cd3a2ccf629f4839b67c20f76 /tests/unit
parent0ecd5436148edc2c8f0ffb12a4acb633c525046c (diff)
Utils: Improve SmallString
The small string control block moved to the beginning, so it is more cache local. The control block is cleanup too, so it should be easier to read. The alignment is removed because it is creating to big holes. Change-Id: I401aeb9d55455cbaa5e722dd8192e54b525ddc40 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unittest/smallstring-test.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/tests/unit/unittest/smallstring-test.cpp b/tests/unit/unittest/smallstring-test.cpp
index f64c608696..ee55d875a7 100644
--- a/tests/unit/unittest/smallstring-test.cpp
+++ b/tests/unit/unittest/smallstring-test.cpp
@@ -55,24 +55,17 @@ TEST(SmallString, NullSmallStringIsEqualToEmptySmallString)
TEST(SmallString, ShortSmallStringLiteralIsShortSmallString)
{
- constexpr SmallStringLiteral shortText("short string");
+ // constexpr
+ SmallStringLiteral shortText("short string");
-#if __cpp_constexpr >= 201304
ASSERT_TRUE(shortText.isShortString());
-#else
- ASSERT_TRUE(shortText.isReadOnlyReference());
-#endif
}
TEST(SmallString, ShortSmallStringIsShortSmallString)
{
SmallString shortText("short string");
-#if __cpp_constexpr >= 201304
ASSERT_TRUE(shortText.isShortString());
-#else
- ASSERT_TRUE(shortText.isReadOnlyReference());
-#endif
}
TEST(SmallString, CreateFromCStringIterators)
@@ -189,11 +182,7 @@ TEST(SmallString, CopyShortConstExpressionSmallStringIsShortSmallString)
auto shortTextCopy = shortText;
-#if __cpp_constexpr >= 201304
ASSERT_TRUE(shortTextCopy.isShortString());
-#else
- ASSERT_TRUE(shortTextCopy.isReadOnlyReference());
-#endif
}
TEST(SmallString, CopyLongConstExpressionSmallStringIsLongSmallString)