diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-05-04 15:19:17 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-08 11:47:29 +0200 |
commit | 1e432f0a88b25098819fc9684b54606ba3a05123 (patch) | |
tree | dc01912358b31857ce9edea706a57e0c7015d726 /tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | |
parent | 4169e20662d0bcf52d6a278f85f44f9dacad7a68 (diff) |
Introduce a new built-in type: signed char.
C++ distinguish between "char", "signed char" and
"unsigned char", they are three independent types.
Fix QVariant behavior on ARM. On ARM "char" may mean
"unsigned char", but we depends on the sign during
a numerical conversions.
Change-Id: I610ce3fb88ed5964b67f3ae442d264fe16b2d261
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index e9de52b821..e09517678e 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -273,6 +273,7 @@ void tst_QMetaType::qMetaTypeId() QCOMPARE(::qMetaTypeId<char>(), QMetaType::type("char")); QCOMPARE(::qMetaTypeId<uchar>(), QMetaType::type("unsigned char")); QCOMPARE(::qMetaTypeId<signed char>(), QMetaType::type("signed char")); + QVERIFY(::qMetaTypeId<signed char>() != ::qMetaTypeId<char>()); QCOMPARE(::qMetaTypeId<qint8>(), QMetaType::type("qint8")); } @@ -446,6 +447,9 @@ template<> struct TestValueFactory<QMetaType::ULong> { template<> struct TestValueFactory<QMetaType::UShort> { static ushort *create() { return new ushort(0x1234); } }; +template<> struct TestValueFactory<QMetaType::SChar> { + static signed char *create() { return new signed char(-12); } +}; template<> struct TestValueFactory<QMetaType::UChar> { static uchar *create() { return new uchar('u'); } }; @@ -1012,7 +1016,7 @@ void tst_QMetaType::typedefs() { QCOMPARE(QMetaType::type("long long"), int(QMetaType::LongLong)); QCOMPARE(QMetaType::type("unsigned long long"), int(QMetaType::ULongLong)); - QCOMPARE(QMetaType::type("qint8"), int(QMetaType::Char)); + QCOMPARE(QMetaType::type("qint8"), int(QMetaType::SChar)); QCOMPARE(QMetaType::type("quint8"), int(QMetaType::UChar)); QCOMPARE(QMetaType::type("qint16"), int(QMetaType::Short)); QCOMPARE(QMetaType::type("quint16"), int(QMetaType::UShort)); |