With an empty settings folder, the default schemes should be loaded
| 117 | |
| 118 | // With an empty settings folder, the default schemes should be loaded |
| 119 | TEST_F(ColourSchemeTestWithEmptySettings, LoadDefaultSchemes) |
| 120 | { |
| 121 | auto defaultSchemeNames = { |
| 122 | SCHEME_DARKRADIANT_DEFAULT, |
| 123 | SCHEME_QE3, |
| 124 | SCHEME_BLACK_AND_GREEN, |
| 125 | SCHEME_MAYA_MAX, |
| 126 | SCHEME_SUPER_MAL |
| 127 | }; |
| 128 | |
| 129 | // Check the default colours.xml file |
| 130 | std::string defaultColoursFile = _context.getRuntimeDataPath() + "colours.xml"; |
| 131 | EXPECT_TRUE(fs::exists(defaultColoursFile)) << "Could not find factory colours file: " << defaultColoursFile; |
| 132 | |
| 133 | for (auto name : defaultSchemeNames) |
| 134 | { |
| 135 | EXPECT_TRUE(GlobalColourSchemeManager().schemeExists(name)) << "Scheme " << name << " not found"; |
| 136 | |
| 137 | auto defaultScheme = loadSchemeFromXml(name, defaultColoursFile); |
| 138 | auto& loadedScheme = GlobalColourSchemeManager().getColourScheme(name); |
| 139 | |
| 140 | // Number of items must match |
| 141 | EXPECT_EQ(defaultScheme.size(), getItemCountInScheme(loadedScheme)); |
| 142 | |
| 143 | // Each item must match |
| 144 | for (const auto& defaultColour : defaultScheme) |
| 145 | { |
| 146 | EXPECT_EQ(loadedScheme.getColour(defaultColour.first).getColour(), defaultColour.second) |
| 147 | << "Scheme " << name << ": colour " << defaultColour.first |
| 148 | << " doesn't match the default value " << defaultColour.second; |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | TEST_F(ColourSchemeTestWithEmptySettings, DefaultSchemeIsActive) |
| 154 | { |
nothing calls this directly
no test coverage detected