use testify

pull/1839/head
Stefano Balzarotti 4 weeks ago
parent b30f1523d8
commit d46c4a822d
No known key found for this signature in database
GPG Key ID: 7E7FC24DA4B9F8C9

@ -61,25 +61,15 @@ func TestTimes(t *testing.T) {
func TestCounts(t *testing.T) {
logicalCount, err := Counts(true)
common.SkipIfNotImplementedErr(t, err)
if err != nil {
t.Errorf("error %v", err)
}
if logicalCount == 0 {
t.Errorf("could not get logical CPU counts: %v", logicalCount)
}
require.NoError(t, err)
assert.NotZerof(t, logicalCount, "could not get logical CPU counts: %v", logicalCount)
t.Logf("logical cores: %d", logicalCount)
physicalCount, err := Counts(false)
common.SkipIfNotImplementedErr(t, err)
if err != nil {
t.Errorf("error %v", err)
}
if physicalCount == 0 {
t.Errorf("could not get physical CPU counts: %v", physicalCount)
}
require.NoError(t, err)
assert.NotZerof(t, physicalCount, "could not get physical CPU counts: %v", physicalCount)
t.Logf("physical cores: %d", physicalCount)
if physicalCount > logicalCount {
t.Errorf("physical cpu cannot be more than logical cpu: %v > %v", physicalCount, logicalCount)
}
assert.GreaterOrEqualf(t, logicalCount, physicalCount, "logical CPU count should be greater than or equal to physical CPU count: %v >= %v", logicalCount, physicalCount)
}
func TestTimeStat_String(t *testing.T) {

Loading…
Cancel
Save