diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-06-27 13:09:23 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-06-27 13:47:53 +0200 |
commit | 53a16752c257d2f4f99ecef2cde1580b817fc12a (patch) | |
tree | 1d1510797b67edcb5d9de0cb7de5128308d7800b /tests | |
parent | 8fb4beb2a194f6a42e650c4d91bb4e25c916e5f6 (diff) |
QStringBuilder: do not crash with null char*
This is supported by the others operator+
Change-Id: I9a1d1a0afb63acf32935948111d43ca6da370363
Reviewed-on: http://codereview.qt.nokia.com/764
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qstringbuilder1/stringbuilder.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp index 2327ef55f9..de7ad656e4 100644 --- a/tests/auto/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/qstringbuilder1/stringbuilder.cpp @@ -133,6 +133,12 @@ void runScenario() QCOMPARE(r, string); r = string P ba; QCOMPARE(r, string); + + const char *zero = 0; + r = string P zero; + QCOMPARE(r, string); + r = zero P string; + QCOMPARE(r, string); #endif string = QString::fromLatin1(LITERAL); @@ -161,6 +167,12 @@ void runScenario() QCOMPARE(r, r2); r2 = QByteArray("hello\0") P UTF8_LITERAL; QCOMPARE(r, r2); + + const char *zero = 0; + r = ba P zero; + QCOMPARE(r, ba); + r = zero P ba; + QCOMPARE(r, ba); } //operator QString += |