KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_http_lib_plugin.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <chrono>
#include <thread>
#include <http_lib/http_lib_connection.h>
#include <libraries/library_manager.h>
#include <libraries/symbol_library_adapter.h>
#include <lib_symbol.h>
#include <sch_io/http_lib/sch_io_http_lib.h>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include "http_lib_fake_server.h"

Go to the source code of this file.

Classes

struct  HTTP_PLUGIN_HARNESS
 

Functions

static wxString httpLibSettingsPath ()
 
static void useFastCacheLifetimes (SCH_IO_HTTP_LIB &aPlugin)
 
 BOOST_AUTO_TEST_CASE (EnumerateSymbolLibListsAllParts)
 
 BOOST_AUTO_TEST_CASE (EnumerateSymbolLibMaterializesFields)
 
 BOOST_AUTO_TEST_CASE (SubLibrariesExposeCategories)
 
 BOOST_AUTO_TEST_CASE (LoadSymbolReturnsMaterializedPart)
 
 BOOST_AUTO_TEST_CASE (CheckLibraryDoesNotEnumerateParts)
 
 BOOST_AUTO_TEST_CASE (IdenticalMetadataDoesNotRematerialize)
 Re-querying with unchanged server data must not re-materialize the symbol cache.
 
 BOOST_AUTO_TEST_CASE (MetadataChangeRematerializes)
 
 BOOST_AUTO_TEST_CASE (ListingDescriptionSurvivesDetailWithoutDescription)
 A detail record that omits the top-level "description" must not erase the description the category listing provided.
 
 BOOST_AUTO_TEST_CASE (DescriptionFieldNotClobberedByEmptySummary)
 A "description" entry inside fields must not be blanked by an empty top-level description in the same detail record.
 

Variables

static const std::string RootUrl = "http://fake.test/v1/"
 
static const std::string SettingsFile = "test_http_lib.kicad_httplib"
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/9]

◆ BOOST_AUTO_TEST_CASE() [2/9]

BOOST_AUTO_TEST_CASE ( DescriptionFieldNotClobberedByEmptySummary )

A "description" entry inside fields must not be blanked by an empty top-level description in the same detail record.

Definition at line 282 of file test_http_lib_plugin.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), LIB_SYMBOL::GetDescription(), httpLibSettingsPath(), HTTP_PLUGIN_HARNESS::plugin, RootUrl, HTTP_PLUGIN_HARNESS::server, and HTTP_LIB_FAKE_SERVER::SetResponse().

◆ BOOST_AUTO_TEST_CASE() [3/9]

◆ BOOST_AUTO_TEST_CASE() [4/9]

◆ BOOST_AUTO_TEST_CASE() [5/9]

BOOST_AUTO_TEST_CASE ( IdenticalMetadataDoesNotRematerialize )

Re-querying with unchanged server data must not re-materialize the symbol cache.

Definition at line 177 of file test_http_lib_plugin.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), SCH_IO_HTTP_LIB::GetModifyHash(), httpLibSettingsPath(), HTTP_PLUGIN_HARNESS::plugin, and useFastCacheLifetimes().

◆ BOOST_AUTO_TEST_CASE() [6/9]

BOOST_AUTO_TEST_CASE ( ListingDescriptionSurvivesDetailWithoutDescription )

A detail record that omits the top-level "description" must not erase the description the category listing provided.

Definition at line 245 of file test_http_lib_plugin.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), LIB_SYMBOL::GetDescription(), httpLibSettingsPath(), HTTP_PLUGIN_HARNESS::plugin, RootUrl, HTTP_PLUGIN_HARNESS::server, and HTTP_LIB_FAKE_SERVER::SetResponse().

◆ BOOST_AUTO_TEST_CASE() [7/9]

◆ BOOST_AUTO_TEST_CASE() [8/9]

◆ BOOST_AUTO_TEST_CASE() [9/9]

◆ httpLibSettingsPath()

◆ useFastCacheLifetimes()

static void useFastCacheLifetimes ( SCH_IO_HTTP_LIB & aPlugin)
static

Variable Documentation

◆ RootUrl

const std::string RootUrl = "http://fake.test/v1/"
static

Definition at line 39 of file test_http_lib_plugin.cpp.

Referenced by HTTP_PLUGIN_HARNESS::HTTP_PLUGIN_HARNESS().

◆ SettingsFile

const std::string SettingsFile = "test_http_lib.kicad_httplib"
static

Definition at line 40 of file test_http_lib_plugin.cpp.

Referenced by httpLibSettingsPath().