Skip to content

Commit

Permalink
reproducible tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Panagiotis Liakos committed Jun 1, 2022
1 parent 3883a6c commit 5595f42
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* the value compression.
*
*/
public class CompressBenchmark {
public class TestDoublePrecision {

private static final int MINIMUM_TOTAL_BLOCKS = 50_000;
private static String[] FILENAMES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* the value compression.
*
*/
public class CompressBenchmarkLossy {
public class TestLossy {

private static final int MINIMUM_TOTAL_BLOCKS = 50_000;
private static String[] FILENAMES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;

Expand All @@ -33,12 +31,14 @@
import gr.aueb.delorean.chimp.Decompressor32;
import gr.aueb.delorean.chimp.Value;



/**
* These are generic tests to test that input matches the output after compression + decompression cycle, using
* the value compression.
*
*/
public class CompressBenchmarkSinglePrecision {
public class TestSinglePrecision {

private static final int MINIMUM_TOTAL_BLOCKS = 50_000;
private static String[] FILENAMES = {
Expand All @@ -47,6 +47,8 @@ public class CompressBenchmarkSinglePrecision {
"/SSD_HDD_benchmarks.csv.gz"
};



@Test
public void testChimpN32() throws IOException {
int previousValues = 64;
Expand Down Expand Up @@ -129,15 +131,15 @@ public void testChimp32() throws IOException {
@Test
public void testCorilla32() throws IOException {
for (String filename : FILENAMES) {
TimeseriesFileReader timeseriesFileReader = new TimeseriesFileReader(new FileInputStream(new File(filename)));
TimeseriesFileReader timeseriesFileReader = new TimeseriesFileReader(getClass().getResourceAsStream(filename));
long totalSize = 0;
float totalBlocks = 0;
double[] values;
long encodingDuration = 0;
long decodingDuration = 0;
while ((values = timeseriesFileReader.nextBlock()) != null || totalBlocks < MINIMUM_TOTAL_BLOCKS) {
if (values == null) {
timeseriesFileReader = new TimeseriesFileReader(new FileInputStream(new File(filename)));
timeseriesFileReader = new TimeseriesFileReader(getClass().getResourceAsStream(filename));
values = timeseriesFileReader.nextBlock();
}
ByteBufferBitOutput output = new ByteBufferBitOutput();
Expand Down
10 changes: 0 additions & 10 deletions src/test/resources/log4j.properties

This file was deleted.

11 changes: 11 additions & 0 deletions src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="error">
<appender-ref ref="STDOUT" />
</root>
</configuration>

0 comments on commit 5595f42

Please sign in to comment.