qsqldatabase.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqldatabase.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace { namespace Q_QGS_loader { typedef QFactoryLoader Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 9 times by 9 tests
Evaluated by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 9 times by 9 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
}
executed 9 times by 9 tests: end of block
Executed by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ("org.qt-project.Qt.QSqlDriverFactoryInterface", QLatin1String("/sqldrivers")))) : value ("org.qt-project.Qt.QSqlDriverFactoryInterface", QLatin1String("/sqldrivers")) { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 96 times by 9 tests: return &holder.value;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
&holder.value;
executed 96 times by 9 tests: return &holder.value;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
} } } static QGlobalStatic<QFactoryLoader, Q_QGS_loader::innerFunction, Q_QGS_loader::guard> loader;
0-96
7-
8-
9-
10-
11-
12-
13const-
14-
15char *QSqlDatabase::defaultConnection = const_cast<char *>("qt_sql_default_connection");-
16-
17typedef QHash<QString, QSqlDriverCreatorBase*> DriverDict;-
18-
19class QConnectionDict: public QHash<QString, QSqlDatabase>-
20{-
21public:-
22 inline bool contains_ts(const QString &key)-
23 {-
24 QReadLocker locker(&lock);-
25 return
executed 2 times by 1 test: return contains(key);
Executed by:
  • tst_QSqlDatabase
contains(key);
executed 2 times by 1 test: return contains(key);
Executed by:
  • tst_QSqlDatabase
2
26 }-
27 inline QStringList keys_ts() const-
28 {-
29 QReadLocker locker(&lock);-
30 return
never executed: return keys();
keys();
never executed: return keys();
0
31 }-
32-
33 mutable QReadWriteLock lock;-
34};-
35namespace { namespace Q_QGS_dbDict { typedef QConnectionDict Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 9 times by 9 tests
Evaluated by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 9 times by 9 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
}
executed 9 times by 9 tests: end of block
Executed by:
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 2324 times by 17 tests: return &holder.value;
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_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
&holder.value;
executed 2324 times by 17 tests: return &holder.value;
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_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
} } } static QGlobalStatic<QConnectionDict, Q_QGS_dbDict::innerFunction, Q_QGS_dbDict::guard> dbDict;
0-2324
36-
37class QSqlDatabasePrivate-
38{-
39public:-
40 QSqlDatabasePrivate(QSqlDatabase *d, QSqlDriver *dr = 0):-
41 ref(1),-
42 q(d),-
43 driver(dr),-
44 port(-1)-
45 {-
46 precisionPolicy = QSql::LowPrecisionDouble;-
47 }
executed 44 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
44
48 QSqlDatabasePrivate(const QSqlDatabasePrivate &other);-
49 ~QSqlDatabasePrivate();-
50 void init(const QString& type);-
51 void copy(const QSqlDatabasePrivate *other);-
52 void disable();-
53-
54 QAtomicInt ref;-
55 QSqlDatabase *q;-
56 QSqlDriver* driver;-
57 QString dbname;-
58 QString uname;-
59 QString pword;-
60 QString hname;-
61 QString drvName;-
62 int port;-
63 QString connOptions;-
64 QString connName;-
65 QSql::NumericalPrecisionPolicy precisionPolicy;-
66-
67 static QSqlDatabasePrivate *shared_null();-
68 static QSqlDatabase database(const QString& name, bool open);-
69 static void addDatabase(const QSqlDatabase &db, const QString & name);-
70 static void removeDatabase(const QString& name);-
71 static void invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn = true);-
72 static DriverDict &driverDict();-
73 static void cleanConnections();-
74};-
75-
76QSqlDatabasePrivate::QSqlDatabasePrivate(const QSqlDatabasePrivate &other) : ref(1)-
77{-
78 q = other.q;-
79 dbname = other.dbname;-
80 uname = other.uname;-
81 pword = other.pword;-
82 hname = other.hname;-
83 drvName = other.drvName;-
84 port = other.port;-
85 connOptions = other.connOptions;-
86 driver = other.driver;-
87 precisionPolicy = other.precisionPolicy;-
88}
never executed: end of block
0
89-
90QSqlDatabasePrivate::~QSqlDatabasePrivate()-
91{-
92 if (driver != shared_null()->driver
driver != shar...null()->driverDescription
TRUEevaluated 33 times by 11 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
FALSEevaluated 13 times by 12 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
)
13-33
93 delete driver;
executed 33 times by 11 tests: delete driver;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
33
94}
executed 46 times by 17 tests: end of block
Executed by:
  • 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_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
46
95-
96void QSqlDatabasePrivate::cleanConnections()-
97{-
98 QConnectionDict *dict = dbDict();-
99 ((!(dict)) ? qt_assert("dict",__FILE__,190) : qt_noop());-
100 QWriteLocker locker(&dict->lock);-
101-
102 QConnectionDict::iterator it = dict->begin();-
103 while (it != dict->end()
it != dict->end()Description
TRUEevaluated 7 times by 4 tests
Evaluated by:
  • tst_QSql
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
FALSEevaluated 22 times by 9 tests
Evaluated by:
  • tst_QSql
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
) {
7-22
104 invalidateDb(it.value(), it.key(), false);-
105 ++it;-
106 }
executed 7 times by 4 tests: end of block
Executed by:
  • tst_QSql
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
7
107 dict->clear();-
108}
executed 22 times by 9 tests: end of block
Executed by:
  • tst_QSql
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
22
109-
110static bool qDriverDictInit = false;-
111static void cleanDriverDict()-
112{-
113 qDeleteAll(QSqlDatabasePrivate::driverDict());-
114 QSqlDatabasePrivate::driverDict().clear();-
115 QSqlDatabasePrivate::cleanConnections();-
116 qDriverDictInit = false;-
117}
executed 22 times by 9 tests: end of block
Executed by:
  • tst_QSql
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
22
118-
119DriverDict &QSqlDatabasePrivate::driverDict()-
120{-
121 static DriverDict dict;-
122 if (!qDriverDictInit
!qDriverDictInitDescription
TRUEevaluated 21 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEevaluated 87 times by 16 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
) {
21-87
123 qDriverDictInit = true;-
124 qAddPostRoutine(cleanDriverDict);-
125 }
executed 21 times by 8 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
21
126 return
executed 108 times by 17 tests: return dict;
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_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
dict;
executed 108 times by 17 tests: return dict;
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_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
108
127}-
128-
129QSqlDatabasePrivate *QSqlDatabasePrivate::shared_null()-
130{-
131 static QSqlNullDriver dr;-
132 static QSqlDatabasePrivate n(__null, &dr);-
133 return
executed 8131 times by 18 tests: return &n;
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_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
&n;
executed 8131 times by 18 tests: return &n;
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_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
8131
134}-
135-
136void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn)-
137{-
138 if (db.d->ref.load() != 1
db.d->ref.load() != 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSqlDatabase
FALSEevaluated 36 times by 11 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
&& doWarn
doWarnDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSqlDatabase
FALSEnever evaluated
) {
0-36
139 QMessageLogger(__FILE__, 230, __PRETTY_FUNCTION__).warning("QSqlDatabasePrivate::removeDatabase: connection '%s' is still in use, "-
140 "all queries will cease to work.", name.toLocal8Bit().constData());-
141 db.d->disable();-
142 db.d->connName.clear();-
143 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSqlDatabase
1
144}
executed 37 times by 11 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
37
145-
146void QSqlDatabasePrivate::removeDatabase(const QString &name)-
147{-
148 QConnectionDict *dict = dbDict();-
149 ((!(dict)) ? qt_assert("dict",__FILE__,240) : qt_noop());-
150 QWriteLocker locker(&dict->lock);-
151-
152 if (!dict->contains(name)
!dict->contains(name)Description
TRUEnever evaluated
FALSEevaluated 30 times by 8 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
0-30
153 return;
never executed: return;
0
154-
155 invalidateDb(dict->take(name), name);-
156}
executed 30 times by 8 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
30
157-
158void QSqlDatabasePrivate::addDatabase(const QSqlDatabase &db, const QString &name)-
159{-
160 QConnectionDict *dict = dbDict();-
161 ((!(dict)) ? qt_assert("dict",__FILE__,252) : qt_noop());-
162 QWriteLocker locker(&dict->lock);-
163-
164 if (dict->contains(name)
dict->contains(name)Description
TRUEnever evaluated
FALSEevaluated 36 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
) {
0-36
165 invalidateDb(dict->take(name), name);-
166 QMessageLogger(__FILE__, 257, __PRETTY_FUNCTION__).warning("QSqlDatabasePrivate::addDatabase: duplicate connection name '%s', old "-
167 "connection removed.", name.toLocal8Bit().data());-
168 }
never executed: end of block
0
169 dict->insert(name, db);-
170 db.d->connName = name;-
171}
executed 36 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
36
172-
173-
174-
175QSqlDatabase QSqlDatabasePrivate::database(const QString& name, bool open)-
176{-
177 const QConnectionDict *dict = dbDict();-
178 ((!(dict)) ? qt_assert("dict",__FILE__,269) : qt_noop());-
179-
180 dict->lock.lockForRead();-
181 QSqlDatabase db = dict->value(name);-
182 dict->lock.unlock();-
183 if (db.isValid()
db.isValid()Description
TRUEevaluated 1972 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 262 times by 5 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
&& !db.isOpen()
!db.isOpen()Description
TRUEevaluated 24 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEevaluated 1948 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
&& open
openDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSqlQuery
FALSEevaluated 19 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
) {
5-1972
184 if (!db.open()
!db.open()Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-5
185 QMessageLogger(__FILE__, 276, __PRETTY_FUNCTION__).warning() << "QSqlDatabasePrivate::database: unable to open database:" << db.lastError().text();
never executed: QMessageLogger(__FILE__, 276, __PRETTY_FUNCTION__).warning() << "QSqlDatabasePrivate::database: unable to open database:" << db.lastError().text();
0
186-
187 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QSqlQuery
5
188 return
executed 2234 times by 9 tests: return db;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
db;
executed 2234 times by 9 tests: return db;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2234
189}-
190-
191-
192-
193-
194-
195void QSqlDatabasePrivate::copy(const QSqlDatabasePrivate *other)-
196{-
197 q = other->q;-
198 dbname = other->dbname;-
199 uname = other->uname;-
200 pword = other->pword;-
201 hname = other->hname;-
202 drvName = other->drvName;-
203 port = other->port;-
204 connOptions = other->connOptions;-
205 precisionPolicy = other->precisionPolicy;-
206}
executed 7 times by 3 tests: end of block
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • tst_QSqlThread
7
207-
208void QSqlDatabasePrivate::disable()-
209{-
210 if (driver != shared_null()->driver
driver != shar...null()->driverDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSqlDatabase
FALSEnever evaluated
) {
0-1
211 delete driver;-
212 driver = shared_null()->driver;-
213 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSqlDatabase
1
214}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSqlDatabase
1
215QSqlDatabase QSqlDatabase::addDatabase(const QString &type, const QString &connectionName)-
216{-
217 QSqlDatabase db(type);-
218 QSqlDatabasePrivate::addDatabase(db, connectionName);-
219 return
executed 29 times by 8 tests: return db;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
db;
executed 29 times by 8 tests: return db;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
29
220}-
221QSqlDatabase QSqlDatabase::database(const QString& connectionName, bool open)-
222{-
223 return
executed 2234 times by 9 tests: return QSqlDatabasePrivate::database(connectionName, open);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
QSqlDatabasePrivate::database(connectionName, open);
executed 2234 times by 9 tests: return QSqlDatabasePrivate::database(connectionName, open);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2234
224}-
225void QSqlDatabase::removeDatabase(const QString& connectionName)-
226{-
227 QSqlDatabasePrivate::removeDatabase(connectionName);-
228}
executed 30 times by 8 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
30
229-
230-
231-
232-
233-
234-
235-
236QStringList QSqlDatabase::drivers()-
237{-
238 QStringList list;-
239 if (QFactoryLoader *fl = loader()
QFactoryLoader *fl = loader()Description
TRUEevaluated 26 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
) {
0-26
240 typedef QMultiMap<int, QString> PluginKeyMap;-
241 typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;-
242-
243 const PluginKeyMap keyMap = fl->keyMap();-
244 const PluginKeyMapConstIterator cend = keyMap.constEnd();-
245 for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend
it != cendDescription
TRUEevaluated 234 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEevaluated 26 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
; ++it)
26-234
246 if (!list.contains(it.value())
!list.contains(it.value())Description
TRUEevaluated 234 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-234
247 list << it.value();
executed 234 times by 7 tests: list << it.value();
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
234
248 }
executed 26 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
26
249-
250-
251 DriverDict dict = QSqlDatabasePrivate::driverDict();-
252 for (DriverDict::const_iterator i = dict.constBegin(); i != dict.constEnd()
i != dict.constEnd()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEevaluated 26 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
; ++i) {
1-26
253 if (!list.contains(i.key())
!list.contains(i.key())Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEnever evaluated
)
0-1
254 list << i.key();
executed 1 time by 1 test: list << i.key();
Executed by:
  • tst_QSql
1
255 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSql
1
256-
257 return
executed 26 times by 7 tests: return list;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
list;
executed 26 times by 7 tests: return list;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
26
258}-
259void QSqlDatabase::registerSqlDriver(const QString& name, QSqlDriverCreatorBase *creator)-
260{-
261 delete QSqlDatabasePrivate::driverDict().take(name);-
262 if (creator
creatorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEnever evaluated
)
0-1
263 QSqlDatabasePrivate::driverDict().insert(name, creator);
executed 1 time by 1 test: QSqlDatabasePrivate::driverDict().insert(name, creator);
Executed by:
  • tst_QSql
1
264}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSql
1
265bool QSqlDatabase::contains(const QString& connectionName)-
266{-
267 return
executed 2 times by 1 test: return dbDict()->contains_ts(connectionName);
Executed by:
  • tst_QSqlDatabase
dbDict()->contains_ts(connectionName);
executed 2 times by 1 test: return dbDict()->contains_ts(connectionName);
Executed by:
  • tst_QSqlDatabase
2
268}-
269QStringList QSqlDatabase::connectionNames()-
270{-
271 return
never executed: return dbDict()->keys_ts();
dbDict()->keys_ts();
never executed: return dbDict()->keys_ts();
0
272}-
273QSqlDatabase::QSqlDatabase(const QString &type)-
274{-
275 d = new QSqlDatabasePrivate(this);-
276 d->init(type);-
277}
executed 36 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
36
278-
279-
280-
281-
282-
283-
284-
285QSqlDatabase::QSqlDatabase(QSqlDriver *driver)-
286{-
287 d = new QSqlDatabasePrivate(this, driver);-
288}
never executed: end of block
0
289-
290-
291-
292-
293-
294-
295QSqlDatabase::QSqlDatabase()-
296{-
297 d = QSqlDatabasePrivate::shared_null();-
298 d->ref.ref();-
299}
executed 1287 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
1287
300-
301-
302-
303-
304QSqlDatabase::QSqlDatabase(const QSqlDatabase &other)-
305{-
306 d = other.d;-
307 d->ref.ref();-
308}
executed 19118 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
19118
309-
310-
311-
312-
313QSqlDatabase &QSqlDatabase::operator=(const QSqlDatabase &other)-
314{-
315 qAtomicAssign(d, other.d);-
316 return
executed 968 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 968 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
968
317}-
318-
319-
320-
321-
322-
323-
324-
325void QSqlDatabasePrivate::init(const QString &type)-
326{-
327 drvName = type;-
328-
329 if (!driver
!driverDescription
TRUEevaluated 36 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
) {
0-36
330 }
executed 36 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
36
331-
332 if (!driver
!driverDescription
TRUEevaluated 36 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
) {
0-36
333 DriverDict dict = QSqlDatabasePrivate::driverDict();-
334 for (DriverDict::const_iterator it = dict.constBegin();-
335 it != dict.constEnd()
it != dict.constEnd()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEevaluated 36 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
&& !driver
!driverDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEnever evaluated
; ++it) {
0-36
336 if (type == it.key()
type == it.key()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEnever evaluated
) {
0-1
337 driver = ((QSqlDriverCreatorBase*)(*it))->createObject();-
338 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSql
1
339 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSql
1
340 }
executed 36 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
36
341-
342-
343 if (!driver
!driverDescription
TRUEevaluated 35 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
&& loader()
loader()Description
TRUEevaluated 35 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-35
344 driver = qLoadPlugin<QSqlDriver, QSqlDriverPlugin>(loader(), type);
executed 35 times by 9 tests: driver = qLoadPlugin<QSqlDriver, QSqlDriverPlugin>(loader(), type);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
35
345-
346-
347 if (!driver
!driverDescription
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
FALSEevaluated 33 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
) {
3-33
348 QMessageLogger(__FILE__, 781, __PRETTY_FUNCTION__).warning("QSqlDatabase: %s driver not loaded", type.toLatin1().data());-
349 QMessageLogger(__FILE__, 782, __PRETTY_FUNCTION__).warning("QSqlDatabase: available drivers: %s",-
350 QSqlDatabase::drivers().join(QLatin1Char(' ')).toLatin1().data());-
351 if (QCoreApplication::instance() == 0
QCoreApplicati...nstance() == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSql
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_QSqlQuery
)
1-2
352 QMessageLogger(__FILE__, 785, __PRETTY_FUNCTION__).warning("QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins");
executed 1 time by 1 test: QMessageLogger(__FILE__, 785, __PRETTY_FUNCTION__).warning("QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins");
Executed by:
  • tst_QSql
1
353 driver = shared_null()->driver;-
354 }
executed 3 times by 3 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
3
355}
executed 36 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
36
356-
357-
358-
359-
360-
361-
362-
363QSqlDatabase::~QSqlDatabase()-
364{-
365 if (!d->ref.deref()
!d->ref.deref()Description
TRUEevaluated 37 times by 11 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
FALSEevaluated 20405 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
) {
37-20405
366 close();-
367 delete d;-
368 }
executed 37 times by 11 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
37
369}
executed 20442 times by 12 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_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
20442
370QSqlQuery QSqlDatabase::exec(const QString & query) const-
371{-
372 QSqlQuery r(d->driver->createResult());-
373 if (!query.isEmpty()
!query.isEmpty()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QSqlRelationalTableModel
FALSEnever evaluated
) {
0-16
374 r.exec(query);-
375 d->driver->setLastError(r.lastError());-
376 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_QSqlRelationalTableModel
16
377 return
executed 16 times by 1 test: return r;
Executed by:
  • tst_QSqlRelationalTableModel
r;
executed 16 times by 1 test: return r;
Executed by:
  • tst_QSqlRelationalTableModel
16
378}-
379bool QSqlDatabase::open()-
380{-
381 return
executed 48 times by 9 tests: return d->driver->open(d->dbname, d->uname, d->pword, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver->open(d->dbname, d->uname, d->pword, d->hname,
executed 48 times by 9 tests: return d->driver->open(d->dbname, d->uname, d->pword, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
48
382 d->port, d->connOptions);
executed 48 times by 9 tests: return d->driver->open(d->dbname, d->uname, d->pword, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
48
383}-
384bool QSqlDatabase::open(const QString& user, const QString& password)-
385{-
386 setUserName(user);-
387 return
executed 1 time by 1 test: return d->driver->open(d->dbname, user, password, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QSql
d->driver->open(d->dbname, user, password, d->hname,
executed 1 time by 1 test: return d->driver->open(d->dbname, user, password, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QSql
1
388 d->port, d->connOptions);
executed 1 time by 1 test: return d->driver->open(d->dbname, user, password, d->hname, d->port, d->connOptions);
Executed by:
  • tst_QSql
1
389}-
390void QSqlDatabase::close()-
391{-
392 d->driver->close();-
393}
executed 80 times by 11 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqltablemodel - unknown status
80
394-
395-
396-
397-
398-
399-
400bool QSqlDatabase::isOpen() const-
401{-
402 return
executed 2030 times by 9 tests: return d->driver->isOpen();
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver->isOpen();
executed 2030 times by 9 tests: return d->driver->isOpen();
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2030
403}-
404-
405-
406-
407-
408-
409-
410-
411bool QSqlDatabase::isOpenError() const-
412{-
413 return
executed 10 times by 1 test: return d->driver->isOpenError();
Executed by:
  • tst_QSqlDatabase
d->driver->isOpenError();
executed 10 times by 1 test: return d->driver->isOpenError();
Executed by:
  • tst_QSqlDatabase
10
414}-
415bool QSqlDatabase::transaction()-
416{-
417 if (!d->driver->hasFeature(QSqlDriver::Transactions)
!d->driver->ha...:Transactions)Description
TRUEnever evaluated
FALSEevaluated 5 times by 3 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
)
0-5
418 return
never executed: return false;
false;
never executed: return false;
0
419 return
executed 5 times by 3 tests: return d->driver->beginTransaction();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
d->driver->beginTransaction();
executed 5 times by 3 tests: return d->driver->beginTransaction();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
5
420}-
421bool QSqlDatabase::commit()-
422{-
423 if (!d->driver->hasFeature(QSqlDriver::Transactions)
!d->driver->ha...:Transactions)Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
)
0-4
424 return
never executed: return false;
false;
never executed: return false;
0
425 return
executed 4 times by 3 tests: return d->driver->commitTransaction();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
d->driver->commitTransaction();
executed 4 times by 3 tests: return d->driver->commitTransaction();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
4
426}-
427bool QSqlDatabase::rollback()-
428{-
429 if (!d->driver->hasFeature(QSqlDriver::Transactions)
!d->driver->ha...:Transactions)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSqlDatabase
)
0-1
430 return
never executed: return false;
false;
never executed: return false;
0
431 return
executed 1 time by 1 test: return d->driver->rollbackTransaction();
Executed by:
  • tst_QSqlDatabase
d->driver->rollbackTransaction();
executed 1 time by 1 test: return d->driver->rollbackTransaction();
Executed by:
  • tst_QSqlDatabase
1
432}-
433void QSqlDatabase::setDatabaseName(const QString& name)-
434{-
435 if (isValid()
isValid()Description
TRUEevaluated 25 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-25
436 d->dbname = name;
executed 25 times by 9 tests: d->dbname = name;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
25
437}
executed 25 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
25
438void QSqlDatabase::setUserName(const QString& name)-
439{-
440 if (isValid()
isValid()Description
TRUEevaluated 23 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-23
441 d->uname = name;
executed 23 times by 7 tests: d->uname = name;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
23
442}
executed 23 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
23
443void QSqlDatabase::setPassword(const QString& password)-
444{-
445 if (isValid()
isValid()Description
TRUEevaluated 22 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-22
446 d->pword = password;
executed 22 times by 7 tests: d->pword = password;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
22
447}
executed 22 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
22
448void QSqlDatabase::setHostName(const QString& host)-
449{-
450 if (isValid()
isValid()Description
TRUEevaluated 23 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-23
451 d->hname = host;
executed 23 times by 7 tests: d->hname = host;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
23
452}
executed 23 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
23
453void QSqlDatabase::setPort(int port)-
454{-
455 if (isValid()
isValid()Description
TRUEevaluated 20 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-20
456 d->port = port;
executed 20 times by 7 tests: d->port = port;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
20
457}
executed 20 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
20
458-
459-
460-
461-
462-
463-
464-
465QString QSqlDatabase::databaseName() const-
466{-
467 return
executed 21 times by 5 tests: return d->dbname;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlTableModel
  • tst_QSqlThread
d->dbname;
executed 21 times by 5 tests: return d->dbname;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlTableModel
  • tst_QSqlThread
21
468}-
469-
470-
471-
472-
473-
474-
475QString QSqlDatabase::userName() const-
476{-
477 return
executed 2 times by 1 test: return d->uname;
Executed by:
  • tst_QSql
d->uname;
executed 2 times by 1 test: return d->uname;
Executed by:
  • tst_QSql
2
478}-
479-
480-
481-
482-
483-
484-
485QString QSqlDatabase::password() const-
486{-
487 return
executed 2 times by 1 test: return d->pword;
Executed by:
  • tst_QSql
d->pword;
executed 2 times by 1 test: return d->pword;
Executed by:
  • tst_QSql
2
488}-
489-
490-
491-
492-
493-
494-
495QString QSqlDatabase::hostName() const-
496{-
497 return
executed 11568 times by 8 tests: return d->hname;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->hname;
executed 11568 times by 8 tests: return d->hname;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
11568
498}-
499-
500-
501-
502-
503-
504-
505QString QSqlDatabase::driverName() const-
506{-
507 return
executed 35675 times by 8 tests: return d->drvName;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->drvName;
executed 35675 times by 8 tests: return d->drvName;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
35675
508}-
509-
510-
511-
512-
513-
514-
515-
516int QSqlDatabase::port() const-
517{-
518 return
executed 11568 times by 8 tests: return d->port;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->port;
executed 11568 times by 8 tests: return d->port;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
11568
519}-
520QSqlDriver* QSqlDatabase::driver() const-
521{-
522 return
executed 4315 times by 8 tests: return d->driver;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver;
executed 4315 times by 8 tests: return d->driver;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
4315
523}-
524QSqlError QSqlDatabase::lastError() const-
525{-
526 return
executed 29 times by 6 tests: return d->driver->lastError();
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver->lastError();
executed 29 times by 6 tests: return d->driver->lastError();
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
  • tst_QSqlThread
29
527}-
528QStringList QSqlDatabase::tables(QSql::TableType type) const-
529{-
530 return
executed 51 times by 8 tests: return d->driver->tables(type);
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver->tables(type);
executed 51 times by 8 tests: return d->driver->tables(type);
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
51
531}-
532QSqlIndex QSqlDatabase::primaryIndex(const QString& tablename) const-
533{-
534 return
executed 187 times by 4 tests: return d->driver->primaryIndex(tablename);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
d->driver->primaryIndex(tablename);
executed 187 times by 4 tests: return d->driver->primaryIndex(tablename);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
187
535}-
536QSqlRecord QSqlDatabase::record(const QString& tablename) const-
537{-
538 return
executed 328 times by 5 tests: return d->driver->record(tablename);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
d->driver->record(tablename);
executed 328 times by 5 tests: return d->driver->record(tablename);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
328
539}-
540void QSqlDatabase::setConnectOptions(const QString &options)-
541{-
542 if (isValid()
isValid()Description
TRUEevaluated 21 times by 7 tests
Evaluated by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-21
543 d->connOptions = options;
executed 21 times by 7 tests: d->connOptions = options;
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
21
544}
executed 21 times by 7 tests: end of block
Executed by:
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
21
545-
546-
547-
548-
549-
550-
551-
552QString QSqlDatabase::connectOptions() const-
553{-
554 return
never executed: return d->connOptions;
d->connOptions;
never executed: return d->connOptions;
0
555}-
556bool QSqlDatabase::isDriverAvailable(const QString& name)-
557{-
558 return
never executed: return drivers().contains(name);
drivers().contains(name);
never executed: return drivers().contains(name);
0
559}-
560QSqlDatabase QSqlDatabase::addDatabase(QSqlDriver* driver, const QString& connectionName)-
561{-
562 QSqlDatabase db(driver);-
563 QSqlDatabasePrivate::addDatabase(db, connectionName);-
564 return
never executed: return db;
db;
never executed: return db;
0
565}-
566-
567-
568-
569-
570-
571-
572-
573bool QSqlDatabase::isValid() const-
574{-
575 return
executed 6793 times by 9 tests: return d->driver && d->driver != d->shared_null()->driver;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->driver
d->driverDescription
TRUEevaluated 6793 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
&& d->driver != d->shared_null()->driver
d->driver != d...null()->driverDescription
TRUEevaluated 5445 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 1348 times by 6 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
;
executed 6793 times by 9 tests: return d->driver && d->driver != d->shared_null()->driver;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
0-6793
576}-
577QSqlDatabase QSqlDatabase::cloneDatabase(const QSqlDatabase &other, const QString &connectionName)-
578{-
579 if (!other.isValid()
!other.isValid()Description
TRUEnever evaluated
FALSEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • tst_QSqlThread
)
0-7
580 return
never executed: return QSqlDatabase();
QSqlDatabase();
never executed: return QSqlDatabase();
0
581-
582 QSqlDatabase db(other.driverName());-
583 db.d->copy(other.d);-
584 QSqlDatabasePrivate::addDatabase(db, connectionName);-
585 return
executed 7 times by 3 tests: return db;
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • tst_QSqlThread
db;
executed 7 times by 3 tests: return db;
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • tst_QSqlThread
7
586}-
587QString QSqlDatabase::connectionName() const-
588{-
589 return
executed 4 times by 1 test: return d->connName;
Executed by:
  • tst_QSqlDatabase
d->connName;
executed 4 times by 1 test: return d->connName;
Executed by:
  • tst_QSqlDatabase
4
590}-
591void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)-
592{-
593 if(driver()
driver()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlDatabase
FALSEnever evaluated
)
0-2
594 driver()->setNumericalPrecisionPolicy(precisionPolicy);
executed 2 times by 1 test: driver()->setNumericalPrecisionPolicy(precisionPolicy);
Executed by:
  • tst_QSqlDatabase
2
595 d->precisionPolicy = precisionPolicy;-
596}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSqlDatabase
2
597QSql::NumericalPrecisionPolicy QSqlDatabase::numericalPrecisionPolicy() const-
598{-
599 if(driver()
driver()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSqlDatabase
FALSEnever evaluated
)
0-1
600 return
executed 1 time by 1 test: return driver()->numericalPrecisionPolicy();
Executed by:
  • tst_QSqlDatabase
driver()->numericalPrecisionPolicy();
executed 1 time by 1 test: return driver()->numericalPrecisionPolicy();
Executed by:
  • tst_QSqlDatabase
1
601 else-
602 return
never executed: return d->precisionPolicy;
d->precisionPolicy;
never executed: return d->precisionPolicy;
0
603}-
604-
605-
606-
607QDebug operator<<(QDebug dbg, const QSqlDatabase &d)-
608{-
609 QDebugStateSaver saver(dbg);-
610 dbg.nospace();-
611 dbg.noquote();-
612 if (!d.isValid()
!d.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
613 dbg << "QSqlDatabase(invalid)";-
614 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
615 }-
616-
617 dbg << "QSqlDatabase(driver=\"" << d.driverName() << "\", database=\""-
618 << d.databaseName() << "\", host=\"" << d.hostName() << "\", port=" << d.port()-
619 << ", user=\"" << d.userName() << "\", open=" << d.isOpen() << ')';-
620 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
621}-
622-
623-
624-
Switch to Source codePreprocessed file

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