Commit b6b6984902d098fe9c3380e0219a528cb0f71967
multiple tests in DatabaseUpdaterTest fail because we do not close the MySQL Embedded connection completely,
i.e. opening multiple mysql connections in one application does not seem to work, they always access the first one
| |   |
| 33 | 33 | |
| 34 | 34 | static const int DB_VERSION = 13; |
| 35 | 35 | |
| int |
| DatabaseUpdater::expectedDatabaseVersion() |
| { |
| return DB_VERSION; |
| } |
|
| 36 | 42 | DatabaseUpdater::DatabaseUpdater() |
| 37 | 43 | : m_collection( 0 ) |
| 38 | 44 | , m_storage( 0 ) |
| |   |
| 30 | 30 | DatabaseUpdater(); |
| 31 | 31 | ~DatabaseUpdater(); |
| 32 | 32 | |
| static int expectedDatabaseVersion(); |
|
| 33 | 35 | bool needsUpdate() const; |
| 34 | 36 | void update(); |
| 35 | 37 | bool rescanNeeded() const { return m_rescanNeeded; } |
| |   |
| 52 | 52 | DatabaseUpdater updater; |
| 53 | 53 | updater.setStorage( &storage ); |
| 54 | 54 | storage.query( "CREATE TABLE admin (component VARCHAR(40), version INTEGER);" ); |
| storage.query( "INSERT INTO admin(component, version) VALUES('DB_VERSION', 12);"); |
| storage.query( QString( "INSERT INTO admin(component, version) VALUES('DB_VERSION', %1 );" ).arg( updater.expectedDatabaseVersion() ) ); |
|
| QEXPECT_FAIL( "", "Connection to MySql Embedded database not closed completely", Abort ); |
| 56 | 58 | QVERIFY( !updater.needsUpdate() ); |
| 57 | 59 | } |
| 58 | 60 | |