Lines Matching +full:self +full:- +full:test
1 // SPDX-License-Identifier: GPL-2.0
3 * This test covers the functionality of userspace-driven ALSA timers. Such timers
21 #define UTIMER_DEFAULT_ID -1
22 #define UTIMER_DEFAULT_FD -1
44 SKIP(return, "This test needs root to run!"); in FIXTURE_SETUP()
46 self->utimer_info = calloc(1, sizeof(*self->utimer_info)); in FIXTURE_SETUP()
47 ASSERT_NE(NULL, self->utimer_info); in FIXTURE_SETUP()
50 self->utimer_info->resolution = (NANO / FRAME_RATE * PERIOD_SIZE); in FIXTURE_SETUP()
55 ASSERT_EQ(ioctl(timer_dev_fd, SNDRV_TIMER_IOCTL_CREATE, self->utimer_info), 0); in FIXTURE_SETUP()
56 ASSERT_GE(self->utimer_info->fd, 0); in FIXTURE_SETUP()
62 close(self->utimer_info->fd); in FIXTURE_TEARDOWN()
63 free(self->utimer_info); in FIXTURE_TEARDOWN()
97 return -1; in parse_timer_result()
103 * This test triggers the timer and counts ticks at the same time. The amount
116 sprintf(command, "./global-timer %d %d %d", SNDRV_TIMER_GLOBAL_UDRIVEN, in TEST_F()
117 self->utimer_info->id, TICKS_COUNT * TIMER_FREQ_SEC + TICKS_RECORDING_DELTA); in TEST_F()
121 buf[TIMER_OUTPUT_BUF_LEN - 1] = 0; in TEST_F()
124 /* global-timer waits for timer to trigger, so start the ticking thread */ in TEST_F()
126 &self->utimer_info->fd); in TEST_F()
140 TEST(wrong_timers_test) { in TEST() function
158 /* Test the NULL as an argument is processed correctly */ in TEST()