()
| 33 | |
| 34 | } |
| 35 | func getTests() []struct { |
| 36 | name string |
| 37 | a int |
| 38 | b int |
| 39 | result int |
| 40 | } { |
| 41 | var tests = []struct { |
| 42 | name string |
| 43 | a int |
| 44 | b int |
| 45 | result int |
| 46 | }{ |
| 47 | {"Average of 2 and 4", 2, 4, 3}, |
| 48 | {"Average of 5 and 5", 5, 5, 5}, |
| 49 | {"Average of 1000 and 1002", 1000, 1002, 1001}, |
| 50 | {"Average of 80 and 40", 80, 40, 60}, |
| 51 | {"Average of 7 and 4", 7, 4, 5}, |
| 52 | } |
| 53 | return tests |
| 54 | } |
| 55 | func BenchmarkMeanUsingAndXor(b *testing.B) { |
| 56 | for i := 0; i < b.N; i++ { |
| 57 | MeanUsingAndXor(222, 888) |
no outgoing calls
no test coverage detected