Raymond Toy pushed to branch issue-449-set-timestamp-on-test-file at cmucl / cmucl
Commits:
-
3732db6e
by Raymond Toy at 2025-10-23T08:15:34-07:00
4 changed files:
- bin/run-unit-tests.sh
- tests/os.lisp
- tests/resources/64-bit-timestamp.txt โ tests/resources/64-bit-timestamp-2038.txt
- + tests/resources/64-bit-timestamp-2106.txt
Changes:
| ... | ... | @@ -42,10 +42,13 @@ rm -rf test-tmp |
| 42 | 42 | mkdir test-tmp
|
| 43 | 43 | ln -s /bin/ls test-tmp/ls-link
|
| 44 | 44 | |
| 45 | -# Set the timestamp on 64-bit-timestamp.txt. It's ok if this doesn't
|
|
| 46 | -# work in general, as long as it works on Linux for the stat test in
|
|
| 47 | -# tests/os.lisp.
|
|
| 48 | -touch -d "1 April 2038" tests/resources/64-bit-timestamp.txt
|
|
| 45 | +# Set the timestamps on 64-bit-timestamp-2038.txt and
|
|
| 46 | +# 64-bit-timestamp-2106.txt. The time for the first file is a
|
|
| 47 | +# negative value for a 32-bit time_t. The second file won't fit in a
|
|
| 48 | +# 32-bit time_t value. It's ok if this doesn't work in general, as
|
|
| 49 | +# long as it works on Linux for the stat test in tests/os.lisp.
|
|
| 50 | +touch -d "1 April 2038" tests/resources/64-bit-timestamp-2038.txt
|
|
| 51 | +touch -d "1 April 2106" tests/resources/64-bit-timestamp-2106.txt
|
|
| 49 | 52 | |
| 50 | 53 | # Cleanup temp files and directories that we created during testing.
|
| 51 | 54 | function cleanup {
|
| ... | ... | @@ -36,9 +36,24 @@ |
| 36 | 36 | (assert-eql status 0)))
|
| 37 | 37 | |
| 38 | 38 | #+linux
|
| 39 | -(define-test stat.64-bit-timestamp
|
|
| 39 | +(define-test stat.64-bit-timestamp-2038
|
|
| 40 | 40 | (:tag :issues)
|
| 41 | - (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp.txt"
|
|
| 41 | + (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp-2038.txt"
|
|
| 42 | + cl:*load-pathname*)))
|
|
| 43 | + (assert-true (probe-file test-file))
|
|
| 44 | + (multiple-value-bind (ok st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size
|
|
| 45 | + st-atime st-mtime
|
|
| 46 | + st-ctime st-blksize st-blocks)
|
|
| 47 | + (unix:unix-stat (namestring test-file))
|
|
| 48 | + (declare (ignore st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size
|
|
| 49 | + st-ctime st-blksize st-blocks))
|
|
| 50 | + (assert-true ok)
|
|
| 51 | + (assert-equal 2153718000 st-atime)
|
|
| 52 | + (assert-equal 2153718000 st-mtime))))
|
|
| 53 | + |
|
| 54 | +(define-test stat.64-bit-timestamp-2106
|
|
| 55 | + (:tag :issues)
|
|
| 56 | + (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp-2106.txt"
|
|
| 42 | 57 | cl:*load-pathname*)))
|
| 43 | 58 | (assert-true (probe-file test-file))
|
| 44 | 59 | (multiple-value-bind (ok st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size
|
| ... | ... | @@ -48,5 +63,5 @@ |
| 48 | 63 | (declare (ignore st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev
|
| 49 | 64 | st-ctime st-blksize st-blocks))
|
| 50 | 65 | (assert-true ok)
|
| 51 | - (assert-equal st-atime 2153718000)
|
|
| 52 | - (assert-equal st-mtime 2153718000)))) |
|
| 66 | + (assert-equal 4299548400 st-atime)
|
|
| 67 | + (assert-equal 4299548400 st-mtime)))) |