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

Function test_compare_section

tests/model/test-section.cpp:859–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859void test_compare_section(
860 const geode::Section& model, const geode::Section& model2 )
861{
862 geode::OpenGeodeModelException::test(
863 model.nb_corners() == model2.nb_corners(),
864 "Number of Corners in reloaded Model should be ", model.nb_corners() );
865 geode::OpenGeodeModelException::test( model.nb_lines() == model2.nb_lines(),
866 "Number of Lines in reloaded Model should be ", model.nb_lines() );
867 geode::OpenGeodeModelException::test(
868 model.nb_surfaces() == model2.nb_surfaces(),
869 "Number of Surfaces in reloaded Model should be ",
870 model.nb_surfaces() );
871 geode::OpenGeodeModelException::test(
872 model.nb_model_boundaries() == model2.nb_model_boundaries(),
873 "Number of Boundaries in reloaded Model should be ",
874 model.nb_model_boundaries() );
875 geode::OpenGeodeModelException::test(
876 model.nb_corner_collections() == model2.nb_corner_collections(),
877 "Number of CornerCollections in reloaded Model should be ",
878 model.nb_corner_collections() );
879 geode::OpenGeodeModelException::test(
880 model.nb_line_collections() == model2.nb_line_collections(),
881 "Number of LineCollections in reloaded Model should be ",
882 model.nb_line_collections() );
883 geode::OpenGeodeModelException::test(
884 model.nb_surface_collections() == model2.nb_surface_collections(),
885 "Number of SurfaceCollections in reloaded Model should be ",
886 model.nb_surface_collections() );
887 for( const auto& surface : model.surfaces() )
888 {
889 geode::OpenGeodeModelException::test(
890 surface.id() == surface.mesh().id(),
891 "[Backward_IO] Model surface should have the same uuid as its "
892 "mesh." );
893 const auto& mesh = surface.mesh();
894 const auto& mesh2 = model2.surface( surface.id() ).mesh();
895 for( const auto vertex_id : geode::Range{ mesh.nb_vertices() } )
896 {
897 geode::OpenGeodeModelException::test(
898 mesh.point( vertex_id )
899 .inexact_equal( mesh2.point( vertex_id ) ),
900 "Wrong reloaded mesh point coordinates." );
901 }
902 }
903 for( const auto& line : model.lines() )
904 {
905 geode::OpenGeodeModelException::test( line.id() == line.mesh().id(),
906 "[Backward_IO] Model line should have the same uuid as its "
907 "mesh." );
908 const auto& mesh = line.mesh();
909 const auto& mesh2 = model2.line( line.id() ).mesh();
910 for( const auto vertex_id : geode::Range{ mesh.nb_vertices() } )
911 {
912 geode::OpenGeodeModelException::test(
913 mesh.point( vertex_id )
914 .inexact_equal( mesh2.point( vertex_id ) ),
915 "Wrong reloaded mesh point coordinates." );
916 }

Callers 1

testFunction · 0.85

Calls 15

nb_cornersMethod · 0.80
nb_linesMethod · 0.80
nb_surfacesMethod · 0.80
nb_model_boundariesMethod · 0.80
nb_corner_collectionsMethod · 0.80
nb_line_collectionsMethod · 0.80
surfacesMethod · 0.80
linesMethod · 0.80
cornersMethod · 0.80
testFunction · 0.70
meshMethod · 0.45

Tested by

no test coverage detected