Commit c945750b11bee24bb36886b86f88623e9caf9e71
[Autotest] Rather than hardcoding the number of default search
engines, use the number of files in the :/searchengines/ directory.
This way the autotest will not need to be updated in the future in
case we have new search engines in our default set.
| |   |
| 51 | 51 | { |
| 52 | 52 | return OpenSearchManager::generateEngineFileName(engineName); |
| 53 | 53 | } |
|
| static int defaultCount() |
| { |
| return QDir(":/searchengines/").count(); |
| } |
| 54 | 59 | }; |
| 55 | 60 | |
| 56 | 61 | // This will be called before the first test function is executed. |
| … | … | |
| 208 | 208 | |
| 209 | 209 | QCOMPARE(manager.enginesCount(), 1); |
| 210 | 210 | manager.restoreDefaults(); |
| QCOMPARE(manager.enginesCount(), 5); |
| QCOMPARE(manager.enginesCount(), manager.defaultCount()); |
| 212 | 212 | |
| 213 | 213 | foreach (const QString &name, manager.allEnginesNames()) { |
| 214 | 214 | manager.removeEngine(name); |
| … | … | |
| 223 | 223 | |
| 224 | 224 | manager.addEngine(engine); |
| 225 | 225 | manager.restoreDefaults(); |
| QCOMPARE(manager.enginesCount(), 6); |
| QCOMPARE(manager.enginesCount(), manager.defaultCount() + 1); |
| 227 | 227 | |
| 228 | 228 | manager.removeEngine(engine->name()); |
| 229 | 229 | |