Electroneum
HTTPClientFuzzer Class Reference
Inheritance diagram for HTTPClientFuzzer:
Collaboration diagram for HTTPClientFuzzer:

Public Member Functions

 HTTPClientFuzzer ()
 
virtual int init ()
 
virtual int run (const std::string &filename)
 

Detailed Description

Definition at line 56 of file http-client.cpp.

Constructor & Destructor Documentation

◆ HTTPClientFuzzer()

HTTPClientFuzzer::HTTPClientFuzzer ( )
inline

Definition at line 59 of file http-client.cpp.

59 {}

Member Function Documentation

◆ init()

int HTTPClientFuzzer::init ( )
virtual

Reimplemented from Fuzzer.

Definition at line 67 of file http-client.cpp.

68 {
69  return 0;
70 }

◆ run()

int HTTPClientFuzzer::run ( const std::string &  filename)
virtual

Implements Fuzzer.

Definition at line 72 of file http-client.cpp.

73 {
74  std::string s;
75 
77  {
78  std::cout << "Error: failed to load file " << filename << std::endl;
79  return 1;
80  }
81  try
82  {
83  client.test(s, std::chrono::milliseconds(1000));
84  }
85  catch (const std::exception &e)
86  {
87  std::cerr << "Failed to test http client: " << e.what() << std::endl;
88  return 1;
89  }
90  return 0;
91 }
::std::string string
Definition: gtest-port.h:1097
bool load_file_to_string(const std::string &path_to_file, std::string &target_str, size_t max_size=1000000000)
bool test(const std::string &s, std::chrono::milliseconds timeout)
Definition: http_client.h:451
Here is the call graph for this function:

The documentation for this class was generated from the following file: