| 121 | } |
| 122 | |
| 123 | void themeManagerCRUD() { |
| 124 | auto& tm = ThemeManager::instance(); |
| 125 | int initialCount = tm.themes().size(); |
| 126 | |
| 127 | // Add |
| 128 | Theme custom = tm.themes()[0]; |
| 129 | custom.name = "Test Custom"; |
| 130 | custom.background = QColor("#ff0000"); |
| 131 | tm.addTheme(custom); |
| 132 | QCOMPARE(tm.themes().size(), initialCount + 1); |
| 133 | QCOMPARE(tm.themes().last().name, QString("Test Custom")); |
| 134 | |
| 135 | // Update |
| 136 | int idx = tm.themes().size() - 1; |
| 137 | Theme updated = custom; |
| 138 | updated.background = QColor("#00ff00"); |
| 139 | tm.updateTheme(idx, updated); |
| 140 | QCOMPARE(tm.themes()[idx].background, QColor("#00ff00")); |
| 141 | |
| 142 | // Remove |
| 143 | tm.removeTheme(idx); |
| 144 | QCOMPARE(tm.themes().size(), initialCount); |
| 145 | } |
| 146 | }; |
| 147 | |
| 148 | QTEST_MAIN(TestTheme) |
nothing calls this directly
no test coverage detected