Merge-request: 44
Task-number: QTBUG-20543
Change-Id: I7b88985fe095ffd2e48ac05c82dc3f3a92dbb091
Reviewed-on: http://codereview.qt.nokia.com/3425
Reviewed-by: Charles Yin <charles.yin@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
}
/*!
+ Compare the \a other error's values to this error and returns true, if it equal.
+*/
+
+bool QSqlError::operator==(const QSqlError& other)
+{
+ return (errorType == other.errorType);
+}
+
+
+/*!
+ Compare the \a other error's values to this error and returns true if it is not equal.
+*/
+
+bool QSqlError::operator!=(const QSqlError& other)
+{
+ return (errorType != other.errorType);
+}
+
+
+/*!
Destroys the object and frees any allocated resources.
*/
int number = -1);
QSqlError(const QSqlError& other);
QSqlError& operator=(const QSqlError& other);
+ bool operator==(const QSqlError& other);
+ bool operator!=(const QSqlError& other);
~QSqlError();
QString driverText() const;
private slots:
void getSetCheck();
void construction();
+ void operators();
};
tst_QSqlError::tst_QSqlError()
QVERIFY(!obj4.isValid());
}
+void tst_QSqlError::operators()
+{
+ QSqlError error1;
+ QSqlError error2;
+ QSqlError error3;
+
+ error1.setType(QSqlError::NoError);
+ error2.setType(QSqlError::NoError);
+ error3.setType(QSqlError::UnknownError);
+
+ QVERIFY(error1 == error2);
+ QVERIFY(error1 != error3);
+}
+
+
QTEST_MAIN(tst_QSqlError)
#include "tst_qsqlerror.moc"