| 85 | // query_test ----------------------------------------------------------------------// |
| 86 | |
| 87 | void query_test() |
| 88 | { |
| 89 | cout << "query test..." << endl; |
| 90 | |
| 91 | error_code ec; |
| 92 | |
| 93 | CHECK(file_size("no-such-file", ec) == static_cast<boost::uintmax_t>(-1)); |
| 94 | CHECK(ec == errc::no_such_file_or_directory); |
| 95 | |
| 96 | CHECK(status("no-such-file") == file_status(file_not_found, no_perms)); |
| 97 | |
| 98 | CHECK(exists("/")); |
| 99 | CHECK(is_directory("/")); |
| 100 | CHECK(!exists("no-such-file")); |
| 101 | |
| 102 | exists("/", ec); |
| 103 | if (ec) |
| 104 | { |
| 105 | cout << "exists(\"/\", ec) resulted in non-zero ec.value()" << endl; |
| 106 | cout << "ec value: " << ec.value() << ", message: "<< ec.message() << endl; |
| 107 | } |
| 108 | CHECK(!ec); |
| 109 | |
| 110 | CHECK(exists("/")); |
| 111 | CHECK(is_directory("/")); |
| 112 | CHECK(!is_regular_file("/")); |
| 113 | CHECK(!boost::filesystem::is_empty("/")); |
| 114 | CHECK(!is_other("/")); |
| 115 | } |
| 116 | |
| 117 | // directory_iterator_test -----------------------------------------------// |
| 118 |
no test coverage detected