#include #include #include #include #include "infrastructure/settings/profilemanager.h" namespace { bool createsPhysicalFilesForEmptyProfiles() { QTemporaryDir directory; ProfileManager manager(directory.path()); if (!manager.activeProfile().isEmpty() || !QFileInfo::exists(manager.profilePath("")) || !manager.setActiveProfile("")) { qCritical() << "default profile file was not created"; return false; } const QString profileId = manager.createProfile("empty"); if (profileId != "empty" || !QFileInfo::exists(manager.profilePath(profileId)) || !manager.listProfiles().contains(profileId) || !manager.setActiveProfile(profileId)) { qCritical() << "empty named profile file was not created"; return false; } return true; } } int main(int argc, char *argv[]) { QCoreApplication application(argc, argv); return createsPhysicalFilesForEmptyProfiles() ? 0 : 1; }