MCPcopy Index your code
hub / github.com/coredns/coredns / assertIntPtrValue

Function assertIntPtrValue

plugin/https3/setup_test.go:121–137  ·  view source on GitHub ↗
(t *testing.T, testIndex int, testInput, fieldName string, actual, expected *int)

Source from the content-addressed store, hash-verified

119}
120
121func assertIntPtrValue(t *testing.T, testIndex int, testInput, fieldName string, actual, expected *int) {
122 t.Helper()
123 if actual == nil && expected == nil {
124 return
125 }
126
127 if (actual == nil) != (expected == nil) {
128 t.Errorf("Test %d (%s): Expected %s to be %v, but got %v",
129 testIndex, testInput, fieldName, formatNilableInt(expected), formatNilableInt(actual))
130 return
131 }
132
133 if *actual != *expected {
134 t.Errorf("Test %d (%s): Expected %s to be %d, but got %d",
135 testIndex, testInput, fieldName, *expected, *actual)
136 }
137}
138
139func formatNilableInt(v *int) string {
140 if v == nil {

Callers 1

TestSetupFunction · 0.70

Calls 2

formatNilableIntFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…