diff options
author | EuAndreh <eu@euandre.org> | 2024-01-04 20:36:02 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-01-05 05:47:09 -0300 |
commit | 8492f115890d56c98c1da24b9fdf26bb1b714c05 (patch) | |
tree | 7d90469d2aff11c2e4c8e99e7b46aa8e8eb43008 /src/time | |
parent | Fix the build system. (diff) | |
download | grovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.gz grovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.xz |
Setup stub unit test infrastructure
Diffstat (limited to 'src/time')
39 files changed, 312 insertions, 0 deletions
diff --git a/src/time/__map_file.c b/src/time/__map_file.c index c2b29fe8..8d1e5f29 100644 --- a/src/time/__map_file.c +++ b/src/time/__map_file.c @@ -16,3 +16,11 @@ const char unsigned *__map_file(const char *pathname, size_t *size) __syscall(SYS_close, fd); return map == MAP_FAILED ? 0 : map; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/__month_to_secs.c b/src/time/__month_to_secs.c index 43248fb3..0bab2660 100644 --- a/src/time/__month_to_secs.c +++ b/src/time/__month_to_secs.c @@ -8,3 +8,11 @@ int __month_to_secs(int month, int is_leap) if (is_leap && month >= 2) t+=86400; return t; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/__secs_to_tm.c b/src/time/__secs_to_tm.c index 093d9021..48ef1b91 100644 --- a/src/time/__secs_to_tm.c +++ b/src/time/__secs_to_tm.c @@ -80,3 +80,11 @@ int __secs_to_tm(long long t, struct tm *tm) return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/__tm_to_secs.c b/src/time/__tm_to_secs.c index c29fa985..59705aa4 100644 --- a/src/time/__tm_to_secs.c +++ b/src/time/__tm_to_secs.c @@ -22,3 +22,11 @@ long long __tm_to_secs(const struct tm *tm) t += tm->tm_sec; return t; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/__tz.c b/src/time/__tz.c index c34b3eb7..51efaf17 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -437,3 +437,11 @@ const char *__tm_to_tzname(const struct tm *tm) UNLOCK(lock); return p; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/__year_to_secs.c b/src/time/__year_to_secs.c index b42f5a6d..9b2c0a1a 100644 --- a/src/time/__year_to_secs.c +++ b/src/time/__year_to_secs.c @@ -45,3 +45,11 @@ long long __year_to_secs(long long year, int *is_leap) return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/asctime.c b/src/time/asctime.c index 1febe544..c3653023 100644 --- a/src/time/asctime.c +++ b/src/time/asctime.c @@ -5,3 +5,11 @@ char *asctime(const struct tm *tm) static char buf[26]; return __asctime_r(tm, buf); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/asctime_r.c b/src/time/asctime_r.c index 26809ca2..19d08aa2 100644 --- a/src/time/asctime_r.c +++ b/src/time/asctime_r.c @@ -26,3 +26,11 @@ char *__asctime_r(const struct tm *restrict tm, char *restrict buf) } weak_alias(__asctime_r, asctime_r); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock.c b/src/time/clock.c index 6724012b..c97daba6 100644 --- a/src/time/clock.c +++ b/src/time/clock.c @@ -14,3 +14,11 @@ clock_t clock() return ts.tv_sec*1000000 + ts.tv_nsec/1000; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock_getcpuclockid.c b/src/time/clock_getcpuclockid.c index bce1e8ab..0710a674 100644 --- a/src/time/clock_getcpuclockid.c +++ b/src/time/clock_getcpuclockid.c @@ -13,3 +13,11 @@ int clock_getcpuclockid(pid_t pid, clockid_t *clk) *clk = id; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock_getres.c b/src/time/clock_getres.c index 81c67037..7041ae02 100644 --- a/src/time/clock_getres.c +++ b/src/time/clock_getres.c @@ -19,3 +19,11 @@ int clock_getres(clockid_t clk, struct timespec *ts) * 32-bit arch and we can get result directly into timespec. */ return syscall(SYS_clock_getres, clk, ts); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock_gettime.c b/src/time/clock_gettime.c index 4d2ec22f..ade7ade0 100644 --- a/src/time/clock_gettime.c +++ b/src/time/clock_gettime.c @@ -112,3 +112,11 @@ int __clock_gettime(clockid_t clk, struct timespec *ts) } weak_alias(__clock_gettime, clock_gettime); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c index e195499c..b3e6c016 100644 --- a/src/time/clock_nanosleep.c +++ b/src/time/clock_nanosleep.c @@ -36,3 +36,11 @@ int __clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, stru } weak_alias(__clock_nanosleep, clock_nanosleep); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/clock_settime.c b/src/time/clock_settime.c index 1004ed15..73ed8b61 100644 --- a/src/time/clock_settime.c +++ b/src/time/clock_settime.c @@ -22,3 +22,11 @@ int clock_settime(clockid_t clk, const struct timespec *ts) return syscall(SYS_clock_settime, clk, ts); #endif } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/ctime.c b/src/time/ctime.c index 36029315..3f8d0bd2 100644 --- a/src/time/ctime.c +++ b/src/time/ctime.c @@ -6,3 +6,11 @@ char *ctime(const time_t *t) if (!tm) return 0; return asctime(tm); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/ctime_r.c b/src/time/ctime_r.c index 3e24aa68..b787bbc2 100644 --- a/src/time/ctime_r.c +++ b/src/time/ctime_r.c @@ -5,3 +5,11 @@ char *ctime_r(const time_t *t, char *buf) struct tm tm, *tm_p = localtime_r(t, &tm); return tm_p ? asctime_r(tm_p, buf) : 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/difftime.c b/src/time/difftime.c index 80a18cc0..a4e18342 100644 --- a/src/time/difftime.c +++ b/src/time/difftime.c @@ -4,3 +4,11 @@ double difftime(time_t t1, time_t t0) { return t1-t0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/ftime.c b/src/time/ftime.c index a1734d0f..df2410f0 100644 --- a/src/time/ftime.c +++ b/src/time/ftime.c @@ -10,3 +10,11 @@ int ftime(struct timeb *tp) tp->timezone = tp->dstflag = 0; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/getdate.c b/src/time/getdate.c index 420cd8e4..8a3495ae 100644 --- a/src/time/getdate.c +++ b/src/time/getdate.c @@ -44,3 +44,11 @@ out: pthread_setcancelstate(cs, 0); return ret; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/gettimeofday.c b/src/time/gettimeofday.c index 691f8e90..a5c77fd4 100644 --- a/src/time/gettimeofday.c +++ b/src/time/gettimeofday.c @@ -11,3 +11,11 @@ int gettimeofday(struct timeval *restrict tv, void *restrict tz) tv->tv_usec = (int)ts.tv_nsec / 1000; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/gmtime.c b/src/time/gmtime.c index 6320b637..a10c0e60 100644 --- a/src/time/gmtime.c +++ b/src/time/gmtime.c @@ -6,3 +6,11 @@ struct tm *gmtime(const time_t *t) static struct tm tm; return __gmtime_r(t, &tm); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/gmtime_r.c b/src/time/gmtime_r.c index 22aec2c2..dec31a97 100644 --- a/src/time/gmtime_r.c +++ b/src/time/gmtime_r.c @@ -14,3 +14,11 @@ struct tm *__gmtime_r(const time_t *restrict t, struct tm *restrict tm) } weak_alias(__gmtime_r, gmtime_r); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/localtime.c b/src/time/localtime.c index 52104232..f0db1f3c 100644 --- a/src/time/localtime.c +++ b/src/time/localtime.c @@ -5,3 +5,11 @@ struct tm *localtime(const time_t *t) static struct tm tm; return __localtime_r(t, &tm); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/localtime_r.c b/src/time/localtime_r.c index 1a15b314..7ec42afb 100644 --- a/src/time/localtime_r.c +++ b/src/time/localtime_r.c @@ -19,3 +19,11 @@ struct tm *__localtime_r(const time_t *restrict t, struct tm *restrict tm) } weak_alias(__localtime_r, localtime_r); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/mktime.c b/src/time/mktime.c index bad3f076..afff8fc7 100644 --- a/src/time/mktime.c +++ b/src/time/mktime.c @@ -26,3 +26,11 @@ error: errno = EOVERFLOW; return -1; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/nanosleep.c b/src/time/nanosleep.c index bc9f7895..ab800ae4 100644 --- a/src/time/nanosleep.c +++ b/src/time/nanosleep.c @@ -5,3 +5,11 @@ int nanosleep(const struct timespec *req, struct timespec *rem) { return __syscall_ret(-__clock_nanosleep(CLOCK_REALTIME, 0, req, rem)); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/strftime.c b/src/time/strftime.c index cc53d536..b9565355 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -279,3 +279,11 @@ size_t strftime(char *restrict s, size_t n, const char *restrict f, const struct } weak_alias(__strftime_l, strftime_l); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/strptime.c b/src/time/strptime.c index c54a0d8c..098b7a10 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -204,3 +204,11 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri } return (char *)s; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/time.c b/src/time/time.c index ad0480f9..d957ee6d 100644 --- a/src/time/time.c +++ b/src/time/time.c @@ -8,3 +8,11 @@ time_t time(time_t *t) if (t) *t = ts.tv_sec; return ts.tv_sec; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timegm.c b/src/time/timegm.c index 4e5907d7..ba324cb6 100644 --- a/src/time/timegm.c +++ b/src/time/timegm.c @@ -16,3 +16,11 @@ time_t timegm(struct tm *tm) tm->__tm_zone = __utc; return t; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timer_create.c b/src/time/timer_create.c index 9216b3ab..75e5cd35 100644 --- a/src/time/timer_create.c +++ b/src/time/timer_create.c @@ -131,3 +131,11 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timer_delete.c b/src/time/timer_delete.c index b0bfac09..1d00ceb9 100644 --- a/src/time/timer_delete.c +++ b/src/time/timer_delete.c @@ -12,3 +12,11 @@ int timer_delete(timer_t t) } return __syscall(SYS_timer_delete, t); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timer_getoverrun.c b/src/time/timer_getoverrun.c index e7f891e4..12253b18 100644 --- a/src/time/timer_getoverrun.c +++ b/src/time/timer_getoverrun.c @@ -10,3 +10,11 @@ int timer_getoverrun(timer_t t) } return syscall(SYS_timer_getoverrun, t); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timer_gettime.c b/src/time/timer_gettime.c index 21c9d32c..e35ad83b 100644 --- a/src/time/timer_gettime.c +++ b/src/time/timer_gettime.c @@ -26,3 +26,11 @@ int timer_gettime(timer_t t, struct itimerspec *val) #endif return syscall(SYS_timer_gettime, t, val); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timer_settime.c b/src/time/timer_settime.c index 373f00ce..6c93725f 100644 --- a/src/time/timer_settime.c +++ b/src/time/timer_settime.c @@ -35,3 +35,11 @@ int timer_settime(timer_t t, int flags, const struct itimerspec *restrict val, s #endif return syscall(SYS_timer_settime, t, flags, val, old); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/times.c b/src/time/times.c index c4a100f7..11c3cb24 100644 --- a/src/time/times.c +++ b/src/time/times.c @@ -5,3 +5,11 @@ clock_t times(struct tms *tms) { return __syscall(SYS_times, tms); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c index 40ea9c1c..4915e52c 100644 --- a/src/time/timespec_get.c +++ b/src/time/timespec_get.c @@ -8,3 +8,11 @@ int timespec_get(struct timespec * ts, int base) int ret = __clock_gettime(CLOCK_REALTIME, ts); return ret < 0 ? 0 : base; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/utime.c b/src/time/utime.c index e7592b29..c5d3ef07 100644 --- a/src/time/utime.c +++ b/src/time/utime.c @@ -9,3 +9,11 @@ int utime(const char *path, const struct utimbuf *times) { .tv_sec = times->actime }, { .tv_sec = times->modtime }}) : 0, 0); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/time/wcsftime.c b/src/time/wcsftime.c index 8e1437b3..3fa97bc7 100644 --- a/src/time/wcsftime.c +++ b/src/time/wcsftime.c @@ -69,3 +69,11 @@ size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, cons } weak_alias(__wcsftime_l, wcsftime_l); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif |