| 195 | } |
| 196 | |
| 197 | int main(int argc, char *argv[]) |
| 198 | { |
| 199 | char fname[80]; |
| 200 | int ret; |
| 201 | |
| 202 | if (argc > 1) |
| 203 | return T_EXIT_SKIP; |
| 204 | |
| 205 | sprintf(fname, ".fd-pass.%d", getpid()); |
| 206 | t_create_file_pattern(fname, FSIZE, PAT); |
| 207 | |
| 208 | ret = test(fname, 0, 1, 0); |
| 209 | if (ret == T_EXIT_FAIL) { |
| 210 | fprintf(stderr, "test failed 0 1\n"); |
| 211 | ret = T_EXIT_FAIL; |
| 212 | } |
| 213 | |
| 214 | ret = test(fname, 0, 2, 0); |
| 215 | if (ret == T_EXIT_FAIL) { |
| 216 | fprintf(stderr, "test failed 0 2\n"); |
| 217 | ret = T_EXIT_FAIL; |
| 218 | } |
| 219 | |
| 220 | ret = test(fname, 1, 1, 0); |
| 221 | if (ret == T_EXIT_FAIL) { |
| 222 | fprintf(stderr, "test failed 1 1\n"); |
| 223 | ret = T_EXIT_FAIL; |
| 224 | } |
| 225 | |
| 226 | ret = test(fname, 1, 0, 0); |
| 227 | if (ret == T_EXIT_FAIL) { |
| 228 | fprintf(stderr, "test failed 1 0\n"); |
| 229 | ret = T_EXIT_FAIL; |
| 230 | } |
| 231 | |
| 232 | ret = test(fname, 1, IORING_FILE_INDEX_ALLOC, 0); |
| 233 | if (ret == T_EXIT_FAIL) { |
| 234 | fprintf(stderr, "test failed 1 ALLOC\n"); |
| 235 | ret = T_EXIT_FAIL; |
| 236 | } |
| 237 | |
| 238 | ret = test(fname, 0, 2, IORING_SETUP_DEFER_TASKRUN|IORING_SETUP_SINGLE_ISSUER); |
| 239 | if (ret == T_EXIT_FAIL) { |
| 240 | fprintf(stderr, "test failed 0 2 defer\n"); |
| 241 | ret = T_EXIT_FAIL; |
| 242 | } else if (ret == T_EXIT_SKIP) { |
| 243 | return T_EXIT_PASS; |
| 244 | } |
| 245 | |
| 246 | ret = test(fname, 1, 1, IORING_SETUP_DEFER_TASKRUN|IORING_SETUP_SINGLE_ISSUER); |
| 247 | if (ret == T_EXIT_FAIL) { |
| 248 | fprintf(stderr, "test failed 1 1 defer\n"); |
| 249 | ret = T_EXIT_FAIL; |
| 250 | } |
| 251 | |
| 252 | ret = test(fname, 1, 0, IORING_SETUP_DEFER_TASKRUN|IORING_SETUP_SINGLE_ISSUER); |
| 253 | if (ret == T_EXIT_FAIL) { |
| 254 | fprintf(stderr, "test failed 1 0 defer\n"); |
nothing calls this directly
no test coverage detected