katatestutils: Reset TestConstraints fields on NotValid() call

`TestConstraint.NotValid()` is really designed to be called once per
test. However, there is no reason it should not be possible to call
multiple times. But to allow for that secenario, any settings
from a previous `NotValid()` call need to be cleared.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt
2019-05-09 14:56:38 +01:00
parent a7935d419e
commit 20b558656d

View File

@@ -112,6 +112,11 @@ func (tc *TestConstraint) NotValid(constraints ...Constraint) bool {
panic("need atleast one constraint")
}
// Reset in case of a previous call
tc.Passed = nil
tc.Failed = nil
tc.Issue = ""
for _, c := range constraints {
invalid := tc.constraintInvalid(c)
if invalid {