Exemplo n.º 1
0
void tst_QXmlSchema::copyConstructor() const
{
    /* Verify that we can take a const reference, and simply do a copy of a default constructed object. */
    {
        const QXmlSchema schema1;
        QXmlSchema schema2(schema1);
    }

    /* Copy twice. */
    {
        const QXmlSchema schema1;
        QXmlSchema schema2(schema1);
        QXmlSchema schema3(schema2);
    }

    /* Verify that copying default values works. */
    {
        const QXmlSchema schema1;
        const QXmlSchema schema2(schema1);
        QCOMPARE(schema2.messageHandler(), schema1.messageHandler());
        QCOMPARE(schema2.uriResolver(), schema1.uriResolver());
        QCOMPARE(schema2.networkAccessManager(), schema1.networkAccessManager());
        QCOMPARE(schema2.isValid(), schema1.isValid());
    }
}
Exemplo n.º 2
0
void tst_QXmlSchema::networkAccessManagerDefaultValue() const
{
    /* Test that the default value of network access manager is not empty. */
    {
        QXmlSchema schema;
        QVERIFY(schema.networkAccessManager() != static_cast<QNetworkAccessManager*>(0));
    }
}
Exemplo n.º 3
0
void tst_QXmlSchema::networkAccessManagerSignature() const
{
    /* Const object. */
    const QXmlSchema schema;

    /* The function should be const. */
    schema.networkAccessManager();
}
Exemplo n.º 4
0
void tst_QXmlSchema::networkAccessManager() const
{
    /* Test that we return the network manager that was set. */
    {
        QNetworkAccessManager manager;
        QXmlSchema schema;
        schema.setNetworkAccessManager(&manager);
        QCOMPARE(schema.networkAccessManager(), &manager);
    }
}
void tst_QXmlSchemaValidator::networkAccessManagerDefaultValue() const
{
    /* Test that the default value of network access manager is equal to the one from the schema. */
    {
        const QXmlSchema schema;
        const QXmlSchemaValidator validator(schema);
        QVERIFY(validator.networkAccessManager() == schema.networkAccessManager());
    }

    /* Test that the default value of network access manager is equal to the one from the schema. */
    {
        QXmlSchema schema;

        QNetworkAccessManager manager;
        schema.setNetworkAccessManager(&manager);

        const QXmlSchemaValidator validator(schema);
        QVERIFY(validator.networkAccessManager() == schema.networkAccessManager());
    }
}