Skip to content
Snippets Groups Projects
Commit b0a83e7f authored by Adrien Béraud's avatar Adrien Béraud
Browse files

tests/fileTransfer: testTooLarge

GitLab: #972
Change-Id: Ic345e31ff51c9d51b50df0c911594e9d7f07ebbb
parent 06803cb1
No related branches found
No related tags found
No related merge requests found
......@@ -333,8 +333,8 @@ ConversationRequestTest::connectSignals()
void
ConversationRequestTest::tearDown()
{
auto bobArchive = std::filesystem::current_path().string() + "/bob.gz";
std::remove(bobArchive.c_str());
auto bobArchive = std::filesystem::current_path() / "bob.gz";
std::filesystem::remove(bobArchive);
if (bob2Id.empty()) {
wait_for_removal_of({aliceId, bobId, carlaId});
......@@ -604,8 +604,8 @@ ConversationRequestTest::testRemoveContactMultiDevice()
// Add second device for Bob
std::map<std::string, std::shared_ptr<libjami::CallbackWrapperBase>> confHandlers;
auto bobArchive = std::filesystem::current_path().string() + "/bob.gz";
std::remove(bobArchive.c_str());
auto bobArchive = std::filesystem::current_path() / "bob.gz";
std::filesystem::remove(bobArchive);
bobAccount->exportArchive(bobArchive);
std::map<std::string, std::string> details = libjami::getAccountTemplate("RING");
......
......@@ -192,6 +192,7 @@ FileTransferTest::connectSignals()
[&](const std::string& accountId,
const std::string& /* conversationId */,
libjami::SwarmMessage message) {
std::unique_lock<std::mutex> lk {mtx};
if (accountId == aliceId) {
aliceData.messages.emplace_back(message);
} else if (accountId == bobId) {
......@@ -389,7 +390,7 @@ FileTransferTest::testBadSha3sumOut()
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]() { return bobMsgSize + 1 == bobData.messages.size(); }));
// modifiy file
sendFile = std::ofstream(sendPath);
sendFile = std::ofstream(sendPath, std::ios::trunc);
CPPUNIT_ASSERT(sendFile.is_open());
sendFile << std::string(64000, 'B');
sendFile.close();
......@@ -635,7 +636,7 @@ FileTransferTest::testTooLarge()
auto fileId = bobData.messages.rbegin()->body["fileId"];
// Add some data for the reception. This will break the final shasum
std::ofstream recvFile(recvPath);
std::ofstream recvFile(recvPath + std::string(".tmp"));
CPPUNIT_ASSERT(recvFile.is_open());
recvFile << std::string(1000, 'B');
recvFile.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment