MCPcopy Create free account
hub / github.com/FlightGear/flightgear / findActualRoot

Method findActualRoot

3rdparty/cppunit/src/cppunit/TestPath.cpp:207–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207Test *
208TestPath::findActualRoot( Test *searchRoot,
209 const std::string &pathAsString,
210 PathTestNames &testNames )
211{
212 bool isRelative = splitPathString( pathAsString, testNames );
213
214 if ( isRelative && pathAsString.empty() )
215 return searchRoot;
216
217 if ( testNames.empty() )
218 throw std::invalid_argument( "TestPath::TestPath(): invalid root or root name in absolute path" );
219
220 Test *root = isRelative ? searchRoot->findTest( testNames[0] ) // throw if bad test name
221 : searchRoot;
222 if ( root->getName() != testNames[0] )
223 throw std::invalid_argument( "TestPath::TestPath(): searchRoot does not match path root name" );
224
225 return root;
226}
227
228
229bool

Callers

nothing calls this directly

Calls 3

findTestMethod · 0.80
emptyMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected