def test_errors():
    a = linuxaudiodev.open("w")
    size = 8
    fmt = linuxaudiodev.AFMT_U8
    rate = 8000
    nchannels = 1
    try:
        a.setparameters(-1, size, nchannels, fmt)
    except __HOLE__, msg:
        print msg
    try:
        a.setparameters(rate, -2, nchannels, fmt)
    except ValueError, msg:
        print msg
    try:
        a.setparameters(rate, size, 3, fmt)
    except ValueError, msg:
        print msg
    try:
        a.setparameters(rate, size, nchannels, 177)
    except ValueError, msg:
        print msg
    try:
        a.setparameters(rate, size, nchannels, linuxaudiodev.AFMT_U16_LE)
    except ValueError, msg:
        print msg
    try:
        a.setparameters(rate, 16, nchannels, fmt)
    except ValueError, msg:
        print msg
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_linuxaudiodev.py/test_errors