KiCad PCB EDA Suite
Loading...
Searching...
No Matches
api_test_utils.h File Reference
#include <boost/test/unit_test.hpp>
#include <boost/bimap.hpp>
#include <google/protobuf/any.pb.h>
#include <memory>
#include <set>
#include <magic_enum.hpp>
#include <type_traits>
#include <unordered_set>
#include <api/api_enums.h>
#include <eda_group.h>
#include <eda_item.h>
#include <qa_utils/wx_utils/wx_assert.h>

Go to the source code of this file.

Functions

template<typename KiCadEnum, typename ProtoEnum>
void testEnums (bool aPartiallyMapped=false, std::optional< KiCadEnum > aNullMapping=std::nullopt)
 Checks if a KiCad enum has been properly mapped to a Protobuf enum.
 
template<typename ProtoClass, typename KiCadClass, typename Factory>
void testProtoFromKiCadObject (KiCadClass *aInput, Factory &&aCreateOutput)
 
template<typename ProtoClass, typename KiCadClass, typename ParentClass>
void testProtoFromKiCadObject (KiCadClass *aInput, ParentClass *aParent, bool aStrict=true)
 

Function Documentation

◆ testEnums()

template<typename KiCadEnum, typename ProtoEnum>
void testEnums ( bool aPartiallyMapped = false,
std::optional< KiCadEnum > aNullMapping = std::nullopt )

Checks if a KiCad enum has been properly mapped to a Protobuf enum.

Template Parameters
KiCadEnumis an enum type
ProtoEnumis a Protobuf enum type
Parameters
aPartiallyMappedis true if only some of the KiCad enum values are exposed to the API
aNullMappingcan be used to specify that the null proto enum should map to a real KiCad value

Definition at line 47 of file api_test_utils.h.

References BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), FromProtoEnum(), name, result, roundTrip(), and ToProtoEnum().

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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ testProtoFromKiCadObject() [1/2]

template<typename ProtoClass, typename KiCadClass, typename Factory>
void testProtoFromKiCadObject ( KiCadClass * aInput,
Factory && aCreateOutput )

◆ testProtoFromKiCadObject() [2/2]

template<typename ProtoClass, typename KiCadClass, typename ParentClass>
void testProtoFromKiCadObject ( KiCadClass * aInput,
ParentClass * aParent,
bool aStrict = true )

Definition at line 177 of file api_test_utils.h.

References testProtoFromKiCadObject().