MCPcopy Create free account
hub / github.com/apache/trafficserver / prepare

Function prepare

src/proxy/http2/test_HPACK.cc:316–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316int
317prepare()
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
352REGRESSION_TEST(HPACK_Decoding)(RegressionTest *t, int /* atype ATS_UNUSED */, int *pstatus)
353{

Callers 1

mainFunction · 0.85

Calls 4

ink_strlcatFunction · 0.85
statClass · 0.70
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected