From b417ed17f15d88eeac21c46fa666af37b69d4531 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 13 May 2009 10:22:47 +1000 Subject: More tests --- tests/auto/declarative/qmlparser/assignTypeExtremes.txt | 4 ++++ tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/auto/declarative/qmlparser/assignTypeExtremes.txt diff --git a/tests/auto/declarative/qmlparser/assignTypeExtremes.txt b/tests/auto/declarative/qmlparser/assignTypeExtremes.txt new file mode 100644 index 0000000..dbd281a --- /dev/null +++ b/tests/auto/declarative/qmlparser/assignTypeExtremes.txt @@ -0,0 +1,4 @@ +MyTypeObject { + uintProperty: 4000000000 + intProperty: -2000000000 +} diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 1a35d72..8be3311 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -386,6 +386,7 @@ private slots: void assignObjectToSignal(); void assignQmlComponent(); void assignBasicTypes(); + void assignTypeExtremes(); void customParserTypes(); void rootAsQmlComponent(); void inlineQmlComponents(); @@ -598,6 +599,16 @@ void tst_qmlparser::assignBasicTypes() QCOMPARE(child->intProperty(), 8); } +// Test edge case type assignments +void tst_qmlparser::assignTypeExtremes() +{ + QmlComponent component(&engine, TEST_FILE("assignTypeExtremes.txt")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->uintProperty(), 0xEE6B2800); + QCOMPARE(object->intProperty(), -0x77359400); +} + // Tests that custom parser tyeps can be instantiated void tst_qmlparser::customParserTypes() { -- cgit v0.12