Skip to content

Commit

Permalink
8326100: DeflaterDictionaryTests should use Deflater.getBytesWritten …
Browse files Browse the repository at this point in the history
…instead of Deflater.getTotalOut

Reviewed-by: alanb, jpai
  • Loading branch information
Eirik Bjørsnøs committed Feb 19, 2024
1 parent d422811 commit 9451677
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/jdk/java/util/zip/DeflaterDictionaryTests.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -95,9 +95,9 @@ public void testByteArray(int dictionary_offset) throws Exception {
deflater.setInput(input);
deflater.finish();
int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH);
System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," +
" compressed length: %s%n", deflater.getTotalOut(),
deflater.getTotalOut(), compressedDataLength);
System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," +
" compressed length: %d%n", deflater.getBytesWritten(),
deflater.getAdler(), compressedDataLength);
deflater.finished();

// Decompress the bytes
Expand All @@ -112,7 +112,7 @@ public void testByteArray(int dictionary_offset) throws Exception {
System.out.println("Did not need to use a Dictionary");
}
inflater.finished();
System.out.printf("Inflater::getAdler:%s, length: %s%n",
System.out.printf("Inflater::getAdler:%d, length: %d%n",
inflater.getAdler(), resultLength);

Assert.assertEquals(SRC_DATA.length(), resultLength);
Expand Down Expand Up @@ -143,9 +143,9 @@ public void testHeapByteBuffer() throws Exception {
deflater.setInput(input);
deflater.finish();
int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH);
System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," +
" compressed length: %s%n", deflater.getTotalOut(),
deflater.getTotalOut(), compressedDataLength);
System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," +
" compressed length: %d%n", deflater.getBytesWritten(),
deflater.getAdler(), compressedDataLength);
deflater.finished();

// Decompress the bytes
Expand All @@ -160,7 +160,7 @@ public void testHeapByteBuffer() throws Exception {
System.out.println("Did not need to use a Dictionary");
}
inflater.finished();
System.out.printf("Inflater::getAdler:%s, length: %s%n",
System.out.printf("Inflater::getAdler:%d, length: %d%n",
inflater.getAdler(), resultLength);

Assert.assertEquals(SRC_DATA.length(), resultLength);
Expand Down Expand Up @@ -197,9 +197,9 @@ public void testByteBufferDirect() throws Exception {
deflater.setInput(input);
deflater.finish();
int compressedDataLength = deflater.deflate(output, 0, output.length, Deflater.NO_FLUSH);
System.out.printf("Deflater::getTotalOut:%s, Deflater::getAdler: %s," +
" compressed length: %s%n", deflater.getTotalOut(),
deflater.getTotalOut(), compressedDataLength);
System.out.printf("Deflater::getBytesWritten:%d, Deflater::getAdler: %d," +
" compressed length: %d%n", deflater.getBytesWritten(),
deflater.getAdler(), compressedDataLength);
deflater.finished();

// Decompress the bytes
Expand All @@ -214,7 +214,7 @@ public void testByteBufferDirect() throws Exception {
System.out.println("Did not need to use a Dictionary");
}
inflater.finished();
System.out.printf("Inflater::getAdler:%s, length: %s%n",
System.out.printf("Inflater::getAdler:%d, length: %d%n",
inflater.getAdler(), resultLength);

Assert.assertEquals(SRC_DATA.length(), resultLength);
Expand Down

5 comments on commit 9451677

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 9451677 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 9451677 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 9451677 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-9451677d-master in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 9451677d from the openjdk/jdk repository.

The commit being backported was authored by Eirik Bjørsnøs on 19 Feb 2024 and was reviewed by Alan Bateman and Jaikiran Pai.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-9451677d-master:backport-GoeLin-9451677d-master
$ git checkout backport-GoeLin-9451677d-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-9451677d-master

@openjdk
Copy link

@openjdk openjdk bot commented on 9451677 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-9451677d-master in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 9451677d from the openjdk/jdk repository.

The commit being backported was authored by Eirik Bjørsnøs on 19 Feb 2024 and was reviewed by Alan Bateman and Jaikiran Pai.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-9451677d-master:backport-GoeLin-9451677d-master
$ git checkout backport-GoeLin-9451677d-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-9451677d-master

Please sign in to comment.