MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / getTests

Function getTests

math/binary/arithmeticmean_test.go:35–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34}
35func 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}
55func BenchmarkMeanUsingAndXor(b *testing.B) {
56 for i := 0; i < b.N; i++ {
57 MeanUsingAndXor(222, 888)

Callers 2

TestMeanUsingAndXorFunction · 0.70
TestMeanUsingRightShiftFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected