| 143 | |
| 144 | private: |
| 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 | { |
nothing calls this directly
no test coverage detected