Skip to content
Snippets Groups Projects
Commit a118ddfa authored by Sébastien Blin's avatar Sébastien Blin
Browse files

syncHistory: fix testProfileReceivedMultiDevice

The directory was not created in /tmp causing the test to fail
(std::rename fails).

Change-Id: Ic583447ec4d8bc7df9c63744cba9d6c096ee9792
parent f0adf132
No related branches found
No related tags found
No related merge requests found
...@@ -508,7 +508,7 @@ TransferManager::onIncomingProfile(const std::shared_ptr<ChannelSocket>& channel ...@@ -508,7 +508,7 @@ TransferManager::onIncomingProfile(const std::shared_ptr<ChannelSocket>& channel
auto recvDir = fmt::format("{:s}/{:s}/vcard/", fileutils::get_cache_dir(), pimpl_->accountId_); auto recvDir = fmt::format("{:s}/{:s}/vcard/", fileutils::get_cache_dir(), pimpl_->accountId_);
fileutils::recursive_mkdir(recvDir); fileutils::recursive_mkdir(recvDir);
info.path = fmt::format("{:s}/{:s}_{:s}_{}", recvDir, deviceId, uri, tid); info.path = fmt::format("{:s}{:s}_{:s}_{}", recvDir, deviceId, uri, tid);
auto ifile = std::make_shared<IncomingFile>(std::move(channel), info, "profile.vcf", ""); auto ifile = std::make_shared<IncomingFile>(std::move(channel), info, "profile.vcf", "");
auto res = pimpl_->vcards_.emplace(idx, std::move(ifile)); auto res = pimpl_->vcards_.emplace(idx, std::move(ifile));
......
...@@ -996,6 +996,7 @@ END:VCARD"; ...@@ -996,6 +996,7 @@ END:VCARD";
if (accountId == aliceId && peerId == bobUri) { if (accountId == aliceId && peerId == bobUri) {
bobProfileReceived = true; bobProfileReceived = true;
auto p = std::filesystem::path(bobDest); auto p = std::filesystem::path(bobDest);
fileutils::recursive_mkdir(p.parent_path());
auto res = std::rename(path.c_str(), bobDest.c_str()); auto res = std::rename(path.c_str(), bobDest.c_str());
} else if (accountId == bobId && peerId == aliceUri) { } else if (accountId == bobId && peerId == aliceUri) {
aliceProfileReceived = true; aliceProfileReceived = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment