Skip to content
Snippets Groups Projects
Commit 6415ae7b authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

fix tests

parent da98870e
No related branches found
No related tags found
No related merge requests found
......@@ -74,9 +74,9 @@ WorkerErrorCode FolderDataBroker::GetNext(FileInfo* info, FileData* data) {
}
IOErrors ioerr;
auto fd = io__->OpenFileToRead(base_path_+"/"+info->relative_path +
(info->relative_path.empty()?"":"/")+
info->base_name, &ioerr);
auto fd = io__->OpenFileToRead(base_path_ + "/" + info->relative_path +
(info->relative_path.empty() ? "" : "/") +
info->base_name, &ioerr);
return MapIOError(ioerr);
}
......
......@@ -207,16 +207,19 @@ class OpenFileMock : public FakeIO {
};
TEST_F(FolderDataBrokerTests, GetNextCallsOpenFileWithFileName) {
OpenFileMock* mock=new OpenFileMock;
data_broker->io__.reset(mock);
OpenFileMock mock;
data_broker->io__.reset(&mock);
data_broker->Connect();
FileInfo fi;
FileData data;
EXPECT_CALL(*mock, OpenFileToRead("/path/to/file/1",_));
auto err=IOErrors::NO_ERROR;
EXPECT_CALL(mock, OpenFileToRead("/path/to/file/1", _)).
WillOnce(DoAll(testing::SetArgPointee<1>(IOErrors::NO_ERROR),testing::Return(1)));
data_broker->GetNext(&fi, &data);
data_broker->io__.release();
Mock::AllowLeak(mock);
// Mock::AllowLeak(mock);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment