| 172 | } |
| 173 | |
| 174 | int main(int argc, char const* argv[]) try |
| 175 | { |
| 176 | std::string save_path = "."; |
| 177 | if (argc > 1) |
| 178 | save_path = argv[1]; |
| 179 | |
| 180 | #if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE |
| 181 | run_test(save_path, lt::create_torrent::v1_only, lt::mmap_disk_io_constructor); |
| 182 | std::cout << "v1-only, mmap disk I/O\n\n"; |
| 183 | run_test(save_path, lt::create_torrent::v2_only, lt::mmap_disk_io_constructor); |
| 184 | std::cout << "v2-only, mmap disk I/O\n\n"; |
| 185 | run_test(save_path, {}, lt::mmap_disk_io_constructor); |
| 186 | std::cout << "hybrid, mmap disk I/O\n\n"; |
| 187 | #endif |
| 188 | run_test(save_path, lt::create_torrent::v1_only, lt::posix_disk_io_constructor); |
| 189 | std::cout << "v1-only, posix disk I/O\n\n"; |
| 190 | run_test(save_path, lt::create_torrent::v2_only, lt::posix_disk_io_constructor); |
| 191 | std::cout << "v2-only, posix disk I/O\n\n"; |
| 192 | run_test(save_path, {}, lt::posix_disk_io_constructor); |
| 193 | std::cout << "hybrid, posix disk I/O\n\n"; |
| 194 | } |
| 195 | catch (lt::system_error const& e) |
| 196 | { |
| 197 | std::cerr << "Failed: " << e.code().message() << '\n'; |
| 198 | } |