Skip to content

Commit c2f79fa

Browse files
authored
Work/fix failing winvfs tests (#12088)
1 parent a45c976 commit c2f79fa

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/csync/vio/csync_vio_local_win.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *h
136136

137137
if (vfs && vfs->statTypeVirtualFile(file_stat.get(), &handle->ffd)) {
138138
// all good
139+
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
140+
file_stat->type = ItemTypeDirectory;
139141
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
140142
// Detect symlinks, and treat junctions as symlinks too.
141143
if (handle->ffd.dwReserved0 == IO_REPARSE_TAG_SYMLINK
@@ -150,8 +152,6 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *h
150152
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE
151153
|| handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) {
152154
file_stat->type = ItemTypeSkip;
153-
} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
154-
file_stat->type = ItemTypeDirectory;
155155
} else {
156156
file_stat->type = ItemTypeFile;
157157
}

test/testutils/syncenginetestutils.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,12 @@ void FakeGetReply::respond()
657657
Q_EMIT readyRead();
658658
}
659659
}
660-
Q_EMIT finished();
660+
if (!isFinished()) {
661+
// It can happen that this job is cancelled before the full data is read, and the job is aborted. This being the test framework, processing happens
662+
// synchronously, so between the signals above and here, the job can get aborted, which emits the finished signal. So do NOT emit it again if
663+
// this is the case.
664+
Q_EMIT finished();
665+
}
661666
}
662667
}
663668

0 commit comments

Comments
 (0)