MCPcopy Create free account
hub / github.com/bytedance/terarkdb / slice

Method slice

java/src/test/java/org/rocksdb/SliceTest.java:18–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 new RocksMemoryResource();
17
18 @Test
19 public void slice() {
20 try (final Slice slice = new Slice("testSlice")) {
21 assertThat(slice.empty()).isFalse();
22 assertThat(slice.size()).isEqualTo(9);
23 assertThat(slice.data()).isEqualTo("testSlice".getBytes());
24 }
25
26 try (final Slice otherSlice = new Slice("otherSlice".getBytes())) {
27 assertThat(otherSlice.data()).isEqualTo("otherSlice".getBytes());
28 }
29
30 try (final Slice thirdSlice = new Slice("otherSlice".getBytes(), 5)) {
31 assertThat(thirdSlice.data()).isEqualTo("Slice".getBytes());
32 }
33 }
34
35 @Test
36 public void sliceClear() {

Callers 15

AssertSameMethod · 0.80
AddMethod · 0.80
AddMethod · 0.80
AddTombstoneMethod · 0.80
BuilderWriteValuesMethod · 0.80
valueMethod · 0.80
TEST_PFunction · 0.80
CheckIteratorMethod · 0.80
InitFirstLevelIterMethod · 0.80
pin_bufferMethod · 0.80
AddMethod · 0.80
AddTombstoneMethod · 0.80

Calls 4

isFalseMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected