From eb8dd9dca1228af0cd132f515509051ecfabf6f6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Mon, 14 Apr 2025 17:32:06 +0000 Subject: This commit was manufactured by cvs2git to create tag 'tb_20250414'. --- src/regress/lib/libc/timekeep/Makefile | 5 -- src/regress/lib/libc/timekeep/test_clock_gettime.c | 43 ----------------- src/regress/lib/libc/timekeep/test_gettimeofday.c | 37 --------------- src/regress/lib/libc/timekeep/test_time_skew.c | 55 ---------------------- 4 files changed, 140 deletions(-) delete mode 100644 src/regress/lib/libc/timekeep/Makefile delete mode 100644 src/regress/lib/libc/timekeep/test_clock_gettime.c delete mode 100644 src/regress/lib/libc/timekeep/test_gettimeofday.c delete mode 100644 src/regress/lib/libc/timekeep/test_time_skew.c (limited to 'src/regress/lib/libc/timekeep') diff --git a/src/regress/lib/libc/timekeep/Makefile b/src/regress/lib/libc/timekeep/Makefile deleted file mode 100644 index ed7dc60379..0000000000 --- a/src/regress/lib/libc/timekeep/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2020/07/06 13:33:06 pirofti Exp $ - -PROGS= test_clock_gettime test_time_skew test_gettimeofday - -.include diff --git a/src/regress/lib/libc/timekeep/test_clock_gettime.c b/src/regress/lib/libc/timekeep/test_clock_gettime.c deleted file mode 100644 index cc1d8e36e3..0000000000 --- a/src/regress/lib/libc/timekeep/test_clock_gettime.c +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: test_clock_gettime.c,v 1.1 2020/07/06 13:33:06 pirofti Exp $ */ -/* - * Copyright (c) 2020 Paul Irofti - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include - -#define ASSERT_EQ(a, b) assert((a) == (b)) - -void -check() -{ - struct timespec tp = {0}; - - ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &tp)); - ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &tp)); - ASSERT_EQ(0, clock_gettime(CLOCK_BOOTTIME, &tp)); - ASSERT_EQ(0, clock_gettime(CLOCK_UPTIME, &tp)); - - - ASSERT_EQ(0, clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp)); - ASSERT_EQ(0, clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)); - -} - -int main() -{ - check(); - return 0; -} diff --git a/src/regress/lib/libc/timekeep/test_gettimeofday.c b/src/regress/lib/libc/timekeep/test_gettimeofday.c deleted file mode 100644 index 914058505d..0000000000 --- a/src/regress/lib/libc/timekeep/test_gettimeofday.c +++ /dev/null @@ -1,37 +0,0 @@ -/* $OpenBSD: test_gettimeofday.c,v 1.1 2020/07/06 13:33:06 pirofti Exp $ */ -/* - * Copyright (c) 2020 Paul Irofti - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include - -#define ASSERT_EQ(a, b) assert((a) == (b)) - -void -check() -{ - struct timeval tv = {0}; - struct timezone tzp; - - ASSERT_EQ(0, gettimeofday(&tv, NULL)); - ASSERT_EQ(0, gettimeofday(&tv, &tzp)); -} - -int main() -{ - check(); - return 0; -} diff --git a/src/regress/lib/libc/timekeep/test_time_skew.c b/src/regress/lib/libc/timekeep/test_time_skew.c deleted file mode 100644 index 7871795f06..0000000000 --- a/src/regress/lib/libc/timekeep/test_time_skew.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: test_time_skew.c,v 1.1 2020/07/06 13:33:06 pirofti Exp $ */ -/* - * Copyright (c) 2020 Paul Irofti - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include - -#include -#include -#include -#include - -#define ASSERT_EQ(a, b) assert((a) == (b)) -#define ASSERT_NE(a, b) assert((a) != (b)) - -void -check() -{ - struct timespec tp1, tp2, tout; - - tout.tv_sec = 0; - tout.tv_nsec = 100000; - - ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &tp1)); - - nanosleep(&tout, NULL); - - ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &tp2)); - - /* tp1 should never be larger than tp2 */ - ASSERT_NE(1, timespeccmp(&tp1, &tp2, >)); -} - -int -main(void) -{ - int i; - - for (i = 0; i < 1000; i++) - check(); - - return 0; -} -- cgit v1.2.3-55-g6feb