| 314 | } |
| 315 | |
| 316 | int |
| 317 | prepare() |
| 318 | { |
| 319 | filename_in = input_dir + "story_00.json"; |
| 320 | filename_out = output_dir + "story_00.json"; |
| 321 | offset_in = input_dir.length() + 6; |
| 322 | offset_out = output_dir.length() + 6; |
| 323 | |
| 324 | struct dirent *d; |
| 325 | DIR *dir = opendir(input_dir.c_str()); |
| 326 | |
| 327 | if (dir == nullptr) { |
| 328 | cerr << "Cannot open " << input_dir << endl; |
| 329 | return 1; |
| 330 | } |
| 331 | struct stat st; |
| 332 | char name[PATH_MAX + 1] = ""; |
| 333 | strcat(name, input_dir.c_str()); |
| 334 | while ((d = readdir(dir)) != nullptr) { |
| 335 | name[input_dir.length()] = '\0'; |
| 336 | ink_strlcat(name, d->d_name, sizeof(name)); |
| 337 | stat(name, &st); |
| 338 | if (!S_ISDIR(st.st_mode)) { |
| 339 | ++last; |
| 340 | } |
| 341 | } |
| 342 | closedir(dir); |
| 343 | cerr << last << " test stories" << endl; |
| 344 | |
| 345 | if (mkdir(output_dir.c_str(), 0755) < 0 && errno != EEXIST) { |
| 346 | cerr << "Cannot create output directory" << endl; |
| 347 | return 1; |
| 348 | } |
| 349 | return 0; |
| 350 | } |
| 351 | |
| 352 | REGRESSION_TEST(HPACK_Decoding)(RegressionTest *t, int /* atype ATS_UNUSED */, int *pstatus) |
| 353 | { |
no test coverage detected