~timo-jyrinki/autopilot-qt/rebuild_against_qt521

« back to all changes in this revision

Viewing changes to tests/unittests/tst_introspection.cpp

Re-implement (w/ fixes) exporting QObject children of Qml items (including non-visual items). Fixes: 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"