From 52b66f2c8938f1eef9a5e225a2379c94b739dec6 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 6 Feb 2002 22:08:50 +0000 Subject: [PATCH] Disabled streaming output on many of the command tests --- testing/cmd_1.c | 3 ++- testing/cmd_2.c | 3 ++- testing/inttrig.c | 4 +++- testing/main.c | 2 +- testing/mmap.c | 5 ++++- testing/select.c | 4 +++- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/testing/cmd_1.c b/testing/cmd_1.c index 86ce076..404905c 100644 --- a/testing/cmd_1.c +++ b/testing/cmd_1.c @@ -110,8 +110,9 @@ int test_cmd_read_fast_1chan(void) int go; int total=0; int ret; + unsigned int flags = comedi_get_subdevice_flags(device,subdevice); - if(!(comedi_get_subdevice_flags(device,subdevice)&SDF_CMD)){ + if(!(flags&SDF_CMD) || flags&SDF_WRITEABLE){ printf("not applicable\n"); return 0; } diff --git a/testing/cmd_2.c b/testing/cmd_2.c index af6f20e..09142ec 100644 --- a/testing/cmd_2.c +++ b/testing/cmd_2.c @@ -19,8 +19,9 @@ static int get_chunks_per_length(int length); int test_cmd_fifo_depth_check(void) { int len; + unsigned int flags = comedi_get_subdevice_flags(device,subdevice); - if(!(comedi_get_subdevice_flags(device,subdevice)&SDF_CMD)){ + if(!(flags&SDF_CMD) || flags&SDF_WRITEABLE){ printf("not applicable\n"); return 0; } diff --git a/testing/inttrig.c b/testing/inttrig.c index 869cb45..eacb36d 100644 --- a/testing/inttrig.c +++ b/testing/inttrig.c @@ -41,8 +41,10 @@ int test_cmd_start_inttrig(void) int go; int total=0; int ret; + unsigned int flags; - if(!(comedi_get_subdevice_flags(device,subdevice)&SDF_CMD)){ + flags = comedi_get_subdevice_flags(device,subdevice); + if(!(flags&SDF_CMD) || flags&SDF_WRITEABLE){ printf("not applicable\n"); return 0; } diff --git a/testing/main.c b/testing/main.c index f679e5f..b28a460 100644 --- a/testing/main.c +++ b/testing/main.c @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) device = comedi_open(filename); if(!device){ printf("E: comedi_open(\"%s\"): %s\n",filename,strerror(errno)); - exit(0); + exit(1); } print_device_info(); diff --git a/testing/mmap.c b/testing/mmap.c index a859b8f..3cb6637 100644 --- a/testing/mmap.c +++ b/testing/mmap.c @@ -62,8 +62,11 @@ int test_mmap(void) int ret; void *b, *adr; sampl_t *map; + unsigned int flags; - if(!(comedi_get_subdevice_flags(device,subdevice)&SDF_CMD)){ + flags = comedi_get_subdevice_flags(device,subdevice); + + if(!(flags&SDF_CMD) || flags&SDF_WRITEABLE){ printf("not applicable\n"); return 0; } diff --git a/testing/select.c b/testing/select.c index 55e9d2d..1325a48 100644 --- a/testing/select.c +++ b/testing/select.c @@ -27,8 +27,10 @@ int test_read_select(void) int length=100000; fd_set rdset; struct timeval timeout; + unsigned int flags; - if(!(comedi_get_subdevice_flags(device,subdevice)&SDF_CMD)){ + flags = comedi_get_subdevice_flags(device,subdevice); + if(!(flags&SDF_CMD) || flags&SDF_WRITEABLE){ printf("not applicable\n"); return 0; } -- 2.26.2