fixed more tests. Added checking for initialized partials and download directories in RsDiscSpace

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6043 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-12-27 10:23:38 +00:00
parent 8720ab968e
commit 3b678beca9
7 changed files with 50 additions and 38 deletions

View file

@ -24,6 +24,7 @@
*/
#include <iostream>
#include <stdexcept>
#include "retroshare/rsfiles.h"
#include "retroshare/rsiface.h"
#include "retroshare/rsinit.h"
@ -129,6 +130,9 @@ bool RsDiscSpace::checkForDiscSpace(RsDiscSpace::DiscLocation loc)
{
RsStackMutex m(_mtx) ; // Locked
if(_partials_path == "" || _download_path == "")
throw std::runtime_error("Download path and partial path not properly set in RsDiscSpace. Please call RsDiscSpace::setPartialsPath() and RsDiscSpace::setDownloadPath()") ;
time_t now = time(NULL) ;
if(_last_check[loc]+DELAY_BETWEEN_CHECKS < now)