#include "ft/ftfilemapper.h" #include "ft/ftchunkmap.h" #include "retroshare/rstypes.h" #include #include #include #include #include INITTEST(); int main() { /* Use ftfilemapper to create a file with chunks downloaded on a random direction. */ static const std::string tmpdir = "." ; static const std::string input_file = tmpdir+"/"+"input.bin" ; static const std::string output_file = tmpdir+"/"+"output.bin" ; static const uint64_t size = 1024*1024*12+234;//4357283 ; // some size. Not an integer number of chunks static const uint32_t chunk_size = 1024*1024 ; // 1MB pid_t pid = getpid() ; srand48(pid) ; srand(pid) ; std::cerr << "Inited random number generator with seed " << pid << std::endl; // 0 - create a random file in memory, of size SIZE void *membuf = malloc(size) ; CHECK(membuf != NULL) ; for(int i=0;i