@@ -127,9 +127,8 @@ public void testZstdLibrary(int clevel, boolean checksumFlag) throws IOException
127127 assert exitCode == 0 ;
128128 }
129129
130- //TODO: add crc32c
131130 @ ParameterizedTest
132- @ ValueSource (strings = {"blosc" , "gzip" , "zstd" , "bytes" , "transpose" , "sharding_start" , "sharding_end" })
131+ @ ValueSource (strings = {"blosc" , "gzip" , "zstd" , "bytes" , "transpose" , "sharding_start" , "sharding_end" , "crc32c" })
133132 public void testWriteToZarrita (String codec ) throws IOException , ZarrException , InterruptedException {
134133 StoreHandle storeHandle = new FilesystemStore (TESTOUTPUT ).resolve ("write_to_zarrita" , codec );
135134 ArrayMetadataBuilder builder = Array .metadataBuilder ()
@@ -161,7 +160,7 @@ public void testWriteToZarrita(String codec) throws IOException, ZarrException,
161160 builder = builder .withCodecs (c -> c .withSharding (new int []{4 , 4 }, c1 -> c1 .withBytes ("LITTLE" ), "end" ));
162161 break ;
163162 case "crc32c" :
164- //missing
163+ builder = builder . withCodecs ( CodecBuilder :: withCrc32c );
165164 break ;
166165 default :
167166 throw new IllegalArgumentException ("Invalid Codec: " + codec );
@@ -195,7 +194,7 @@ public void testWriteToZarrita(String codec) throws IOException, ZarrException,
195194
196195
197196 @ ParameterizedTest
198- @ ValueSource (strings = {"blosc" , "gzip" , "zstd" , "bytes" , "transpose" , "sharding_start" , "sharding_end" })
197+ @ ValueSource (strings = {"blosc" , "gzip" , "zstd" , "bytes" , "transpose" , "sharding_start" , "sharding_end" , "crc32c" })
199198 public void testCodecsWriteRead (String codec ) throws IOException , ZarrException {
200199 int [] testData = new int [16 * 16 * 16 ];
201200 Arrays .setAll (testData , p -> p );
@@ -231,7 +230,7 @@ public void testCodecsWriteRead(String codec) throws IOException, ZarrException
231230 builder = builder .withCodecs (c -> c .withSharding (new int []{2 , 2 , 4 }, c1 -> c1 .withBytes ("LITTLE" ), "start" ));
232231 break ;
233232 case "crc32c" :
234- //missing
233+ builder = builder . withCodecs ( CodecBuilder :: withCrc32c );
235234 break ;
236235 default :
237236 throw new IllegalArgumentException ("Invalid Codec: " + codec );
0 commit comments