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

Function test_delete_vector_elements

tests/basic/test-algorithm.cpp:62–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void test_delete_vector_elements()
63{
64 auto bool_vector = create_bool_vector();
65 const auto to_delete = bool_vector;
66 geode::delete_vector_elements( to_delete, bool_vector );
67 geode::OpenGeodeBasicException::test( bool_vector.size() == 3,
68 "Delete elements result (size) for bool is not correct" );
69 geode::OpenGeodeBasicException::test(
70 !bool_vector[0] & !bool_vector[1] & !bool_vector[2],
71 "Delete elements result (values) for bool is not correct" );
72
73 auto double_vector = create_double_vector();
74 geode::delete_vector_elements( to_delete, double_vector );
75 geode::OpenGeodeBasicException::test( double_vector.size() == 3,
76 "Delete elements result (size) for double is not correct" );
77 geode::OpenGeodeBasicException::test( ( double_vector[0] == 0.0 )
78 && ( double_vector[1] == 2.2 )
79 && ( double_vector[2] == 3.3 ),
80 "Delete elements result (values) for double is not correct" );
81
82 auto toto_vector = create_toto_vector();
83 geode::delete_vector_elements( to_delete, toto_vector );
84 geode::OpenGeodeBasicException::test( toto_vector.size() == 3,
85 "Delete elements result (size) for double is not correct" );
86 geode::OpenGeodeBasicException::test(
87 ( toto_vector[0].front().second == 0 )
88 && ( toto_vector[1].front().second == 2 )
89 && ( toto_vector[2].front().second == 3 ),
90 "Delete elements result (values) for double is not correct" );
91
92 auto totos_vector = create_totostruct_vector();
93 geode::delete_vector_elements( to_delete, totos_vector );
94 geode::OpenGeodeBasicException::test( totos_vector.size() == 3,
95 "Delete elements result (size) for double is not correct" );
96 geode::OpenGeodeBasicException::test(
97 ( totos_vector[0].front().titi == 0 )
98 && ( totos_vector[1].front().titi == 2 )
99 && ( totos_vector[2].front().titi == 3 ),
100 "Delete elements result (values) for double is not correct" );
101}
102
103void test_extract_vector_elements()
104{

Callers 1

testFunction · 0.85

Calls 7

create_bool_vectorFunction · 0.85
delete_vector_elementsFunction · 0.85
create_double_vectorFunction · 0.85
create_toto_vectorFunction · 0.85
create_totostruct_vectorFunction · 0.85
testFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected