1 /*
2  * v4l-test: Test environment for Video For Linux Two API
3  *
4  * 27 Mar 2009  0.2  Clean up ret and errno variable names and dprintf() output
5  * 23 Dec 2008  0.1  First release
6  *
7  * Written by M�rton N�meth <nm127@freemail.hu>
8  * Released under GPL
9  */
10 
11 #include <stdio.h>
12 #include <sys/types.h>
13 #include <sys/stat.h>
14 #include <fcntl.h>
15 #include <unistd.h>
16 #include <sys/ioctl.h>
17 #include <errno.h>
18 #include <string.h>
19 
20 #include <linux/videodev2.h>
21 #include <linux/errno.h>
22 
23 #include <CUnit/CUnit.h>
24 
25 #include "v4l2_test.h"
26 #include "dev_video.h"
27 #include "video_limits.h"
28 
29 #include "test_VIDIOC_LOG_STATUS.h"
30 
test_VIDIOC_LOG_STATUS()31 void test_VIDIOC_LOG_STATUS()
32 {
33 	int ret_log, errno_log;
34 
35 	ret_log = ioctl(get_video_fd(), VIDIOC_LOG_STATUS);
36 	errno_log = errno;
37 
38 	dprintf("\t%s:%u: ret_log=%i, errno_log=%i\n",
39 		__FILE__, __LINE__, ret_log, errno_log);
40 
41 	/* this is an optional ioctl, so two possible return values */
42 	/* are possible */
43 	if (ret_log == 0) {
44 		CU_ASSERT_EQUAL(ret_log, 0);
45 		/* TODO: check if something is shown in dmesg */
46 
47 	} else {
48 		CU_ASSERT_EQUAL(ret_log, -1);
49 		CU_ASSERT_EQUAL(errno_log, EINVAL);
50 	}
51 }
52