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

Function TestReadData

IO/Engys/Testing/Cxx/TestBTSReader.cxx:145–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145int TestReadData(
146 const std::string& btsFile, const std::string& expectedDataFile, const std::string& tempDir)
147{
148 std::cout << "Testing: " << btsFile << std::endl;
149 vtkNew<vtkBTSReader> reader;
150 reader->SetFileName(btsFile.c_str());
151 reader->Update();
152 if (reader->GetErrorCode() != 0)
153 {
154 std::cerr << "Got an error when updating the reader: "
155 << vtkErrorCode::GetStringFromErrorCode(reader->GetErrorCode()) << std::endl;
156 return EXIT_FAILURE;
157 }
158 vtkPartitionedDataSet* pds = reader->GetOutput();
159
160 std::cout << "Comparing with: " << expectedDataFile << std::endl;
161 vtkNew<vtkXMLPartitionedDataSetReader> expectedDataReader;
162 expectedDataReader->SetFileName(expectedDataFile.c_str());
163 expectedDataReader->Update();
164 if (expectedDataReader->GetErrorCode() != 0)
165 {
166 std::cerr << "Got an error when updating the comparison reader: "
167 << vtkErrorCode::GetStringFromErrorCode(expectedDataReader->GetErrorCode())
168 << std::endl;
169 WriteDataToTemporary(pds, tempDir);
170 return EXIT_FAILURE;
171 }
172
173 vtkPartitionedDataSet* expectedPds =
174 vtkPartitionedDataSet::SafeDownCast(expectedDataReader->GetOutput());
175
176 if (TestPartitionedDataSet(pds, expectedPds, tempDir))
177 {
178 return EXIT_FAILURE;
179 }
180
181 return EXIT_SUCCESS;
182}
183
184int TestBTSReader(int argc, char* argv[])
185{

Callers 1

TestBTSReaderFunction · 0.85

Calls 6

WriteDataToTemporaryFunction · 0.85
TestPartitionedDataSetFunction · 0.70
SetFileNameMethod · 0.45
c_strMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected