diff options
author | Nicholas Sauer <nicksauer@google.com> | 2016-05-19 00:11:35 -0700 |
---|---|---|
committer | Nicholas Sauer <nicksauer@google.com> | 2016-05-19 00:11:35 -0700 |
commit | b7bde9e150684b15950f3da86f19862d6dd24652 (patch) | |
tree | ddb1c9b0622bbabb02d2804a9ba4bd85c536f23f | |
parent | 7993756467f9a5b66961f03e3ca69868db963c91 (diff) | |
download | apache-harmony-b7bde9e150684b15950f3da86f19862d6dd24652.tar.gz |
Fix UnixFileTest#test_getUsableSpace on seed
bug: 28852327
Change-Id: I7744a7ed7f1f5e6630f8c3a9782d9a5539f5e0fe
-rw-r--r-- | luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java b/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java index 960edd5..e457cd1 100644 --- a/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java +++ b/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java @@ -109,11 +109,11 @@ public class UnixFileTest extends TestCase { // exit the subprocess safely proc.waitFor(); - // filter unnecessary information - String[] txtResult = outputResult.resStr - .split("\\D|\\p{javaLowerCase}|\\p{javaUpperCase}"); + // Split the results and look for the matching numerical values + String[] txtResult = outputResult.resStr.split(" "); for (int i = 0, j = 0; i < txtResult.length; i++) { - if (txtResult[i].length() > 3) { + String text = txtResult[i]; + if (text.matches("[0-9]+") && text.length() > 3) { result[j++] = Long.parseLong(txtResult[i]) * 1024L; } } |