MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / test_correctness

Method test_correctness

ogsr_engine/xrGame/space_restriction_composition.cpp:141–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140#ifdef DEBUG
141void CSpaceRestrictionComposition::test_correctness()
142{
143 m_correct = true;
144 m_test_storage.clear();
145
146 {
147 RESTRICTIONS::iterator I = m_restrictions.begin();
148 RESTRICTIONS::iterator E = m_restrictions.end();
149 for (; I != E; ++I)
150 m_test_storage.insert(m_test_storage.end(), (*I)->object().m_test_storage.begin(), (*I)->object().m_test_storage.end());
151 }
152
153 {
154 std::sort(m_test_storage.begin(), m_test_storage.end());
155 m_test_storage.erase(std::unique(m_test_storage.begin(), m_test_storage.end()), m_test_storage.end());
156 }
157
158 if (m_test_storage.empty())
159 {
160 m_correct = false;
161 return;
162 }
163
164 xr_vector<u32> nodes;
165 {
166 RESTRICTIONS::iterator I = m_restrictions.begin();
167 RESTRICTIONS::iterator E = m_restrictions.end();
168 for (; I != E; ++I)
169 {
170 VERIFY3(!(*I)->object().m_test_storage.empty(), "Restrictor has no border", *(*I)->object().name());
171 nodes.clear();
172 ai().level_graph().set_mask(border());
173 ai().graph_engine().search(ai().level_graph(), (*I)->object().m_test_storage.back(), (*I)->object().m_test_storage.back(), &nodes, GraphEngineSpace::CFlooder());
174 ai().level_graph().clear_mask(border());
175
176 if (nodes.size() == 65535)
177 m_correct = true;
178 else
179 m_correct = (m_test_storage.size() <= nodes.size());
180
181 if (!m_correct)
182 break;
183 }
184 }
185}
186#endif
187
188Fsphere CSpaceRestrictionComposition::sphere() const

Callers

nothing calls this directly

Calls 14

set_maskMethod · 0.80
clear_maskMethod · 0.80
sortFunction · 0.50
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
objectMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45
nameMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected