public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] tst: Modify tst-clock_adjtime to allow reuse of its code
@ 2021-02-28 22:39 Lukasz Majewski
  2021-02-28 22:39 ` [PATCH 2/3] tst: Add test for adjtimex Lukasz Majewski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lukasz Majewski @ 2021-02-28 22:39 UTC (permalink / raw)
  To: Joseph Myers, Adhemerval Zanella, Florian Weimer, DJ Delorie
  Cc: Paul Eggert, Alistair Francis, Arnd Bergmann, Alistair Francis,
	GNU C Library, Carlos O'Donell, Florian Weimer,
	Zack Weinberg, Lukasz Majewski

The tst-clock_adjtime can be adjusted to be reused for also testing
adjtimex.
---
 sysdeps/unix/sysv/linux/tst-clock_adjtime.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/tst-clock_adjtime.c b/sysdeps/unix/sysv/linux/tst-clock_adjtime.c
index 6b9bb9940c..84a3f19504 100644
--- a/sysdeps/unix/sysv/linux/tst-clock_adjtime.c
+++ b/sysdeps/unix/sysv/linux/tst-clock_adjtime.c
@@ -22,6 +22,11 @@
 #include <support/check.h>
 #include <support/timespec.h>
 
+#ifndef TST_ADJTIME_SYSCALL
+#define TST_ADJTIME_SYSCALL clock_adjtime
+#define TST_ADJTIME_ARGS (CLOCK_REALTIME, &delta)
+#endif
+
 static int
 do_test (void)
 {
@@ -40,7 +45,7 @@ do_test (void)
   delta.time.tv_usec = 0;
   delta.modes = ADJ_SETOFFSET;
 
-  int ret = clock_adjtime (CLOCK_REALTIME, &delta);
+  int ret = TST_ADJTIME_SYSCALL TST_ADJTIME_ARGS;
   if (ret == -1)
     FAIL_EXIT1 ("clock_adjtime failed: %m\n");
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-02 13:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 22:39 [PATCH 1/3] tst: Modify tst-clock_adjtime to allow reuse of its code Lukasz Majewski
2021-02-28 22:39 ` [PATCH 2/3] tst: Add test for adjtimex Lukasz Majewski
2021-03-02 12:24   ` Adhemerval Zanella
2021-02-28 22:39 ` [PATCH 3/3] tst: Add test for ntp_adjtime Lukasz Majewski
2021-03-02 12:25   ` Adhemerval Zanella
2021-03-02 12:23 ` [PATCH 1/3] tst: Modify tst-clock_adjtime to allow reuse of its code Adhemerval Zanella
2021-03-02 13:23   ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).