MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testHasBasicTools

Method testHasBasicTools

tests/toolmanagertest.cpp:145–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144private:
145 static void testHasBasicTools(bool actionInspectorEnabled)
146 {
147 bool hasBasicTools = false;
148 const ToolInfo *actionInspector = nullptr;
149 const ToolInfo *guiSupport = nullptr;
150 foreach (const ToolInfo &tool, ClientToolManager::instance()->tools()) {
151 if (tool.id() == "GammaRay::ObjectInspector")
152 hasBasicTools = true;
153 else if (tool.id() == "gammaray_actioninspector")
154 actionInspector = &tool;
155 else if (tool.id() == "gammaray_guisupport")
156 guiSupport = &tool;
157 }
158 QVERIFY(hasBasicTools);
159 QVERIFY(actionInspector);
160 // NOLINTNEXTLINE (clang-analyzer-core.CallAndMessage)
161 QCOMPARE(actionInspector->isEnabled(), actionInspectorEnabled);
162 QCOMPARE(actionInspector->hasUi(), true);
163 QVERIFY(!guiSupport); // tools without ui are supposed to be filtered out
164 QVERIFY(!ClientToolManager::instance()->widgetForId("inexistantTool"));
165 QVERIFY(actionInspectorEnabled == ( bool )ClientToolManager::instance()->widgetForId("gammaray_actioninspector")); // if tool is disabled we explicitly want widgetForId to be null.
166 }
167
168 void testToolEnabled()
169 {

Callers

nothing calls this directly

Calls 3

hasUiMethod · 0.80
widgetForIdMethod · 0.80
isEnabledMethod · 0.45

Tested by

no test coverage detected