void tst_QMediaTimeRange::testIntervalNormalize()
{
    QMediaTimeInterval x(20, 10);

    QVERIFY(!x.isNormal());
    QVERIFY(x.start() == 20);
    QVERIFY(x.end() == 10);

    QMediaTimeInterval y = x.normalized();

    QVERIFY(y.isNormal());
    QVERIFY(y.start() == 10);
    QVERIFY(y.end() == 20);
    QVERIFY(x != y);
}
void tst_QMediaTimeRange::testIntervalCtor()
{
    //Default Ctor for Time Interval
    /* create an instance for the time interval and verify the default cases */
    QMediaTimeInterval tInter;
    QVERIFY(tInter.isNormal());
    QVERIFY(tInter.start() == 0);
    QVERIFY(tInter.end() == 0);

    // (qint, qint) Ctor time interval
    /* create an instace of QMediaTimeInterval passing start and end times and verify the all possible scenario's*/
    QMediaTimeInterval time(20,50);
    QVERIFY(time.isNormal());
    QVERIFY(time.start() == 20);
    QVERIFY(time.end() == 50);

    // Copy Ctor Time interval
    QMediaTimeInterval other(time);
    QVERIFY(other.isNormal() == time.isNormal());
    QVERIFY(other.start() == time.start());
    QVERIFY(other.end() == time.end());
    QVERIFY(other.contains(20) == time.contains(20));
    QVERIFY(other == time);
}
Exemplo n.º 3
0
/*!
    \fn operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
    \relates QMediaTimeRange

    Returns true if \a a is not exactly equal to \a b.
    \since 1.0
*/
bool operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
{
    return a.start() != b.start() || a.end() != b.end();
}
Exemplo n.º 4
0
/*!
    \fn operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
    \relates QMediaTimeRange

    Returns true if \a a is exactly equal to \a b.
    \since 1.0
*/
bool operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
{
    return a.start() == b.start() && a.end() == b.end();
}