qsqlerror.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqlerror.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QDebug operator<<(QDebug dbg, const QSqlError &s)-
6{-
7 QDebugStateSaver saver(dbg);-
8 dbg.nospace();-
9 dbg << "QSqlError(" << s.nativeErrorCode() << ", " << s.driverText()-
10 << ", " << s.databaseText() << ')';-
11 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
12}-
13-
14-
15class QSqlErrorPrivate-
16{-
17public:-
18 QString driverError;-
19 QString databaseError;-
20 QSqlError::ErrorType errorType;-
21 QString errorCode;-
22};-
23QSqlError::QSqlError(const QString& driverText, const QString& databaseText, ErrorType type,-
24 int number)-
25{-
26 d = new QSqlErrorPrivate;-
27-
28 d->driverError = driverText;-
29 d->databaseError = databaseText;-
30 d->errorType = type;-
31 if (number != -1
number != -1Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_qsqlerror - unknown status
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_qsqlerror - unknown status
)
2-3
32 d->errorCode = QString::number(number);
executed 2 times by 2 tests: d->errorCode = QString::number(number);
Executed by:
  • tst_QSqlDatabase
  • tst_qsqlerror - unknown status
2
33}
executed 5 times by 2 tests: end of block
Executed by:
  • tst_QSqlDatabase
  • tst_qsqlerror - unknown status
5
34QSqlError::QSqlError(const QString &driverText, const QString &databaseText,-
35 ErrorType type, const QString &code)-
36{-
37 d = new QSqlErrorPrivate;-
38-
39 d->driverError = driverText;-
40 d->databaseError = databaseText;-
41 d->errorType = type;-
42 d->errorCode = code;-
43}
executed 309819 times by 11 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
  • tst_qsqlresult - unknown status
309819
44-
45-
46-
47-
48-
49QSqlError::QSqlError(const QSqlError& other)-
50{-
51 d = new QSqlErrorPrivate;-
52-
53 *d = *other.d;-
54}
executed 247759 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
247759
55-
56-
57-
58-
59-
60QSqlError& QSqlError::operator=(const QSqlError& other)-
61{-
62 *d = *other.d;-
63 return
executed 307312 times by 9 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
*this;
executed 307312 times by 9 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
307312
64}-
65-
66-
67-
68-
69-
70bool QSqlError::operator==(const QSqlError& other) const-
71{-
72 return
executed 1 time by 1 test: return (d->errorType == other.d->errorType);
Executed by:
  • tst_qsqlerror - unknown status
(d->errorType == other.d->errorType);
executed 1 time by 1 test: return (d->errorType == other.d->errorType);
Executed by:
  • tst_qsqlerror - unknown status
1
73}-
74-
75-
76-
77-
78-
79-
80bool QSqlError::operator!=(const QSqlError& other) const-
81{-
82 return
executed 1 time by 1 test: return (d->errorType != other.d->errorType);
Executed by:
  • tst_qsqlerror - unknown status
(d->errorType != other.d->errorType);
executed 1 time by 1 test: return (d->errorType != other.d->errorType);
Executed by:
  • tst_qsqlerror - unknown status
1
83}-
84-
85-
86-
87-
88-
89-
90QSqlError::~QSqlError()-
91{-
92 delete d;-
93}
executed 557585 times by 20 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlerror - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqlresult - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
557585
94-
95-
96-
97-
98-
99-
100-
101QString QSqlError::driverText() const-
102{-
103 return
executed 11603 times by 9 tests: return d->driverError;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
d->driverError;
executed 11603 times by 9 tests: return d->driverError;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
11603
104}-
105void QSqlError::setDriverText(const QString& driverText)-
106{-
107 d->driverError = driverText;-
108}
never executed: end of block
0
109QString QSqlError::databaseText() const-
110{-
111 return
executed 11571 times by 9 tests: return d->databaseError;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
d->databaseError;
executed 11571 times by 9 tests: return d->databaseError;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
11571
112}-
113void QSqlError::setDatabaseText(const QString& databaseText)-
114{-
115 d->databaseError = databaseText;-
116}
never executed: end of block
0
117-
118-
119-
120-
121-
122-
123QSqlError::ErrorType QSqlError::type() const-
124{-
125 return
executed 22 times by 3 tests: return d->errorType;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlTableModel
  • tst_qsqlerror - unknown status
d->errorType;
executed 22 times by 3 tests: return d->errorType;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlTableModel
  • tst_qsqlerror - unknown status
22
126}-
127void QSqlError::setType(ErrorType type)-
128{-
129 d->errorType = type;-
130}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qsqlerror - unknown status
8
131int QSqlError::number() const-
132{-
133 return
executed 12 times by 1 test: return d->errorCode.isEmpty() ? -1 : d->errorCode.toInt();
Executed by:
  • tst_qsqlerror - unknown status
d->errorCode.isEmpty() ? -1 : d->errorCode.toInt();
executed 12 times by 1 test: return d->errorCode.isEmpty() ? -1 : d->errorCode.toInt();
Executed by:
  • tst_qsqlerror - unknown status
12
134}-
135void QSqlError::setNumber(int number)-
136{-
137 d->errorCode = QString::number(number);-
138}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qsqlerror - unknown status
3
139-
140-
141-
142-
143-
144-
145-
146QString QSqlError::nativeErrorCode() const-
147{-
148 return
executed 11599 times by 9 tests: return d->errorCode;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
d->errorCode;
executed 11599 times by 9 tests: return d->errorCode;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
11599
149}-
150QString QSqlError::text() const-
151{-
152 QString result = d->databaseError;-
153 if (!d->databaseError.endsWith(QLatin1String("\n"))
!d->databaseEr...1String("\n"))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
154 result += QLatin1Char(' ');
never executed: result += QLatin1Char(' ');
0
155 result += d->driverError;-
156 return
never executed: return result;
result;
never executed: return result;
0
157}-
158bool QSqlError::isValid() const-
159{-
160 return
executed 236165 times by 10 tests: return d->errorType != NoError;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
d->errorType != NoError;
executed 236165 times by 10 tests: return d->errorType != NoError;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlerror - unknown status
236165
161}-
162-
163-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9