mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-13 17:13:06 -04:00
- Restored compilation of most tests (The part using previously named p3ConnectMgr is still to be done).
- moved ftSearchDummy and ftDataSendPair in tests/ft since it is only used there. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6009 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6571279b70
commit
bc65dd40c2
48 changed files with 314 additions and 1797 deletions
|
@ -1,6 +1,7 @@
|
|||
|
||||
RS_TOP_DIR = ../..
|
||||
DHT_TOP_DIR = ../../../../libbitdht/src
|
||||
OPS_TOP_DIR = ../../../../openpgpsdk/src
|
||||
##### Define any flags that are needed for this section #######
|
||||
###############################################################
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
SharedDirInfo dir;
|
||||
dir.filename = argv[optind];
|
||||
dir.shareflags = RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_BROWSABLE;
|
||||
dir.shareflags = DIR_FLAGS_PERMISSIONS_MASK ;
|
||||
rootdirs.push_back(dir);
|
||||
std::cerr << "Adding shared directory: " << argv[optind] << std::endl;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,9 @@ int main()
|
|||
FileIndex *fi1 = createBasicFileIndex(100);
|
||||
FileIndex *fi2 = new FileIndex("A SILLY ID");
|
||||
|
||||
fi1->printFileIndex(std::cout);
|
||||
std::string out ;
|
||||
fi1->printFileIndex(out);
|
||||
std::cout << out <<std::endl;
|
||||
std::string fhash;
|
||||
uint64_t size;
|
||||
std::set<std::string> forbiddenroots;
|
||||
|
@ -41,7 +43,9 @@ int main()
|
|||
std::cout << " -- new file index -- " << std::endl;
|
||||
|
||||
fi2->loadIndex("test.index", fhash, size);
|
||||
fi2->printFileIndex(std::cout);
|
||||
out.clear() ;
|
||||
fi2->printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
|
||||
delete fi1;
|
||||
delete fi2;
|
||||
|
|
|
@ -75,10 +75,15 @@ int test1(FileIndex *fi)
|
|||
|
||||
/* clean up the dir (should have no effect) */
|
||||
fi -> removeOldDirectory(olddir->parent->path, olddir->name, stamp);
|
||||
fi -> printFileIndex(std::cout);
|
||||
|
||||
std::string out ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
}
|
||||
|
||||
fi -> printFileIndex(std::cout);
|
||||
std::string out ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -133,10 +138,14 @@ int test2(FileIndex *fi)
|
|||
/* clean up the dir */
|
||||
fi -> removeOldDirectory(olddir->parent->path, olddir->name, stamp);
|
||||
|
||||
fi -> printFileIndex(std::cout);
|
||||
std::string out ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
}
|
||||
|
||||
fi -> printFileIndex(std::cout);
|
||||
std::string out ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -152,7 +161,9 @@ FileIndex *createBasicFileIndex(time_t age)
|
|||
FileEntry fe;
|
||||
|
||||
/* print empty FileIndex */
|
||||
fi -> printFileIndex(std::cout);
|
||||
std::string out ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
|
||||
std::list<std::string> rootdirs;
|
||||
rootdirs.push_back("base1");
|
||||
|
@ -206,7 +217,9 @@ FileIndex *createBasicFileIndex(time_t age)
|
|||
fe.name = "file20";
|
||||
fi -> updateFileEntry("/base3/",fe, age);
|
||||
|
||||
fi -> printFileIndex(std::cout);
|
||||
out.clear() ;
|
||||
fi -> printFileIndex(out);
|
||||
std::cout << out << std::endl;
|
||||
|
||||
return fi;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,9 @@ int main()
|
|||
|
||||
while(!hashresult.empty())
|
||||
{
|
||||
hashresult.back()->print(std::cout);
|
||||
std::string out ;
|
||||
hashresult.back()->print(out);
|
||||
std::cout << out << std::endl;
|
||||
hashresult.pop_back();
|
||||
}
|
||||
|
||||
|
@ -65,7 +67,9 @@ int main()
|
|||
|
||||
while(!termresult.empty())
|
||||
{
|
||||
termresult.back()->print(std::cout);
|
||||
std::string out ;
|
||||
termresult.back()->print(out);
|
||||
std::cout << out << std::endl;
|
||||
termresult.pop_back();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue