Пример #1
0
void DevInfPackageTest::testPutGet()
{

    QList<StoragePlugin*> storage_plugins;
    DeviceInfo devInfo;
    MockStorage storage("storage");
    storage_plugins.append(&storage);
    const int SIZE_TRESHOLD = 10000;

    DevInfPackage pkg(storage_plugins, devInfo, SYNCML_1_2, ROLE_CLIENT );

    SyncMLMessage msg(HeaderParams(), SYNCML_1_2);
    int remaining = SIZE_TRESHOLD;
    QCOMPARE(pkg.write(msg, remaining, false, SYNCML_1_2), true);
    QVERIFY(remaining < SIZE_TRESHOLD);

    QtEncoder encoder;
    QByteArray result_xml;
    QVERIFY( encoder.encodeToXML( msg, result_xml, true ) );

    QByteArray putData = extractElement( result_xml, "<Put>", "</Put>" );
    QVERIFY( !putData.isEmpty() );

    verifyDevInf(putData);

    QByteArray getData = extractElement( result_xml, "<Get>", "</Get>" );
    QVERIFY( !getData.isEmpty() );

    verifyGet(getData);

}
Пример #2
0
void DevInfPackageTest::testResultsGet()
{

    QList<StoragePlugin*> storage_plugins;
    DeviceInfo devInfo;
    MockStorage storage("storage");
    storage_plugins.append(&storage);
    const int msgId = 99;
    const int cmdId = 109;
    const int SIZE_TRESHOLD = 10000;
    bool retrieveRemoteDevInf = true;

    DevInfPackage pkg(msgId, cmdId, storage_plugins, devInfo, SYNCML_1_2, ROLE_CLIENT, retrieveRemoteDevInf );

    SyncMLMessage msg(HeaderParams(), SYNCML_1_2);
    int remaining = SIZE_TRESHOLD;
    QCOMPARE(pkg.write(msg, remaining, false, SYNCML_1_2), true);
    QVERIFY(remaining < SIZE_TRESHOLD);

    QtEncoder encoder;
    QByteArray result_xml;
    QVERIFY( encoder.encodeToXML( msg, result_xml, true ) );

    QByteArray resultsData  = extractElement( result_xml, "<Results>", "</Results>" );
    QVERIFY( !resultsData.isEmpty() );

    QByteArray msgRef = extractElement( resultsData, "<MsgRef>", "</MsgRef" );
    QVERIFY( !msgRef.isEmpty() );
    QCOMPARE( msgRef.toInt(), msgId );

    QByteArray cmdRef = extractElement( resultsData, "<CmdRef>", "</CmdRef" );
    QVERIFY( !cmdRef.isEmpty() );
    QCOMPARE( cmdRef.toInt(), cmdId );

    verifyDevInf(resultsData);

    QByteArray getData = extractElement( result_xml, "<Get>", "</Get>" );
    QVERIFY( !getData.isEmpty() );

    verifyGet(getData);

}
/** Executes test iteration.
 *
 *  @return Returns STOP when test has finished executing, CONTINUE if more iterations are needed.
 */
tcu::TestNode::IterateResult TextureFilterAnisotropicQueriesTestCase::iterate()
{
	const glw::Functions& gl = m_context.getRenderContext().getFunctions();

	GLuint texture;
	gl.genTextures(1, &texture);
	GLU_EXPECT_NO_ERROR(gl.getError(), "genTextures");
	gl.bindTexture(GL_TEXTURE_2D, texture);
	GLU_EXPECT_NO_ERROR(gl.getError(), "bindTexture");
	TextureFilterAnisotropicUtils::texImage(gl, GL_TEXTURE_2D, 0, GL_RGBA8, 16, 16, 1, GL_RGBA, GL_UNSIGNED_BYTE, NULL);

	if (verifyTexParameters(gl) && verifyGet(gl))
		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
	else
		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");

	gl.deleteTextures(1, &texture);
	GLU_EXPECT_NO_ERROR(gl.getError(), "deleteTextures");

	return STOP;
}