Browse Source

Make touchtest pass on Win2

PR:
Obtained from:
Submitted by:
Reviewed by:
Make touchtest pass on Win2K / FAT
Dates earlier than 1990 seem not to work for me
as last modified dates of files


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276060 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
487f084e0c
2 changed files with 18 additions and 10 deletions
  1. +13
    -5
      src/etc/testcases/taskdefs/touch.xml
  2. +5
    -5
      src/testcases/org/apache/tools/ant/taskdefs/TouchTest.java

+ 13
- 5
src/etc/testcases/taskdefs/touch.xml View File

@@ -18,21 +18,29 @@
</target> </target>
<target name="testMillis"> <target name="testMillis">
<touch file="touchtest" millis="1234567" />
<!-- this one is about 21 years after the epoch -->
<!-- less than 20 years after the epoch, test does not pass on my Win2K/FAT -->
<!-- Antoine February 8, 2004 -->
<!-- see http://developer.java.sun.com/developer/bugParade/bugs/4177432.html -->
<!-- and http://developer.java.sun.com/developer/bugParade/bugs/4697792.html -->
<!-- not sure why -->
<touch file="touchtest" millis="662256000000" />
</target> </target>
<target name="test1970">
<touch file="touchtest" millis="0" />
<target name="test2000">
<!-- this number of milliseconds is 30 * 365 * 24 * 3600 * 1000 -->
<!-- so the corresponding time is at the end of 1999 -->
<touch file="touchtest" millis="946080000000" />
</target> </target>
<target name="testFilelist"> <target name="testFilelist">
<touch millis="100000" >
<touch millis="662256000000" >
<filelist dir="." files="touchtest"/> <filelist dir="." files="touchtest"/>
</touch> </touch>
</target> </target>


<target name="testFileset" depends="testNow"> <target name="testFileset" depends="testNow">
<touch millis="200000" >
<touch millis="946080000000" >
<fileset dir="." includes="touchtest"/> <fileset dir="." includes="touchtest"/>
</touch> </touch>
</target> </target>


+ 5
- 5
src/testcases/org/apache/tools/ant/taskdefs/TouchTest.java View File

@@ -69,7 +69,7 @@ public class TouchTest extends BuildFileTest {
* verify that the millis test sets things up * verify that the millis test sets things up
*/ */
public void testMillis() { public void testMillis() {
touchFile("testMillis", 1234567);
touchFile("testMillis", 662256000000L);
} }


/** /**
@@ -84,22 +84,22 @@ public class TouchTest extends BuildFileTest {
/** /**
* verify that the millis test sets things up * verify that the millis test sets things up
*/ */
public void test1970() {
touchFile("test1970", 0);
public void test2000() {
touchFile("test2000", 946080000000L);
} }


/** /**
* test the file list * test the file list
*/ */
public void testFilelist() { public void testFilelist() {
touchFile("testFilelist", 100000);
touchFile("testFilelist", 662256000000L);
} }


/** /**
* test the file set * test the file set
*/ */
public void testFileset() { public void testFileset() {
touchFile("testFileset", 200000);
touchFile("testFileset", 946080000000L);
} }


/** /**


Loading…
Cancel
Save