}
func (d *testingData) Swap(i, j int) {
if d.nswap >= d.maxswap {
- d.t.Errorf("%s: used %d swaps sorting slice of %d", d.desc, d.nswap, len(d.data))
- d.t.FailNow()
+ d.t.Fatalf("%s: used %d swaps sorting slice of %d", d.desc, d.nswap, len(d.data))
}
d.nswap++
d.data[i], d.data[j] = d.data[j], d.data[i]
// mutating method Sort can call is TestingData.swap,
// it suffices here just to check that the final slice is sorted.
if !IntsAreSorted(mdata) {
- t.Errorf("%s: ints not sorted", desc)
- t.Errorf("\t%v", mdata)
- t.FailNow()
+ t.Fatalf("%s: ints not sorted\n\t%v", desc, mdata)
}
}
}
// Check data is fully populated and sorted.
for i, v := range d.data {
if v != i {
- t.Errorf("adversary data not fully sorted")
- t.FailNow()
+ t.Fatalf("adversary data not fully sorted")
}
}
}