------------------------------------------------------------------------------ * Check impact of consumer and mesh time on the cache status. */
| 143 | * Check impact of consumer and mesh time on the cache status. |
| 144 | */ |
| 145 | bool 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 | /** |
no test coverage detected