Browse Source

Test didnt work on Unix. Assume that ${user.home} is in a partition with some (but finite) space. If anyone runs these tests on a disk array with >1 petabyte, they will still fail.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@531472 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
0bb00fe4f6
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

+ 8
- 5
src/tests/antunit/taskdefs/condition/hasfreespace-test.xml View File

@@ -2,29 +2,32 @@
<project name="hasfreespace-test" default="all" basedir="." xmlns:au="antlib:org.apache.ant.antunit">
<available property="jdk6.available" classname="java.util.ServiceLoader"/>
<property name="partition" value="${user.home}" />
<target name="test-not-enough-space-human" if="jdk6.available">
<au:assertFalse>
<hasfreespace partition="c:" needed="1P"/>
<hasfreespace partition="${partition}" needed="1P"/>
</au:assertFalse>
</target>
<target name="test-enough-space-human" if="jdk6.available">
<au:assertTrue>
<hasfreespace partition="c:" needed="1K"/>
<hasfreespace partition="${partition}" needed="1K"/>
</au:assertTrue>
</target>
<target name="test-not-enough-space" if="jdk6.available">
<property name="long.max-value" value="9223372036854775807"/>
<au:assertFalse>
<hasfreespace partition="c:" needed="${long.max-value}"/>
<hasfreespace partition="${partition}" needed="${long.max-value}"/>
</au:assertFalse>
</target>
<target name="test-enough-space" if="jdk6.available">
<au:assertTrue>
<hasfreespace partition="c:" needed="1"/>
<hasfreespace partition="${partition}" needed="1"/>
</au:assertTrue>
</target>


Loading…
Cancel
Save