Skip to content

Commit 2ce5c4c

Browse files
committed
Async IO decompression: Added multiframe test for --[no-]asyncio
1 parent 2b16139 commit 2ce5c4c

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

tests/playTests.sh

+31-9
Original file line numberDiff line numberDiff line change
@@ -1569,21 +1569,43 @@ elif [ "$longCSize19wlog23" -gt "$optCSize19wlog23" ]; then
15691569
fi
15701570

15711571
println "\n===> zstd asyncio decompression tests "
1572-
roundTripTest -g8M "3 --asyncio"
1573-
roundTripTest -g8M "3 --no-asyncio"
1572+
1573+
addFrame() {
1574+
datagen -g2M -s$2 >> tmp_uncompressed
1575+
datagen -g2M -s$2 | zstd --format=$1 >> tmp_compressed.zst
1576+
}
1577+
1578+
addTwoFrames() {
1579+
addFrame $1 1
1580+
addFrame $1 2
1581+
}
1582+
1583+
testAsyncIO() {
1584+
roundTripTest -g2M "3 --asyncio --format=$1"
1585+
roundTripTest -g2M "3 --no-asyncio --format=$1"
1586+
}
1587+
1588+
rm -f tmp_compressed tmp_uncompressed
1589+
testAsyncIO zstd
1590+
addTwoFrames zstd
15741591
if [ $GZIPMODE -eq 1 ]; then
1575-
roundTripTest -g8M "3 --format=gzip --asyncio"
1576-
roundTripTest -g8M "3 --format=gzip --no-asyncio"
1592+
testAsyncIO gzip
1593+
addTwoFrames gzip
15771594
fi
15781595
if [ $LZMAMODE -eq 1 ]; then
1579-
roundTripTest -g8M "3 --format=lzma --asyncio"
1580-
roundTripTest -g8M "3 --format=lzma --no-asyncio"
1596+
testAsyncIO lzma
1597+
addTwoFrames lzma
15811598
fi
15821599
if [ $LZ4MODE -eq 1 ]; then
1583-
roundTripTest -g8M "3 --format=lz4 --asyncio"
1584-
roundTripTest -g8M "3 --format=lz4 --no-asyncio"
1600+
testAsyncIO lz4
1601+
addTwoFrames lz4
15851602
fi
1586-
1603+
cat tmp_uncompressed | $MD5SUM > tmp2
1604+
zstd -d tmp_compressed.zst --asyncio -c | $MD5SUM > tmp1
1605+
$DIFF -q tmp1 tmp2
1606+
rm tmp1
1607+
zstd -d tmp_compressed.zst --no-asyncio -c | $MD5SUM > tmp1
1608+
$DIFF -q tmp1 tmp2
15871609

15881610
if [ "$1" != "--test-large-data" ]; then
15891611
println "Skipping large data tests"

0 commit comments

Comments
 (0)