sys: use assert for error checks in OOM tests
Slightly easier to read, and we were already using assert in this file Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6e72715226
commit
ace1912bba
@ -31,10 +31,7 @@ import (
|
|||||||
func TestSetPositiveOomScoreAdjustment(t *testing.T) {
|
func TestSetPositiveOomScoreAdjustment(t *testing.T) {
|
||||||
// Setting a *positive* OOM score adjust does not require privileged
|
// Setting a *positive* OOM score adjust does not require privileged
|
||||||
_, adjustment, err := adjustOom(123)
|
_, adjustment, err := adjustOom(123)
|
||||||
if err != nil {
|
assert.NilError(t, err)
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
assert.Check(t, is.Equal(adjustment, 123))
|
assert.Check(t, is.Equal(adjustment, 123))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,10 +42,7 @@ func TestSetNegativeOomScoreAdjustmentWhenPrivileged(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, adjustment, err := adjustOom(-123)
|
_, adjustment, err := adjustOom(-123)
|
||||||
if err != nil {
|
assert.NilError(t, err)
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
assert.Check(t, is.Equal(adjustment, -123))
|
assert.Check(t, is.Equal(adjustment, -123))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,10 +53,7 @@ func TestSetNegativeOomScoreAdjustmentWhenUnprivilegedHasNoEffect(t *testing.T)
|
|||||||
}
|
}
|
||||||
|
|
||||||
initial, adjustment, err := adjustOom(-123)
|
initial, adjustment, err := adjustOom(-123)
|
||||||
if err != nil {
|
assert.NilError(t, err)
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
assert.Check(t, is.Equal(adjustment, initial))
|
assert.Check(t, is.Equal(adjustment, initial))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user