diff mbox series

[3/3] tst: Add test for ntp_adjtime

Message ID 20210228223938.8304-3-lukma@denx.de
State Committed
Delegated to: Adhemerval Zanella Netto
Headers show
Series [1/3] tst: Modify tst-clock_adjtime to allow reuse of its code | expand

Commit Message

Lukasz Majewski Feb. 28, 2021, 10:39 p.m. UTC
This test is a wrapper on tst-clock_adjtime test.
---
 sysdeps/unix/sysv/linux/Makefile          |  2 +-
 sysdeps/unix/sysv/linux/tst-ntp_adjtime.c | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime.c

Comments

Adhemerval Zanella March 2, 2021, 12:25 p.m. UTC | #1
On 28/02/2021 19:39, Lukasz Majewski wrote:
> This test is a wrapper on tst-clock_adjtime test.

LGTM, although the simplification also applies here.

> ---
>  sysdeps/unix/sysv/linux/Makefile          |  2 +-
>  sysdeps/unix/sysv/linux/tst-ntp_adjtime.c | 23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 1 deletion(-)
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime.c
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 5c067fd12b..57b39dce63 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -112,7 +112,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>  	 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
>  	 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
>  	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
> -	 tst-clock_adjtime tst-adjtimex
> +	 tst-clock_adjtime tst-adjtimex tst-ntp_adjtime
>  
>  tests-y2038 += \
>  	 tst-futimens-y2038 \

Ok.

> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c b/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c
> new file mode 100644
> index 0000000000..11066048dc
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c
> @@ -0,0 +1,23 @@
> +/* Test for ntp_adjtime.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/timex.h>
> +#define TST_ADJTIME_SYSCALL ntp_adjtime
> +#define TST_ADJTIME_ARGS (&delta)
> +
> +#include "tst-clock_adjtime.c"
> 

OK.
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 5c067fd12b..57b39dce63 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -112,7 +112,7 @@  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
 	 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
 	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
-	 tst-clock_adjtime tst-adjtimex
+	 tst-clock_adjtime tst-adjtimex tst-ntp_adjtime
 
 tests-y2038 += \
 	 tst-futimens-y2038 \
diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c b/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c
new file mode 100644
index 0000000000..11066048dc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime.c
@@ -0,0 +1,23 @@ 
+/* Test for ntp_adjtime.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/timex.h>
+#define TST_ADJTIME_SYSCALL ntp_adjtime
+#define TST_ADJTIME_ARGS (&delta)
+
+#include "tst-clock_adjtime.c"