Navigation Menu

Skip to content

Commit

Permalink
8265421: java/lang/String/StringRepeat.java test is missing a memory …
Browse files Browse the repository at this point in the history
…requirement

Reviewed-by: jlaskey, shade, ryadav
  • Loading branch information
mychris authored and shipilev committed Apr 21, 2021
1 parent b5c92ca commit 7146104
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions test/jdk/java/lang/String/StringRepeat.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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 All @@ -24,24 +24,36 @@
/*
* @test
* @summary This exercises String#repeat patterns and limits.
* @run main/othervm -Xmx2g StringRepeat
* @run main/othervm StringRepeat
*/

/*
* @test
* @summary This exercises String#repeat patterns with 16 * 1024 * 1024 repeats.
* @requires os.maxMemory >= 2G
* @run main/othervm -Xmx2g StringRepeat 16777216
*/

import java.nio.CharBuffer;

public class StringRepeat {
public static void main(String... arg) {
public static void main(String... args) {
if (args.length > 0) {
REPEATS = new int[args.length];
for (int i = 0; i < args.length; ++i) {
REPEATS[i] = Integer.parseInt(args[i]);
}
}
test1();
test2();
}

/*
* Varitions of repeat count.
* Default varitions of repeat count.
*/
static int[] REPEATS = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
32, 64, 128, 256, 512, 1024, 64 * 1024, 1024 * 1024,
16 * 1024 * 1024
32, 64, 128, 256, 512, 1024, 64 * 1024, 1024 * 1024
};

/*
Expand Down

1 comment on commit 7146104

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.