3434
3535import org .apache .datasketches .common .Family ;
3636import org .apache .datasketches .common .SketchesArgumentException ;
37- import org .apache .datasketches .kll .KllDoublesSketch ;
38- import org .apache .datasketches .kll .KllFloatsSketch ;
39- import org .apache .datasketches .kll .KllHelper ;
40- import org .apache .datasketches .kll .KllMemorySegmentValidate ;
4137import org .testng .annotations .Test ;
4238
43- @ SuppressWarnings ("unused" )
4439public class KllMemoryValidateTest {
4540
4641 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -49,7 +44,7 @@ public void checkInvalidFamily() {
4944 final byte [] byteArr = sk .toByteArray ();
5045 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
5146 setMemorySegmentFamilyID (wseg , Family .KLL .getID () - 1 );
52- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
47+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
5348 }
5449
5550 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -58,7 +53,7 @@ public void checkInvalidSerVer() {
5853 final byte [] byteArr = sk .toByteArray ();
5954 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
6055 setMemorySegmentSerVer (wseg , SERIAL_VERSION_EMPTY_FULL - 1 );
61- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
56+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
6257 }
6358
6459 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -68,7 +63,7 @@ public void checkInvalidEmptyAndSingleFormat() {
6863 final byte [] byteArr = sk .toByteArray ();
6964 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
7065 setMemorySegmentEmptyFlag (wseg , true );
71- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
66+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
7267 }
7368
7469 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -77,7 +72,7 @@ public void checkInvalidUpdatableAndSerVer() {
7772 final byte [] byteArr = sk .toByteArray ();
7873 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
7974 setMemorySegmentSerVer (wseg , SERIAL_VERSION_SINGLE );
80- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
75+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
8176 }
8277
8378 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -87,7 +82,7 @@ public void checkInvalidSingleAndPreInts() {
8782 final byte [] byteArr = sk .toByteArray ();
8883 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
8984 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_FULL );
90- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
85+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
9186 }
9287
9388 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -97,7 +92,7 @@ public void checkInvalidSingleAndSerVer() {
9792 final byte [] byteArr = sk .toByteArray ();
9893 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
9994 setMemorySegmentSerVer (wseg , SERIAL_VERSION_EMPTY_FULL );
100- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
95+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
10196 }
10297
10398 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -106,7 +101,7 @@ public void checkInvalidEmptyDoublesAndPreIntsFull() {
106101 final byte [] byteArr = sk .toByteArray ();
107102 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
108103 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_FULL );
109- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
104+ new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
110105 }
111106
112107 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -116,7 +111,7 @@ public void checkInvalidSingleDoubleCompactAndSerVer() {
116111 final byte [] byteArr = sk .toByteArray ();
117112 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
118113 setMemorySegmentSerVer (wseg , SERIAL_VERSION_EMPTY_FULL );
119- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
114+ new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
120115 }
121116
122117 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -125,7 +120,7 @@ public void checkInvalidDoubleUpdatableAndPreInts() {
125120 final byte [] byteArr = KllHelper .toByteArray (sk , true );
126121 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
127122 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_EMPTY_SINGLE );
128- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
123+ new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
129124 }
130125
131126 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -135,7 +130,7 @@ public void checkInvalidFloatFullAndPreInts() {
135130 final byte [] byteArr = sk .toByteArray ();
136131 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
137132 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_EMPTY_SINGLE );
138- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
133+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
139134 }
140135
141136 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -145,7 +140,7 @@ public void checkInvalidFloatUpdatableFullAndPreInts() {
145140 final byte [] byteArr = KllHelper .toByteArray (sk , true );
146141 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
147142 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_EMPTY_SINGLE );
148- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
143+ new KllMemorySegmentValidate (wseg , KLL_FLOATS_SKETCH );
149144 }
150145
151146 @ Test (expectedExceptions = SketchesArgumentException .class )
@@ -155,7 +150,7 @@ public void checkInvalidDoubleCompactSingleAndPreInts() {
155150 final byte [] byteArr = sk .toByteArray ();
156151 final MemorySegment wseg = MemorySegment .ofArray (byteArr );
157152 setMemorySegmentPreInts (wseg , PREAMBLE_INTS_FULL );//should be 2, single
158- final KllMemorySegmentValidate segVal = new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
153+ new KllMemorySegmentValidate (wseg , KLL_DOUBLES_SKETCH );
159154 }
160155
161156}
0 commit comments