(b *testing.B)
| 49 | } |
| 50 | |
| 51 | func BenchmarkWrappedRecordDot(b *testing.B) { |
| 52 | testRecord.Data = []float32{3, 6, 9} |
| 53 | shouldBe := 126.0 |
| 54 | |
| 55 | a := WrapRecord(&testRecord) |
| 56 | c := WrapRecord(&testRecord) |
| 57 | |
| 58 | for i := 0; i < b.N; i++ { |
| 59 | if dot := a.Dot(c); dot != shouldBe { |
| 60 | b.Fatalf("dot product should be %f, got %f", shouldBe, dot) |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func wrappedRecordDotN(b *testing.B, N int) { |
| 66 | a := pb.Record{Data: make([]float32, N)} |
nothing calls this directly
no test coverage detected