MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_copy_mapping

Function test_copy_mapping

tests/model/test-model-mapping.cpp:36–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include <geode/tests/common.hpp>
35
36void test_copy_mapping()
37{
38 geode::ModelCopyMapping copy_mapping;
39
40 std::vector< geode::uuid > uuids_in( 3 );
41 std::vector< geode::uuid > uuids_out( 3 );
42
43 geode::BijectiveMapping< geode::uuid > corner_mapping;
44 for( const auto i : geode::LRange{ 3 } )
45 {
46 corner_mapping.map( uuids_in[i], uuids_out[i] );
47 }
48 copy_mapping.emplace(
49 geode::Corner3D::component_type_static(), std::move( corner_mapping ) );
50 geode::OpenGeodeModelException::test(
51 !copy_mapping.has_mapping_type(
52 geode::Surface3D::component_type_static() ),
53 "Copy mappings should not exist for Surfaces" );
54 geode::OpenGeodeModelException::test(
55 copy_mapping.has_mapping_type(
56 geode::Corner3D::component_type_static() ),
57 "Copy mappings should exist for Corners" );
58 const auto& corner_copy_mappings =
59 copy_mapping.at( geode::Corner3D::component_type_static() );
60 geode::OpenGeodeModelException::test( corner_copy_mappings.size() == 3,
61 "Wrong size for CopyMapping Corners" );
62 for( const auto i : geode::LRange{ 3 } )
63 {
64 geode::OpenGeodeModelException::test(
65 corner_copy_mappings.in2out( uuids_in[i] ) == uuids_out[i],
66 "Wrong mapping for CopyMapping Corners" );
67 }
68}
69
70void test_generic_mapping()
71{

Callers 1

testFunction · 0.85

Calls 6

emplaceMethod · 0.80
has_mapping_typeMethod · 0.80
atMethod · 0.80
testFunction · 0.70
mapMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected