Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 6fcf04e

Browse files
committed
prevent early changes
1 parent 074d65a commit 6fcf04e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/auto/datasync/ChangeControllerTest/tst_changecontroller.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,13 @@ void ChangeControllerTest::testLiveChanges()
365365
remote->mutex.unlock();
366366

367367
if(localChange.id != -1) {//not default constructed
368+
holder->mutex.lock();//block holder to prevent early changes
369+
368370
try {
369371
auto task = async->save<TestData>(localChange);
370372
task.waitForFinished();
371373
} catch(QException &e) {
374+
holder->mutex.unlock();
372375
QFAIL(e.what());
373376
}
374377

@@ -377,6 +380,8 @@ void ChangeControllerTest::testLiveChanges()
377380
store->failCount = 1;
378381
store->mutex.unlock();
379382
}
383+
384+
holder->mutex.unlock();
380385
}
381386
if(remoteChange.size() == 1) {
382387
remote->mutex.lock();

0 commit comments

Comments
 (0)