diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-04-05 12:30:13 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-04-05 12:30:13 +0400 |
commit | 63481100b18b8f79e83b063e0aa04eb983525137 (patch) | |
tree | 793136eea833658b60ed6f5d9094daa3b3106333 | |
parent | 129c8a0e81500955b20de544a26a0cc500c7fcd2 (diff) |
* winsup.api/devdsp.c (ioctltest): Add 2 tests for ioctl codes
SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS.
-rw-r--r-- | winsup/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/devdsp.c | 22 |
2 files changed, 25 insertions, 2 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index fa53a2f3f..37c569d24 100644 --- a/winsup/testsuite/ChangeLog +++ b/winsup/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-04-04 Gerd Spalink <Gerd.Spalink@t-online.de> + + * winsup.api/devdsp.c (ioctltest): Add 2 tests for ioctl codes + SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS. + 2004-03-24 Gerd Spalink <Gerd.Spalink@t-online.de> * winsup.api/devdsp.c: New file, testing fhandler_dev_dsp code. diff --git a/winsup/testsuite/winsup.api/devdsp.c b/winsup/testsuite/winsup.api/devdsp.c index 81d664ada..087ff3eaf 100644 --- a/winsup/testsuite/winsup.api/devdsp.c +++ b/winsup/testsuite/winsup.api/devdsp.c @@ -35,8 +35,8 @@ static const char wavfile_okay[] = }; /* Globals required by libltp */ -const char *TCID = "devdsp"; /* set test case identifier */ -int TST_TOTAL = 32; +const char *TCID = "devdsp"; /* set test case identifier */ +int TST_TOTAL = 34; /* Prototypes */ void sinegen (void *wave, int rate, int bits, int len, int stride); @@ -92,6 +92,7 @@ ioctltest (void) { int audio1; int ioctl_par; + int channels; audio1 = open ("/dev/dsp", O_WRONLY); if (audio1 < 0) @@ -99,6 +100,18 @@ ioctltest (void) tst_brkm (TFAIL, cleanup, "open W: %s", strerror (errno)); } setpars (audio1, 44100, 1, 16); + + channels = ioctl_par = 1; + while (ioctl (audio1, SNDCTL_DSP_CHANNELS, &ioctl_par) == 0) + { + channels++; + ioctl_par = channels; + } + if (channels == ioctl_par) + tst_resm (TFAIL, "Max channels=%d failed", ioctl_par); + else + tst_resm (TPASS, "Max channels=%d failed, OK=%d", channels, ioctl_par); + /* Note: block size may depend on parameters */ if (ioctl (audio1, SNDCTL_DSP_GETBLKSIZE, &ioctl_par) < 0) { @@ -110,6 +123,11 @@ ioctltest (void) tst_brkm (TFAIL, cleanup, "ioctl GETFMTS: %s", strerror (errno)); } tst_resm (TPASS, "ioctl get formats=%08x", ioctl_par); + if (ioctl (audio1, SNDCTL_DSP_GETCAPS, &ioctl_par) < 0) + { + tst_brkm (TFAIL, cleanup, "ioctl GETCAPS: %s", strerror (errno)); + } + tst_resm (TPASS, "ioctl get caps=%08x", ioctl_par); if (close (audio1) < 0) { tst_brkm (TFAIL, cleanup, "Close audio: %s", strerror (errno)); |