MCPcopy Create free account
hub / github.com/Kitware/VTK / TestModifiedTime

Function TestModifiedTime

Filters/Temporal/Testing/Cxx/TestDataObjectMeshCache.cxx:145–192  ·  view source on GitHub ↗

------------------------------------------------------------------------------ * Check impact of consumer and mesh time on the cache status. */

Source from the content-addressed store, hash-verified

143 * Check impact of consumer and mesh time on the cache status.
144 */
145bool TestModifiedTime(TestPipelineInterface* pipeline)
146{
147 vtkNew<vtkDataObjectMeshCache> cache;
148
149 pipeline->InitializeCache(cache);
150
151 vtkDataObjectMeshCache::Status expected;
152 expected.OriginalDataDefined = true;
153 expected.ConsumerDefined = true;
154 expected.CacheDefined = true;
155 expected.OriginalMeshUnmodified = true;
156 expected.ConsumerUnmodified = true;
157 expected.AttributesIdsExists = true;
158
159 vtkDataObjectMeshCache::Status status = cache->GetStatus();
160 vtkLogIf(ERROR, !status.enabled(), "ModifiedTime: expect usable cache.");
161
162 pipeline->UpdateInputData(details::modifiedData[0]);
163 status = cache->GetStatus();
164 vtkLogIf(ERROR, status != expected, "ModifiedTime: error data mtime should not interfere.");
165 vtkLogIf(ERROR, !status.enabled(), "ModifedTime: expect valid cache.");
166
167 pipeline->MarkConsumerModified();
168 status = cache->GetStatus();
169 expected.ConsumerUnmodified = false;
170 vtkLogIf(ERROR, status != expected, "ModifiedTime: error with consumer mtime.");
171 vtkLogIf(ERROR, status.enabled(), "ModifedTime: expect invalid cache.");
172
173 cache->UpdateCache(pipeline->GetFilterOutputData());
174 status = cache->GetStatus();
175 expected.ConsumerUnmodified = true;
176 vtkLogIf(ERROR, status != expected, "ModifiedTime: error when resetting consumer mtime.");
177 vtkLogIf(ERROR, !status.enabled(), "ModifedTime: expect usable cache.");
178
179 pipeline->MarkInputMeshModified();
180 status = cache->GetStatus();
181 expected.OriginalMeshUnmodified = false;
182 vtkLogIf(ERROR, status != expected, "ModifiedTime: error with input mtime.");
183 vtkLogIf(ERROR, status.enabled(), "ModifiedTime: expect invalid cache.");
184
185 cache->UpdateCache(pipeline->GetFilterOutputData());
186 status = cache->GetStatus();
187 expected.OriginalMeshUnmodified = true;
188 vtkLogIf(ERROR, status != expected, "ModifiedTime: error when resetting consumer mtime.");
189 vtkLogIf(ERROR, !status.enabled(), "ModifedTime: expect usable cache.");
190
191 return true;
192}
193
194//------------------------------------------------------------------------------
195/**

Callers 1

TestDataObjectMeshCacheFunction · 0.85

Calls 8

InitializeCacheMethod · 0.80
GetStatusMethod · 0.80
enabledMethod · 0.80
UpdateInputDataMethod · 0.80
MarkConsumerModifiedMethod · 0.80
GetFilterOutputDataMethod · 0.80
MarkInputMeshModifiedMethod · 0.80
UpdateCacheMethod · 0.45

Tested by

no test coverage detected