(t *testing.T)
| 203 | } |
| 204 | |
| 205 | func TestMapBatchUnprivileged(t *testing.T) { |
| 206 | arr := createMap(t, Array, 4) |
| 207 | hash := createMap(t, Hash, 4) |
| 208 | |
| 209 | keys := []uint32{0, 1} |
| 210 | values := []uint32{42, 4242} |
| 211 | qt.Assert(t, qt.IsNil(hash.Update(keys[0], values[0], UpdateAny))) |
| 212 | qt.Assert(t, qt.IsNil(hash.Update(keys[1], values[1], UpdateAny))) |
| 213 | |
| 214 | testutils.WithCapabilities(t, nil, func() { |
| 215 | tmp := make([]uint32, 2) |
| 216 | |
| 217 | var cursor MapBatchCursor |
| 218 | _, err := arr.BatchLookup(&cursor, tmp, tmp, nil) |
| 219 | testutils.SkipIfNotSupported(t, err) |
| 220 | qt.Assert(t, qt.IsNil(err)) |
| 221 | |
| 222 | count, err := arr.BatchUpdate(keys, values, nil) |
| 223 | testutils.SkipIfNotSupported(t, err) |
| 224 | qt.Assert(t, qt.IsNil(err)) |
| 225 | qt.Assert(t, qt.Equals(count, len(keys))) |
| 226 | |
| 227 | count, err = hash.BatchDelete(keys, nil) |
| 228 | testutils.SkipIfNotSupported(t, err) |
| 229 | qt.Assert(t, qt.IsNil(err)) |
| 230 | qt.Assert(t, qt.Equals(count, len(keys))) |
| 231 | }) |
| 232 | } |
| 233 | |
| 234 | func TestMapBatchCursorReuse(t *testing.T) { |
| 235 | arr1 := createMap(t, Array, 4) |
nothing calls this directly
no test coverage detected
searching dependent graphs…