update rule consistency
This commit is contained in:
parent
6aa8d3e5b6
commit
5b6554352e
@ -184,6 +184,12 @@ bool Rule::isConsistent() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if this rules is based on any time events and contains exit actions
|
||||
if (!timeDescriptor().timeEventItems().isEmpty() && !exitActions().isEmpty()) {
|
||||
qCWarning(dcRuleEngine) << "Rule not consistent. The exitActions will never be executed if the rule contains an timeEvents.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if there are any actions
|
||||
if (actions().isEmpty()) {
|
||||
qCWarning(dcRuleEngine) << "Rule not consistent. A rule without actions has no effect.";
|
||||
|
||||
@ -344,7 +344,6 @@ void TestTimeManager::addTimeDescriptor_data()
|
||||
QTest::newRow("invalid: timeEventItem - invalid weekdays (to big)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidWeekDays2)) << RuleEngine::RuleErrorInvalidRepeatingOption;
|
||||
QTest::newRow("invalid: timeEventItem - invalid monthdays (negative)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidMonthDays)) << RuleEngine::RuleErrorInvalidRepeatingOption;
|
||||
QTest::newRow("invalid: timeEventItem - invalid monthdays (to big)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidMonthDays2)) << RuleEngine::RuleErrorInvalidRepeatingOption;
|
||||
|
||||
}
|
||||
|
||||
void TestTimeManager::addTimeDescriptor()
|
||||
|
||||
Reference in New Issue
Block a user