MCPcopy Create free account
hub / github.com/MITK/MITK / testInvalidResource

Function testInvalidResource

Modules/CppMicroServices/test/usModuleResourceTest.cpp:142–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void testInvalidResource(Module* module)
143{
144 ModuleResource res = module->GetResource("invalid");
145 US_TEST_CONDITION_REQUIRED(res.IsValid() == false, "Check invalid resource")
146 US_TEST_CONDITION(res.GetName().empty(), "Check empty name")
147 US_TEST_CONDITION(res.GetPath().empty(), "Check empty path")
148 US_TEST_CONDITION(res.GetResourcePath().empty(), "Check empty resource path")
149 US_TEST_CONDITION(res.GetBaseName().empty(), "Check empty base name")
150 US_TEST_CONDITION(res.GetCompleteBaseName().empty(), "Check empty complete base name")
151 US_TEST_CONDITION(res.GetSuffix().empty(), "Check empty suffix")
152
153 US_TEST_CONDITION(res.GetChildren().empty(), "Check empty children")
154 US_TEST_CONDITION(res.GetSize() == 0, "Check zero size")
155
156 ModuleResourceStream rs(res);
157 US_TEST_CONDITION(rs.good() == true, "Check invalid resource stream")
158 rs.ignore();
159 US_TEST_CONDITION(rs.good() == false, "Check invalid resource stream")
160 US_TEST_CONDITION(rs.eof() == true, "Check invalid resource stream")
161}
162
163void testSpecialCharacters(Module* module)
164{

Callers 1

usModuleResourceTestFunction · 0.85

Calls 11

GetResourceMethod · 0.80
GetResourcePathMethod · 0.80
GetBaseNameMethod · 0.80
GetCompleteBaseNameMethod · 0.80
IsValidMethod · 0.45
emptyMethod · 0.45
GetNameMethod · 0.45
GetPathMethod · 0.45
GetSuffixMethod · 0.45
GetChildrenMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected