[apps] GlobalPreferences: add an assertion to ensure the the fetched

exam mode can be casted in GlobalPreferences::ExamMode
This commit is contained in:
Émilie Feral
2019-12-19 15:18:03 +01:00
committed by LeaNumworks
parent 425f0cb459
commit 902cc64d32

View File

@@ -7,7 +7,9 @@ GlobalPreferences * GlobalPreferences::sharedGlobalPreferences() {
GlobalPreferences::ExamMode GlobalPreferences::examMode() const {
if (m_examMode == ExamMode::Unknown) {
m_examMode = (ExamMode)Ion::ExamMode::FetchExamMode();
uint8_t mode = Ion::ExamMode::FetchExamMode();
assert(mode >= 0 && mode < 3); // mode can be cast in ExamMode (Off, Standard or Dutch)
m_examMode = (ExamMode)mode;
}
return m_examMode;
}