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

Method GetValidImageFileName

Testing/Rendering/vtkTesting.cxx:233–266  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

231}
232//------------------------------------------------------------------------------
233const char* vtkTesting::GetValidImageFileName()
234{
235 this->SetValidImageFileName(nullptr);
236 if (!this->IsValidImageSpecified())
237 {
238 return this->ValidImageFileName;
239 }
240
241 string baseline =
242 vtkTestingGetArgOrEnvOrDefault("-B", this->Args, "VTK_BASELINE_ROOT", this->GetDataRoot());
243
244 for (size_t i = 0; i < (this->Args.size() - 1); ++i)
245 {
246 if (this->Args[i] == "-V")
247 {
248 const char* ch = this->Args[i + 1].c_str();
249 if (ch[0] == '/'
250#if defined(_WIN32) || \
251 defined(__EMSCRIPTEN__) // Emscripten too, because the file could be on a windows server.
252 || (ch[0] >= 'a' && ch[0] <= 'z' && ch[1] == ':') ||
253 (ch[0] >= 'A' && ch[0] <= 'Z' && ch[1] == ':')
254#endif
255 )
256 {
257 baseline = this->Args[i + 1];
258 }
259 else
260 {
261 baseline += "/";
262 baseline += this->Args[i + 1];
263 }
264 break;
265 }
266 }
267
268 this->SetValidImageFileName(baseline.c_str());
269

Calls 5

IsValidImageSpecifiedMethod · 0.95
GetDataRootMethod · 0.95
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected