~ubuntu-branches/ubuntu/trusty/autopilot-qt/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/unittests/tst_introspection.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Thomi Richards, Timo Jyrinki, Christopher Lee
  • Date: 2014-03-03 04:42:27 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140303044227-opwfn6gohcxgy78a
Tags: 1.4+14.04.20140303-0ubuntu1
[ Thomi Richards ]
* Export QObject children of Qml items. (LP: #1269578)

[ Timo Jyrinki ]
* Fix tab/space whitespace in debian/control.

[ Christopher Lee ]
* Backing out recent change that introduces issues on devices.
* Re-implement (w/ fixes) exporting QObject children of Qml items
  (including non-visual items). (LP: #1269578)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
    void test_property_matching();
51
51
 
 
52
    void test_get_node_property();
 
53
 
52
54
private:
53
55
    QMainWindow *m_object;
54
56
};
511
513
    QVERIFY(n.MatchBooleanProperty("visible", true) == true);
512
514
}
513
515
 
 
516
void tst_Introspection::test_get_node_property()
 
517
{
 
518
    QVariant property;
 
519
    QVariant unpacked_property;
 
520
 
 
521
    property = GetNodeProperty(m_object, "dynamicTestProperty");
 
522
    unpacked_property = qvariant_cast<QVariantList>(property).at(1);
 
523
    QVERIFY(property.isValid() == true);
 
524
    QVERIFY(unpacked_property.isValid() == true);
 
525
    QVERIFY(unpacked_property.toString() == "testValue");
 
526
 
 
527
    property = GetNodeProperty(m_object, "myUInt");
 
528
    unpacked_property = qvariant_cast<QVariantList>(property).at(1);
 
529
    QVERIFY(property.isValid() == true);
 
530
    QVERIFY(unpacked_property.isValid() == true);
 
531
    QVERIFY(unpacked_property.toFloat() == 5);
 
532
 
 
533
    // Meta Property
 
534
    property = GetNodeProperty(m_object, "fullScreen");
 
535
    unpacked_property = qvariant_cast<QVariantList>(property).at(1);
 
536
    QVERIFY(property.isValid() == true);
 
537
    QVERIFY(unpacked_property.isValid() == true);
 
538
    QVERIFY(unpacked_property.toBool() == false);
 
539
}
 
540
 
514
541
QTEST_MAIN(tst_Introspection)
515
542
 
516
543
#include "tst_introspection.moc"