MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testPathMatcherIteratorPrune

Function testPathMatcherIteratorPrune

src/IECorePython/PathMatcherBinding.cpp:99–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void testPathMatcherIteratorPrune()
100{
101 vector<InternedString> root;
102 vector<InternedString> abc = { "a", "b", "c" };
103
104 // Prune an empty iterator range.
105 PathMatcher m;
106 PathMatcher::Iterator it = m.begin();
107 IECORETEST_ASSERT( it == m.end() );
108 it.prune();
109 IECORETEST_ASSERT( it == m.end() );
110
111 // Prune the root iterator itself.
112 m.addPath( root );
113 it = m.begin();
114 IECORETEST_ASSERT( *it == root );
115 IECORETEST_ASSERT( it != m.end() );
116 it.prune();
117 IECORETEST_ASSERT( *it == root );
118 IECORETEST_ASSERT( it != m.end() );
119 ++it;
120 IECORETEST_ASSERT( it == m.end() );
121
122 // As above, but actually with some
123 // descendants to be pruned.
124 m.addPath( abc );
125 it = m.begin();
126 IECORETEST_ASSERT( *it == root );
127 IECORETEST_ASSERT( it != m.end() );
128 it.prune();
129 IECORETEST_ASSERT( *it == root );
130 IECORETEST_ASSERT( it != m.end() );
131 ++it;
132 IECORETEST_ASSERT( it == m.end() );
133
134}
135
136void testPathMatcherFind()
137{

Callers

nothing calls this directly

Calls 4

pruneMethod · 0.80
addPathMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected