mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] selftests: rtc: rtctest: fix alarm tests
@ 2018-12-18 21:34 Alexandre Belloni
  2018-12-18 21:34 ` [PATCH 2/2] selftests: rtc: rtctest: add alarm test on minute boundary Alexandre Belloni
  2019-01-02 22:18 ` [PATCH 1/2] selftests: rtc: rtctest: fix alarm tests shuah
  0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-12-18 21:34 UTC (permalink / raw)
  To: Shuah Khan; +Cc: linux-kernel, linux-kselftest, linux-rtc, Alexandre Belloni

Return values for select are not checked properly and timeouts may not be
detected.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 tools/testing/selftests/rtc/rtctest.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
index e20b017e7073..dea4e3d6d9e1 100644
--- a/tools/testing/selftests/rtc/rtctest.c
+++ b/tools/testing/selftests/rtc/rtctest.c
@@ -145,15 +145,12 @@ TEST_F(rtc, alarm_alm_set) {
 
 	rc = select(self->fd + 1, &readfds, NULL, NULL, &tv);
 	ASSERT_NE(-1, rc);
-	EXPECT_NE(0, rc);
+	ASSERT_NE(0, rc);
 
 	/* Disable alarm interrupts */
 	rc = ioctl(self->fd, RTC_AIE_OFF, 0);
 	ASSERT_NE(-1, rc);
 
-	if (rc == 0)
-		return;
-
 	rc = read(self->fd, &data, sizeof(unsigned long));
 	ASSERT_NE(-1, rc);
 	TH_LOG("data: %lx", data);
@@ -202,7 +199,7 @@ TEST_F(rtc, alarm_wkalm_set) {
 
 	rc = select(self->fd + 1, &readfds, NULL, NULL, &tv);
 	ASSERT_NE(-1, rc);
-	EXPECT_NE(0, rc);
+	ASSERT_NE(0, rc);
 
 	rc = read(self->fd, &data, sizeof(unsigned long));
 	ASSERT_NE(-1, rc);
-- 
2.20.0


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

end of thread, other threads:[~2019-01-02 22:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 21:34 [PATCH 1/2] selftests: rtc: rtctest: fix alarm tests Alexandre Belloni
2018-12-18 21:34 ` [PATCH 2/2] selftests: rtc: rtctest: add alarm test on minute boundary Alexandre Belloni
2019-01-02 22:18 ` [PATCH 1/2] selftests: rtc: rtctest: fix alarm tests shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®