(b *testing.B)
| 177 | } |
| 178 | |
| 179 | func BenchmarkPremul(b *testing.B) { |
| 180 | if skipUseless { |
| 181 | b.Skip("skipping useless approach") |
| 182 | } |
| 183 | for api, testsize := range testSizes { |
| 184 | b.Run(testsize.Name, func(b *testing.B) { |
| 185 | verify := verifyIndex[api] |
| 186 | ap := testsize.AP |
| 187 | b.SetBytes(int64(ap.TotalSize())) |
| 188 | for i := 0; i < b.N; i++ { |
| 189 | it := premul.NewIterator(ap) |
| 190 | total := 0 |
| 191 | for index, err := it.Next(); err == nil; index, err = it.Next() { |
| 192 | total += verify[index] * index |
| 193 | } |
| 194 | _ = total |
| 195 | } |
| 196 | }) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | func TestOnearr(t *testing.T) { |
| 201 | testIterator(t, func(ap *shape.AP) Iterator { return onearr.NewIterator(ap) }) |
nothing calls this directly
no test coverage detected