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

Function TestFieldData

Parallel/Core/Testing/Cxx/TestFieldDataSerialization.cxx:211–244  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

209
210//------------------------------------------------------------------------------
211int TestFieldData()
212{
213 int rc = 0;
214
215 vtkPointData* field = GetSamplePointData(5);
216 assert("pre: field is nullptr!" && (field != nullptr));
217
218 vtkMultiProcessStream bytestream;
219 vtkFieldDataSerializer::Serialize(field, bytestream);
220 if (bytestream.Empty())
221 {
222 std::cerr << "ERROR: failed to serialize field data, bytestream is empty!\n";
223 rc++;
224 return (rc);
225 }
226
227 vtkPointData* field2 = vtkPointData::New();
228 vtkFieldDataSerializer::Deserialize(bytestream, field2);
229 if (!vtkTestUtilities::CompareFieldData(field, field2))
230 {
231 std::cerr << "ERROR: fields are not equal!\n";
232 rc++;
233 return (rc);
234 }
235 else
236 {
237 std::cout << "Fields are equal!\n";
238 std::cout.flush();
239 }
240
241 field->Delete();
242 field2->Delete();
243 return (rc);
244}
245
246//------------------------------------------------------------------------------
247int TestFieldDataSerialization(int argc, char* argv[])

Callers 1

Calls 6

GetSamplePointDataFunction · 0.85
DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
EmptyMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected