Commit Graph

26 Commits

Author SHA1 Message Date
Aquila Macedo
4aa0077bfc Add regression coverage for utime and utimes "now" handling
Extend timetest to exercise utime(path, NULL) and utimes(path, NULL), so
the older file timestamp wrappers are covered alongside the existing
utimensat()/futimens() "set to now" checks.
2026-03-30 10:42:47 -03:00
Aquila Macedo
483a7a703c Add regression test for utimensat/futimens now handling
Exercise the NULL and UTIME_NOW timestamp paths in timetest so the
file-timestamp "set to now" case is covered by the test suite.
2026-03-27 19:23:49 -03:00
Sammy Tran
a2e406c669 Fix MONOTONIC pthread_cond_timedwait when REALTIME is set 2025-06-13 17:13:43 -04:00
Wolfgang Hommel
a8d6a76906 encourage forced monotonic fix issue reports during test (addresses #366) 2022-02-25 21:36:38 +01:00
Wolfgang Hommel
4bab3179ce Unlock mutex before exiting in case of error (fixes #340) 2021-07-17 19:44:20 +02:00
Wolfgang Hommel
772d9523a7 Do not fail due to timer overrun counter mismatch on GNU/Hurd for now (#287) 2021-02-12 16:59:42 +01:00
Robin Linden
f19d68ea32 Fix make test build failure on gcc 9.3
On Ubuntu 20.04 using gcc 9.3, make test fails due to a deprecated
function (ftime) warning in combination with -Werror in timetest.c.
Since the warning is from a test testing that the deprecated function
can be replaced using LD_PRELOAD, I think it's reasonable to just
silence the warning in that case.
2020-05-28 23:26:25 +02:00
Wolfgang Hommel
3123ad7fe2 Revert "Automake branch" 2019-11-30 09:36:46 +01:00
Michael D. Stemle, Jr
f92d919fb0 Merged master in and cleaned up.
We no longer need the OSX-specific test. Tests are passing, too.
2019-11-27 14:32:15 -05:00
Wolfgang Hommel
ba32d1b01c Added FORCE_MONOTONIC_FIX CFLAG to avoid hangs on timedwait (#202 #142) 2019-08-23 10:29:53 +02:00
Wolfgang Hommel
5ddb237842 Adjusted tests on macOS based on compilation defaults 2019-08-21 18:42:05 +02:00
Michael D. Stemle, Jr
39a85e380c Fixed a _bunch_ of autotools bugs. 2018-10-07 22:38:55 -04:00
Matthias Liertzer
fb91c4fcde Implement a fix for pthread_cond_timedwait with faketime
pthread_cond_timedwait takes an absolute time as an argument, which
the function directly passes on to the kernel via the futex
syscall. In an application this absolute time argument is calculated
via the fake times provided by libfaketime. Since the kernel has no
knowledge of the fake time, pthread_cond_timedwait must be redefined
such that it converts the fake time back to real time before passing
it on.
2018-01-02 02:22:59 +01:00
Adam Borowski
cc4c1c3a29 Fix build failure on x32 (printf warnings).
On x32, time_t is 64-bit to avoid Y2038 problems.  This doesn't play well
using printf("%ld"), and -Werror turns this into a build failure.
2015-03-09 08:39:06 +01:00
Wolfgang Hommel
106818614d Minor source code style fixes 2013-11-07 19:35:18 +01:00
Balint Reczey
1f938d9642 Use SIGUSR1 instead of SIGRTMIN in tests
This will probably fix compilation on Debian GNU/Hurd
2013-10-20 17:28:29 +02:00
Balint Reczey
23200c4321 Fix tests on libc 2.17 2013-10-20 16:43:10 +02:00
Wolfgang Hommel
cee051c2bc avoid unused variables warnings 2013-10-06 13:12:39 +02:00
Wolfgang Hommel
8c1ba7899d improved output readability for timer tests 2013-10-01 13:12:34 +02:00
Balint Reczey
50c6ad4dc2 Provide timer related functions compatible with GLIBC 2.2 and >= 2.3.3 [pr32 @8615959] 2013-09-30 16:36:13 +02:00
Wolfgang Hommel
259a9a0966 Use nanosleep() in faked sleep() and usleep() to avoid rounding issues [rbalint/pr28] 2013-09-04 13:05:04 +02:00
Tomi Ollila
b648b7712d whitespace cleanup
Used (emacs) M-x untabify for whole faketime.c as the prevailing
style in that file used spaces for indentation.

Used M-x delete-trailing-whitespace to all files that had either
trailing whitespace or empty lines at the end of file to remove
those.
2012-08-30 10:46:58 +03:00
Wolfgang Hommel
f07939d948 Minor adaptions for Mac OS X 2011-07-30 10:58:12 +02:00
Lukas Fleischer
5fa942b4cf Cast time_t to unsigned integer when using printf().
Suppress compiler warnings when using "-Wformat".

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
d2108361c0 timetest.c: Add "sys/time.h" include (required for gettimeofday()).
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
cf0ccef687 Move test suite to a separate subdirectory.
* Move test suite related stuff from "src/" to "test/".

* Fix "test.sh" to search for libfaketime libraries in the right place.

* Split up Makefile into two separate Makefiles (one for the main
  program and one for the test suite).

Test cases should go in another directory for the sake of clean code
separation. This will also facilitate the creation of proper Makefiles.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-27 18:50:40 +02:00