KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_json_schema_validator.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <json_schema_validator.h>
#include <remote_provider_utils.h>
#include <atomic>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (PcmSchemasLoadWithoutThrowing)
 CreatePCM() builds these on every project open, where a throw is fatal with the CLR loaded.
 
 BOOST_AUTO_TEST_CASE (PcmPackageRefsResolve)
 Package reaches Contact through $ref, so the verdict only lands if that reference resolved.
 
 BOOST_AUTO_TEST_CASE (BothDefinitionContainersResolve)
 Draft 2019-09 renamed "definitions" to "$defs", so a schema part way through that migration carries both and either name has to work as an initial URI.
 
validator set_root_schema (schema)
 
 for (const std::string &fragment :{ "#/$defs/Modern", "#/definitions/Legacy" })
 

Variables

nlohmann::json_schema::json_validator validator
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( BothDefinitionContainersResolve )

Draft 2019-09 renamed "definitions" to "$defs", so a schema part way through that migration carries both and either name has to work as an initial URI.

Definition at line 192 of file test_json_schema_validator.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( PcmPackageRefsResolve )

Package reaches Contact through $ref, so the verdict only lands if that reference resolved.

Definition at line 169 of file test_json_schema_validator.cpp.

References COLLECTING_JSON_ERROR_HANDLER::HasErrors(), and validator.

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( PcmSchemasLoadWithoutThrowing )

CreatePCM() builds these on every project open, where a throw is fatal with the CLR loaded.

Definition at line 146 of file test_json_schema_validator.cpp.

References BOOST_AUTO_TEST_CASE(), name, and validator.

◆ for()

for ( const std::string &fragment :{ "#/$defs/Modern", "#/definitions/Legacy" } )

Definition at line 203 of file test_json_schema_validator.cpp.

◆ set_root_schema()

validator set_root_schema ( schema )

References validator.

Variable Documentation

◆ validator