This is an automated email from the ASF dual-hosted git repository. alsay pushed a commit to branch cpp_serde_compat_testing in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
commit 1275f975d60de8922c3f73b6bcc43d8eba5c8bae Author: AlexanderSaydakov <[email protected]> AuthorDate: Mon Jul 31 17:36:20 2023 -0700 generate REQ sketches for compatibility test --- .../datasketches/req/ReqSketchSerDeTest.java | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/test/java/org/apache/datasketches/req/ReqSketchSerDeTest.java b/src/test/java/org/apache/datasketches/req/ReqSketchSerDeTest.java new file mode 100644 index 00000000..c65d1476 --- /dev/null +++ b/src/test/java/org/apache/datasketches/req/ReqSketchSerDeTest.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.datasketches.req; + +import java.io.FileOutputStream; + +import org.testng.annotations.Test; + +public class ReqSketchSerDeTest { + + @Test(groups = {"generate"}) + public void generateBinariesForCompatibilityTesting() throws Exception { + final int[] nArr = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; + for (int n: nArr) { + final ReqSketch sketch = ReqSketch.builder().build(); + for (int i = 0; i < n; i++) sketch.update(i); + try (final FileOutputStream file = new FileOutputStream("req_float_n" + n + ".sk")) { + file.write(sketch.toByteArray()); + } + } + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
