Skip to content

Commit

Permalink
8289584: (fs) Print size values in java/nio/file/FileStore/Basic.java…
Browse files Browse the repository at this point in the history
… when they differ by > 1GiB

Reviewed-by: alanb
  • Loading branch information
Brian Burkhalter committed Jul 1, 2022
1 parent c43bdf7 commit e291a67
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/jdk/java/nio/file/FileStore/Basic.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022, 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 @@ -57,10 +57,13 @@ static void assertTrue(boolean okay) {
throw new RuntimeException("Assertion failed");
}

static void checkWithin1GB(long value1, long value2) {
long diff = Math.abs(value1 - value2);
if (diff > G)
throw new RuntimeException("values differ by more than 1GB");
static void checkWithin1GB(long expected, long actual) {
long diff = Math.abs(actual - expected);
if (diff > G) {
String msg = String.format("|actual %d - expected %d| = %d (%f G)",
actual, expected, diff, (float)diff/G);
throw new RuntimeException(msg);
}
}

static void doTests(Path dir) throws IOException {
Expand Down

7 comments on commit e291a67

@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 e291a67 Sep 22, 2023

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on e291a67 Sep 22, 2023

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 e291a67 Sep 22, 2023

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 GoeLin-backport-e291a67e 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 e291a67e from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 1 Jul 2022 and was reviewed by Alan Bateman.

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 GoeLin-backport-e291a67e:GoeLin-backport-e291a67e
$ git checkout GoeLin-backport-e291a67e
# 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 GoeLin-backport-e291a67e

@openjdk
Copy link

@openjdk openjdk bot commented on e291a67 Sep 22, 2023

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 GoeLin-backport-e291a67e 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 e291a67e from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 1 Jul 2022 and was reviewed by Alan Bateman.

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 GoeLin-backport-e291a67e:GoeLin-backport-e291a67e
$ git checkout GoeLin-backport-e291a67e
# 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 GoeLin-backport-e291a67e

@SoniaZaldana
Copy link
Member

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on e291a67 Nov 6, 2023

Choose a reason for hiding this comment

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

@SoniaZaldana the backport was successfully created on the branch SoniaZaldana-backport-e291a67e in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-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 e291a67e from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 1 Jul 2022 and was reviewed by Alan Bateman.

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/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git SoniaZaldana-backport-e291a67e:SoniaZaldana-backport-e291a67e
$ git checkout SoniaZaldana-backport-e291a67e
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git SoniaZaldana-backport-e291a67e

Please sign in to comment.