@@ -32,9 +32,9 @@ class ChunkedAdjacencyListsTest {
32
32
33
33
@ Test
34
34
void shouldWriteSingleTargetList () {
35
- var adjacencyLists = ChunkedAdjacencyLists .of (0 , 0 );
35
+ var adjacencyLists = ChunkedAdjacencyLists .of (0 , 0 );
36
36
37
- var input = new long []{ 42L , 1337L , 5L };
37
+ var input = new long []{42L , 1337L , 5L };
38
38
adjacencyLists .add (0 , input , 0 , 3 , 3 );
39
39
40
40
var expectedTargets = new long []{42L , 1337L , 5L };
@@ -73,26 +73,26 @@ void shouldWriteMultipleTimesIntoTargetList() {
73
73
void shouldWriteWithProperties () {
74
74
var adjacencyLists = ChunkedAdjacencyLists .of (2 , 0 );
75
75
76
- var input = new long []{ 42L , 1337L , 5L , 6L };
77
- var properties = new long [][]{ {42L , 1337L , 5L , 6L }, {8L , 8L , 8L , 8L }};
76
+ var input = new long []{42L , 1337L , 5L , 6L };
77
+ var properties = new long [][]{{42L , 1337L , 5L , 6L }, {8L , 8L , 8L , 8L }};
78
78
adjacencyLists .add (0 , input , properties , 0 , 4 , 4 );
79
79
80
80
adjacencyLists .consume ((nodeId , targets , actualProperties , position , length ) -> assertThat (actualProperties )
81
- .hasDimensions (2 , 7 )
82
- .contains (new long []{42L , 1337L , 5L , 6L , 0L , 0L , 0L }, Index .atIndex (0 ))
83
- .contains (new long []{8L , 8L , 8L , 8L , 0L , 0L , 0L }, Index .atIndex (1 )));
81
+ .hasDimensions (2 , 4 )
82
+ .contains (new long []{42L , 1337L , 5L , 6L }, Index .atIndex (0 ))
83
+ .contains (new long []{8L , 8L , 8L , 8L }, Index .atIndex (1 )));
84
84
}
85
85
86
86
@ Test
87
87
void shouldAllowConsumptionOfAllElements () {
88
88
var adjacencyLists = ChunkedAdjacencyLists .of (0 , 0 );
89
89
90
- adjacencyLists .add (1 , new long []{ 42L , 1337L , 5L }, 0 , 3 , 3 );
91
- adjacencyLists .add (8 , new long []{ 1L , 2L }, 0 , 2 , 2 );
90
+ adjacencyLists .add (1 , new long []{42L , 1337L , 5L }, 0 , 3 , 3 );
91
+ adjacencyLists .add (8 , new long []{1L , 2L }, 0 , 2 , 2 );
92
92
93
93
// Skip 2 pages
94
94
var largeIndex = 3 * 4096 + 1 ;
95
- adjacencyLists .add (largeIndex , new long []{ 42L , 42L }, 0 , 2 , 2 );
95
+ adjacencyLists .add (largeIndex , new long []{42L , 42L }, 0 , 2 , 2 );
96
96
97
97
adjacencyLists .consume ((id , targets , properties , compressedBytesSize , compressedTargets ) -> {
98
98
assertThat (properties ).isNull ();
@@ -160,9 +160,8 @@ void addWithPreAggregatedWeights() {
160
160
assertThat (actualTargets ).containsExactly (expectedTargets );
161
161
162
162
assertThat (actualProperties )
163
- // there is an additional entry, because we increase the buffers in size
164
- .hasDimensions (1 , 6 )
165
- .contains (new long []{3L , 3L , 4L , 0L , 0L , 0L }, Index .atIndex (0 ));
163
+ // there is an additional entry, because we double the buffers in size
164
+ .hasDimensions (1 , 4 ).contains (new long []{3L , 3L , 4L , 0L }, Index .atIndex (0 ));
166
165
});
167
166
}
168
167
}
0 commit comments