From 34ba0e5a8e5d8f9c9ce2b10bcc4887b82130a0c1 Mon Sep 17 00:00:00 2001 From: Gabriel Moyano Date: Wed, 25 May 2022 14:19:11 +0200 Subject: sppps01: Improve default handler test Update #2349. --- testsuites/sptests/sppps01/init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/sppps01/init.c b/testsuites/sptests/sppps01/init.c index 850c21f1f2..996a3a1e16 100644 --- a/testsuites/sptests/sppps01/init.c +++ b/testsuites/sptests/sppps01/init.c @@ -66,6 +66,12 @@ T_TEST_CASE( WaitPPSEventDefaultHandler ) pps_init_abi( &pps_dev.pps ); pps_dev.pps.ppsparam.mode = PPS_CAPTUREASSERT; + /* If no timeout is requested, pps_fetch() doesn't call the default handler */ + memset( &fetch, 0, sizeof( fetch ) ); + status = pps_ioctl( PPS_IOC_FETCH, (caddr_t)&fetch, &pps_dev.pps ); + T_eq_int( status, 0 ); + + fetch.timeout.tv_sec = 1; status = pps_ioctl( PPS_IOC_FETCH, (caddr_t)&fetch, &pps_dev.pps ); T_eq_int( status, ETIMEDOUT ); } -- cgit v1.2.3