KiCad PCB EDA Suite
Loading...
Searching...
No Matches
HTTP_LIB_FAKE_SERVER Class Reference

In-process HTTP library server used by QA tests. More...

#include <http_lib_fake_server.h>

Classes

struct  RESPONSE
 

Public Member Functions

void SetResponse (const std::string &aUrl, RESPONSE aResponse)
 Replace the response served for an exact URL.
 
int RequestCount (const std::string &aUrl) const
 Number of times aUrl has been requested.
 
HTTP_LIB_CONNECTION::RETRIEVER MakeRetriever ()
 
void InstallStandardLibrary (const std::string &aRootUrl)
 

Private Attributes

std::mutex m_mutex
 
std::map< std::string, RESPONSEm_responses
 
std::vector< std::string > m_requests
 

Detailed Description

In-process HTTP library server used by QA tests.

A server instance must outlive every HTTP_LIB_CONNECTION built from its MakeRetriever()

Definition at line 34 of file http_lib_fake_server.h.

Member Function Documentation

◆ InstallStandardLibrary()

void HTTP_LIB_FAKE_SERVER::InstallStandardLibrary ( const std::string & aRootUrl)

◆ MakeRetriever()

◆ RequestCount()

int HTTP_LIB_FAKE_SERVER::RequestCount ( const std::string & aUrl) const

Number of times aUrl has been requested.

Definition at line 32 of file http_lib_fake_server.cpp.

References m_mutex, and m_requests.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetResponse()

void HTTP_LIB_FAKE_SERVER::SetResponse ( const std::string & aUrl,
RESPONSE aResponse )

Member Data Documentation

◆ m_mutex

std::mutex HTTP_LIB_FAKE_SERVER::m_mutex
mutableprivate

Definition at line 54 of file http_lib_fake_server.h.

Referenced by MakeRetriever(), RequestCount(), and SetResponse().

◆ m_requests

std::vector<std::string> HTTP_LIB_FAKE_SERVER::m_requests
private

Definition at line 56 of file http_lib_fake_server.h.

Referenced by MakeRetriever(), and RequestCount().

◆ m_responses

std::map<std::string, RESPONSE> HTTP_LIB_FAKE_SERVER::m_responses
private

Definition at line 55 of file http_lib_fake_server.h.

Referenced by MakeRetriever(), and SetResponse().


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