Fix FileTest.
FileTest.testParent expects "user.home" to be non empty. The test
uses "user.home" because the author of the test (mistakenly) assumed
that calling "new File(path)" creates a new file. The value can be
safely replaced by a non-empty and non-existent path.
This test was broken by commit 566618403d002719a94a6624 changed
"user.home" from "/" to "" to match the documented value of the
property and to match all older versions of android *except* for
kitkat (which sets "/").
Note that this test is new with "L".
bug: 17906647
Change-Id: I21ca18c8d53095c37a9068ce18bcf937a0ccf877
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/FileTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/FileTest.java
index ea7b2ea..5cc88f4 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/FileTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/FileTest.java
@@ -903,10 +903,9 @@
public void test_getParent() {
File f = new File("p.tst");
assertNull("Incorrect path returned", f.getParent());
- f = new File(System.getProperty("user.home"), "p.tst");
+ f = new File("/user/home/p.tst");
assertEquals("Incorrect path returned",
- System.getProperty("user.home"), f.getParent());
- f.delete();
+ "/user/home", f.getParent());
File f1 = new File("/directory");
assertEquals("Wrong parent test 1", File.separator, f1.getParent());