diff options
Diffstat (limited to 'tests/auto/qbytearray/tst_qbytearray.cpp')
-rw-r--r-- | tests/auto/qbytearray/tst_qbytearray.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp index e3341d1..0dc2282 100644 --- a/tests/auto/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/qbytearray/tst_qbytearray.cpp @@ -223,18 +223,18 @@ void tst_QByteArray::qUncompress_data() QTest::addColumn<QByteArray>("in"); QTest::addColumn<QByteArray>("out"); - QTest::newRow("0x00000000") << QByteArray("\x00\x00\x00\x00") << QByteArray(); - QTest::newRow("0x000000ff") << QByteArray("\x00\x00\x00\xff") << QByteArray(); - QTest::newRow("0x3f000000") << QByteArray("\x3f\x00\x00\x00") << QByteArray(); - QTest::newRow("0x3fffffff") << QByteArray("\x3f\xff\xff\xff") << QByteArray(); - QTest::newRow("0x7fffff00") << QByteArray("\x7f\xff\xff\x00") << QByteArray(); - QTest::newRow("0x7fffffff") << QByteArray("\x7f\xff\xff\xff") << QByteArray(); - QTest::newRow("0x80000000") << QByteArray("\x80\x00\x00\x00") << QByteArray(); - QTest::newRow("0x800000ff") << QByteArray("\x80\x00\x00\xff") << QByteArray(); - QTest::newRow("0xcf000000") << QByteArray("\xcf\x00\x00\x00") << QByteArray(); - QTest::newRow("0xcfffffff") << QByteArray("\xcf\xff\xff\xff") << QByteArray(); - QTest::newRow("0xffffff00") << QByteArray("\xff\xff\xff\x00") << QByteArray(); - QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff") << QByteArray(); + QTest::newRow("0x00000000") << QByteArray("\x00\x00\x00\x00", 4) << QByteArray(); + QTest::newRow("0x000000ff") << QByteArray("\x00\x00\x00\xff", 4) << QByteArray(); + QTest::newRow("0x3f000000") << QByteArray("\x3f\x00\x00\x00", 4) << QByteArray(); + QTest::newRow("0x3fffffff") << QByteArray("\x3f\xff\xff\xff", 4) << QByteArray(); + QTest::newRow("0x7fffff00") << QByteArray("\x7f\xff\xff\x00", 4) << QByteArray(); + QTest::newRow("0x7fffffff") << QByteArray("\x7f\xff\xff\xff", 4) << QByteArray(); + QTest::newRow("0x80000000") << QByteArray("\x80\x00\x00\x00", 4) << QByteArray(); + QTest::newRow("0x800000ff") << QByteArray("\x80\x00\x00\xff", 4) << QByteArray(); + QTest::newRow("0xcf000000") << QByteArray("\xcf\x00\x00\x00", 4) << QByteArray(); + QTest::newRow("0xcfffffff") << QByteArray("\xcf\xff\xff\xff", 4) << QByteArray(); + QTest::newRow("0xffffff00") << QByteArray("\xff\xff\xff\x00", 4) << QByteArray(); + QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff", 4) << QByteArray(); } void tst_QByteArray::qUncompress() @@ -251,18 +251,10 @@ void tst_QByteArray::qUncompress() #endif QByteArray res; - QT_TRY { - res = ::qUncompress(in); - } QT_CATCH(const std::bad_alloc &) { - res = QByteArray(); - } + res = ::qUncompress(in); QCOMPARE(res, out); - QT_TRY { - res = ::qUncompress(in + "blah"); - } QT_CATCH(const std::bad_alloc &) { - res = QByteArray(); - } + res = ::qUncompress(in + "blah"); QCOMPARE(res, out); } |