Skip to content

Commit

Permalink
Minor syntax cleanup to scala sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
norrisjeremy committed Jan 21, 2023
1 parent 170ca02 commit 4d065dc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions src/test/scala/Adler32Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Adler32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {
juza.update(buf1, 0, buf1.length)
juza.getValue
}
val actual = getValue(List(buf1));
val actual = getValue(List(buf1))

actual should equal (expected)
}
Expand All @@ -37,12 +37,12 @@ class Adler32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {

val adler1 = new Adler32

adler1.update(buf1, 0, buf1.length);
adler1.update(buf1, 0, buf1.length)

val adler2 = adler1.copy

adler1.update(buf2, 0, buf1.length);
adler2.update(buf2, 0, buf1.length);
adler1.update(buf2, 0, buf1.length)
adler2.update(buf2, 0, buf1.length)

val expected = adler1.getValue
val actual = adler2.getValue
Expand All @@ -55,9 +55,9 @@ class Adler32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {
val buf1 = randombuf(1024)
val buf2 = randombuf(1024)

val adler1 = getValue(List(buf1));
val adler2 = getValue(List(buf2));
val expected = getValue(List(buf1, buf2));
val adler1 = getValue(List(buf1))
val adler2 = getValue(List(buf2))
val expected = getValue(List(buf1, buf2))

val actual = Adler32.combine(adler1, adler2, buf2.length)

Expand Down
14 changes: 7 additions & 7 deletions src/test/scala/CRC32Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CRC32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {
juza.update(buf1, 0, buf1.length)
juza.getValue
}
val actual = getValue(List(buf1));
val actual = getValue(List(buf1))

actual should equal (expected)
}
Expand All @@ -37,12 +37,12 @@ class CRC32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {

val crc1 = new CRC32

crc1.update(buf1, 0, buf1.length);
crc1.update(buf1, 0, buf1.length)

val crc2 = crc1.copy

crc1.update(buf2, 0, buf1.length);
crc2.update(buf2, 0, buf1.length);
crc1.update(buf2, 0, buf1.length)
crc2.update(buf2, 0, buf1.length)

val expected = crc1.getValue
val actual = crc2.getValue
Expand All @@ -55,9 +55,9 @@ class CRC32Test extends AnyFlatSpec with BeforeAndAfter with Matchers {
val buf1 = randombuf(1024)
val buf2 = randombuf(1024)

val crc1 = getValue(List(buf1));
val crc2 = getValue(List(buf2));
val expected = getValue(List(buf1, buf2));
val crc1 = getValue(List(buf1))
val crc2 = getValue(List(buf2))
val expected = getValue(List(buf1, buf2))

val actual = CRC32.combine(crc1, crc2, buf2.length)

Expand Down
20 changes: 10 additions & 10 deletions src/test/scala/DeflateInflateTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
err = deflater.deflate(Z_NO_FLUSH)
err should equal (Z_OK)

err = deflater.deflate(JZlib.Z_FINISH);
err = deflater.deflate(JZlib.Z_FINISH)
err should equal (Z_STREAM_END)

err = deflater.end
Expand Down Expand Up @@ -108,7 +108,7 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
deflater.avail_out = 1
err = deflater.deflate(Z_FINISH)
}
while(err != Z_STREAM_END);
while(err != Z_STREAM_END)

err = deflater.end
err should equal (Z_OK)
Expand All @@ -123,8 +123,8 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
while(inflater.total_out<uncomprLen &&
inflater.total_in<comprLen &&
loop) {
inflater.avail_in = 1; // force small buffers
inflater.avail_out = 1; // force small buffers
inflater.avail_in = 1 // force small buffers
inflater.avail_out = 1 // force small buffers
err = inflater.inflate(Z_NO_FLUSH)
if(err == Z_STREAM_END) loop = false
else err should equal (Z_OK)
Expand Down Expand Up @@ -175,7 +175,7 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
loop = false
case Z_NEED_DICT =>
dictID should equal (inflater.getAdler)
err = inflater.setDictionary(dictionary, dictionary.length);
err = inflater.setDictionary(dictionary, dictionary.length)
err should equal (Z_OK)
case _ =>
err should equal (Z_OK)
Expand All @@ -200,14 +200,14 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
err should equal (Z_OK)

deflater.setInput(hello)
deflater.avail_in = 3;
deflater.avail_in = 3
deflater.setOutput(compr)

err = deflater.deflate(Z_FULL_FLUSH)
err should equal (Z_OK)

compr(3) = (compr(3) + 1).asInstanceOf[Byte]
deflater.avail_in = hello.length - 3;
deflater.avail_in = hello.length - 3

err = deflater.deflate(Z_FINISH)
err should equal (Z_STREAM_END)
Expand Down Expand Up @@ -303,7 +303,7 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
deflater.avail_out = 1
err = deflater.deflate(Z_FINISH)
}
while(err != Z_STREAM_END);
while(err != Z_STREAM_END)

err = deflater.end
err should equal (Z_OK)
Expand All @@ -318,8 +318,8 @@ class DeflateInflateTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
while(inflater.total_out<uncomprLen &&
inflater.total_in<comprLen &&
loop) {
inflater.avail_in = 1; // force small buffers
inflater.avail_out = 1; // force small buffers
inflater.avail_in = 1 // force small buffers
inflater.avail_out = 1 // force small buffers
err = inflater.inflate(Z_NO_FLUSH)
if(err == Z_STREAM_END) loop = false
else err should equal (Z_OK)
Expand Down

0 comments on commit 4d065dc

Please sign in to comment.