|
KiCad PCB EDA Suite
|
#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" |
| BOOST_AUTO_TEST_CASE | ( | CheckLibraryDoesNotEnumerateParts | ) |
Definition at line 162 of file test_http_lib_plugin.cpp.
References BOOST_CHECK_EQUAL(), SCH_IO_HTTP_LIB::CheckLibrary(), httpLibSettingsPath(), HTTP_PLUGIN_HARNESS::plugin, HTTP_LIB_FAKE_SERVER::RequestCount(), RootUrl, and HTTP_PLUGIN_HARNESS::server.
| 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 | ( | EnumerateSymbolLibListsAllParts | ) |
Definition at line 79 of file test_http_lib_plugin.cpp.
References SCH_IO_HTTP_LIB::EnumerateSymbolLib(), httpLibSettingsPath(), HTTP_PLUGIN_HARNESS::plugin, HTTP_LIB_FAKE_SERVER::RequestCount(), RootUrl, and HTTP_PLUGIN_HARNESS::server.
| BOOST_AUTO_TEST_CASE | ( | EnumerateSymbolLibMaterializesFields | ) |
Definition at line 97 of file test_http_lib_plugin.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), LIB_SYMBOL::GetDescription(), LIB_SYMBOL::GetFootprintField(), SCH_FIELD::GetText(), LIB_SYMBOL::GetValueField(), httpLibSettingsPath(), and HTTP_PLUGIN_HARNESS::plugin.
| 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 | ( | 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 | ( | LoadSymbolReturnsMaterializedPart | ) |
Definition at line 144 of file test_http_lib_plugin.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::CheckLibrary(), LIB_SYMBOL::GetFootprintField(), SCH_FIELD::GetText(), LIB_SYMBOL::GetValueField(), httpLibSettingsPath(), SCH_IO_HTTP_LIB::LoadSymbol(), and HTTP_PLUGIN_HARNESS::plugin.
| BOOST_AUTO_TEST_CASE | ( | MetadataChangeRematerializes | ) |
Definition at line 200 of file test_http_lib_plugin.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), SCH_IO_HTTP_LIB::GetModifyHash(), SCH_FIELD::GetText(), LIB_SYMBOL::GetValueField(), httpLibSettingsPath(), SCH_IO_HTTP_LIB::LoadSymbol(), HTTP_PLUGIN_HARNESS::plugin, RootUrl, HTTP_PLUGIN_HARNESS::server, HTTP_LIB_FAKE_SERVER::SetResponse(), and useFastCacheLifetimes().
| BOOST_AUTO_TEST_CASE | ( | SubLibrariesExposeCategories | ) |
Definition at line 124 of file test_http_lib_plugin.cpp.
References BOOST_CHECK_EQUAL(), SCH_IO_HTTP_LIB::CheckLibrary(), SCH_IO_HTTP_LIB::GetSubLibraryDescription(), SCH_IO_HTTP_LIB::GetSubLibraryNames(), httpLibSettingsPath(), and HTTP_PLUGIN_HARNESS::plugin.
|
static |
Definition at line 43 of file test_http_lib_plugin.cpp.
References KI_TEST::GetEeschemaTestDataDir(), httpLibSettingsPath(), and SettingsFile.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and httpLibSettingsPath().
|
static |
Definition at line 49 of file test_http_lib_plugin.cpp.
References SCH_IO_HTTP_LIB::SetSourcePatcher(), HTTP_LIB_SOURCE::timeout_categories, and HTTP_LIB_SOURCE::timeout_parts.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 39 of file test_http_lib_plugin.cpp.
Referenced by HTTP_PLUGIN_HARNESS::HTTP_PLUGIN_HARNESS().
|
static |
Definition at line 40 of file test_http_lib_plugin.cpp.
Referenced by httpLibSettingsPath().