public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/y2038] time: Add basic timespec_get tests
@ 2021-03-04 17:38 Adhemerval Zanella
0 siblings, 0 replies; 5+ messages in thread
From: Adhemerval Zanella @ 2021-03-04 17:38 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=074af1dc74d5f9c9d0e26ada4602454f1ba08c64
commit 074af1dc74d5f9c9d0e26ada4602454f1ba08c64
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 1 13:14:03 2021 -0300
time: Add basic timespec_get tests
Checkec on x86_64-linux-gnu and i686-linux-gnu.
Diff:
---
time/Makefile | 2 +-
time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/time/Makefile b/time/Makefile
index 5d865a4054..29208f35c0 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
- tst-itimer tst-gmtime tst-timegm
+ tst-itimer tst-gmtime tst-timegm tst-timespec_get
include ../Rules
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+ 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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, 0), 0);
+ }
+
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+ TEST_VERIFY (ts.tv_nsec >= 0);
+ TEST_VERIFY (ts.tv_nsec < 1000000000);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [glibc/azanella/y2038] time: Add basic timespec_get tests
@ 2021-03-05 19:18 Adhemerval Zanella
0 siblings, 0 replies; 5+ messages in thread
From: Adhemerval Zanella @ 2021-03-05 19:18 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1e25ad266046018f4c86804417f2aa1124640840
commit 1e25ad266046018f4c86804417f2aa1124640840
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 1 13:14:03 2021 -0300
time: Add basic timespec_get tests
Checkec on x86_64-linux-gnu and i686-linux-gnu.
Diff:
---
time/Makefile | 2 +-
time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/time/Makefile b/time/Makefile
index 786dc45b51..f14022b334 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \
- tst-gmtime tst-timegm
+ tst-gmtime tst-timegm tst-timespec_get
include ../Rules
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+ 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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, 0), 0);
+ }
+
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+ TEST_VERIFY (ts.tv_nsec >= 0);
+ TEST_VERIFY (ts.tv_nsec < 1000000000);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [glibc/azanella/y2038] time: Add basic timespec_get tests
@ 2021-03-04 11:30 Adhemerval Zanella
0 siblings, 0 replies; 5+ messages in thread
From: Adhemerval Zanella @ 2021-03-04 11:30 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=074af1dc74d5f9c9d0e26ada4602454f1ba08c64
commit 074af1dc74d5f9c9d0e26ada4602454f1ba08c64
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 1 13:14:03 2021 -0300
time: Add basic timespec_get tests
Checkec on x86_64-linux-gnu and i686-linux-gnu.
Diff:
---
time/Makefile | 2 +-
time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/time/Makefile b/time/Makefile
index 5d865a4054..29208f35c0 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
- tst-itimer tst-gmtime tst-timegm
+ tst-itimer tst-gmtime tst-timegm tst-timespec_get
include ../Rules
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+ 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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, 0), 0);
+ }
+
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+ TEST_VERIFY (ts.tv_nsec >= 0);
+ TEST_VERIFY (ts.tv_nsec < 1000000000);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [glibc/azanella/y2038] time: Add basic timespec_get tests
@ 2021-03-02 12:32 Adhemerval Zanella
0 siblings, 0 replies; 5+ messages in thread
From: Adhemerval Zanella @ 2021-03-02 12:32 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9bf8d81540ff170161d549226ffee52ff65d6085
commit 9bf8d81540ff170161d549226ffee52ff65d6085
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 1 13:14:03 2021 -0300
time: Add basic timespec_get tests
Checkec on x86_64-linux-gnu and i686-linux-gnu.
Diff:
---
time/Makefile | 2 +-
time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/time/Makefile b/time/Makefile
index 5d865a4054..29208f35c0 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
- tst-itimer tst-gmtime tst-timegm
+ tst-itimer tst-gmtime tst-timegm tst-timespec_get
include ../Rules
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+ 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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, 0), 0);
+ }
+
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+ TEST_VERIFY (ts.tv_nsec >= 0);
+ TEST_VERIFY (ts.tv_nsec < 1000000000);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [glibc/azanella/y2038] time: Add basic timespec_get tests
@ 2021-03-01 17:37 Adhemerval Zanella
0 siblings, 0 replies; 5+ messages in thread
From: Adhemerval Zanella @ 2021-03-01 17:37 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=85009e66caf542e8d4b9358139f8e9ae97cf135b
commit 85009e66caf542e8d4b9358139f8e9ae97cf135b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 1 13:14:03 2021 -0300
time: Add basic timespec_get tests
Checkec on x86_64-linux-gnu and i686-linux-gnu.
Diff:
---
time/Makefile | 2 +-
time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/time/Makefile b/time/Makefile
index 5d865a4054..29208f35c0 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
- tst-itimer tst-gmtime tst-timegm
+ tst-itimer tst-gmtime tst-timegm tst-timespec_get
include ../Rules
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+ 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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, 0), 0);
+ }
+
+ {
+ struct timespec ts;
+ TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+ TEST_VERIFY (ts.tv_nsec >= 0);
+ TEST_VERIFY (ts.tv_nsec < 1000000000);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-05 19:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 17:38 [glibc/azanella/y2038] time: Add basic timespec_get tests Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2021-03-05 19:18 Adhemerval Zanella
2021-03-04 11:30 Adhemerval Zanella
2021-03-02 12:32 Adhemerval Zanella
2021-03-01 17:37 Adhemerval Zanella
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).