@@ -172,7 +172,6 @@ void testPutUnsignedShort() {
172
172
});
173
173
}
174
174
175
-
176
175
// Unusual cases
177
176
178
177
@ Test
@@ -193,147 +192,6 @@ void testOutOfBounds() {
193
192
assertThrowsOriginal (IndexOutOfBoundsException .class , () -> ByteArray .setInt (BUFF , BUFF .length , 1 ));
194
193
}
195
194
196
- // At-zero methods
197
-
198
- @ Test
199
- void testGetShortAtZero () {
200
- longs ().forEach (l -> {
201
- short expected = (short ) l ;
202
- RefImpl .putShort (BUFF , 0 , expected );
203
- short actual = ByteArray .getShort (BUFF );
204
- assertEquals (expected , actual );
205
- });
206
- }
207
-
208
- @ Test
209
- void testPutShortAtZero () {
210
- longs ().forEach (l -> {
211
- short expected = (short ) l ;
212
- ByteArray .setShort (BUFF , expected );
213
- short actual = RefImpl .getShort (BUFF , 0 );
214
- assertEquals (expected , actual );
215
- });
216
- }
217
-
218
- @ Test
219
- void testGetCharAtZero () {
220
- longs ().forEach (l -> {
221
- char expected = (char ) l ;
222
- RefImpl .putChar (BUFF , 0 , expected );
223
- char actual = ByteArray .getChar (BUFF );
224
- assertEquals (expected , actual );
225
- });
226
- }
227
-
228
- @ Test
229
- void testPutCharAtZero () {
230
- longs ().forEach (l -> {
231
- char expected = (char ) l ;
232
- ByteArray .setChar (BUFF , expected );
233
- char actual = RefImpl .getChar (BUFF , 0 );
234
- assertEquals (expected , actual );
235
- });
236
- }
237
-
238
- @ Test
239
- void testGetIntAtZero () {
240
- longs ().forEach (l -> {
241
- int expected = (int ) l ;
242
- RefImpl .putInt (BUFF , 0 , expected );
243
- int actual = ByteArray .getInt (BUFF );
244
- assertEquals (expected , actual );
245
- });
246
- }
247
-
248
- @ Test
249
- void testPutIntAtZero () {
250
- longs ().forEach (l -> {
251
- int expected = (int ) l ;
252
- ByteArray .setInt (BUFF , expected );
253
- int actual = RefImpl .getInt (BUFF , 0 );
254
- assertEquals (expected , actual );
255
- });
256
- }
257
-
258
- @ Test
259
- void testGetLongAtZero () {
260
- longs ().forEach (expected -> {
261
- RefImpl .putLong (BUFF , 0 , expected );
262
- long actual = ByteArray .getLong (BUFF );
263
- assertEquals (expected , actual );
264
- });
265
- }
266
-
267
- @ Test
268
- void testPutLongAtZero () {
269
- longs ().forEach (expected -> {
270
- ByteArray .setLong (BUFF , expected );
271
- long actual = RefImpl .getLong (BUFF , 0 );
272
- assertEquals (expected , actual );
273
- });
274
- }
275
-
276
- @ Test
277
- void testGetFloatAtZero () {
278
- floats ().forEach (expected -> {
279
- RefImpl .putFloat (BUFF , 0 , expected );
280
- float actual = ByteArray .getFloat (BUFF );
281
- assertEquals (expected , actual );
282
- });
283
- }
284
-
285
- @ Test
286
- void testPutFloatAtZero () {
287
- floats ().forEach (expected -> {
288
- ByteArray .setFloat (BUFF , expected );
289
- float actual = RefImpl .getFloat (BUFF , 0 );
290
- assertEquals (expected , actual );
291
- });
292
- }
293
-
294
- @ Test
295
- void testGetDoubleAtZero () {
296
- doubles ().forEach (expected -> {
297
- RefImpl .putDouble (BUFF , 0 , expected );
298
- double actual = ByteArray .getDouble (BUFF );
299
- assertEquals (expected , actual );
300
- });
301
- }
302
-
303
- @ Test
304
- void testPutDoubleAtZero () {
305
- doubles ().forEach (expected -> {
306
- ByteArray .setDouble (BUFF , expected );
307
- double actual = RefImpl .getDouble (BUFF , 0 );
308
- assertEquals (expected , actual );
309
- });
310
- }
311
-
312
- @ Test
313
- void testPutUnsignedShortAtZero () {
314
- longs ().forEach (l -> {
315
- int expected = Short .toUnsignedInt ((short ) l );
316
- ByteArray .setUnsignedShort (BUFF , expected );
317
- int actual = Short .toUnsignedInt (RefImpl .getShort (BUFF , 0 ));
318
- assertEquals (expected , actual );
319
- });
320
- }
321
-
322
- // Unusual cases
323
-
324
- @ Test
325
- void testNullArrayAtZero () {
326
- assertThrowsOriginal (NullPointerException .class , () -> ByteArray .getInt (null ));
327
- assertThrowsOriginal (NullPointerException .class , () -> ByteArray .setInt (null , 1 ));
328
- }
329
-
330
- @ Test
331
- void testOutOfBoundsAtZero () {
332
- assertThrowsOriginal (IndexOutOfBoundsException .class , () -> ByteArray .getInt (new byte [1 ]));
333
- assertThrowsOriginal (IndexOutOfBoundsException .class , () -> ByteArray .setInt (new byte [1 ],1 ));
334
- }
335
-
336
-
337
195
static LongStream longs () {
338
196
return ThreadLocalRandom .current ().longs (ITERATIONS );
339
197
}
0 commit comments