MCPcopy
hub / github.com/cilium/ebpf / TestExist

Function TestExist

map_test.go:1256–1266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1254}
1255
1256func TestExist(t *testing.T) {
1257 hash := createMap(t, Hash, 10)
1258
1259 if err := hash.Put("test", uint32(21)); err != nil {
1260 t.Errorf("Failed to put key/value pair into hash: %v", err)
1261 }
1262
1263 if err := hash.Update("test", uint32(42), UpdateNoExist); !errors.Is(err, ErrKeyExist) {
1264 t.Error("Updating existing key doesn't return ErrKeyExist")
1265 }
1266}
1267
1268func TestIterateMapInMap(t *testing.T) {
1269 const idx = uint32(1)

Callers

nothing calls this directly

Calls 5

PutMethod · 0.80
createMapFunction · 0.70
UpdateMethod · 0.65
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…