Package org.usb4java

Examples of org.usb4java.Transfer


     */
    @Test
    public void testAllocAndFree()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertNotNull(transfer);
        LibUsb.freeTransfer(transfer);

        try
        {
View Full Code Here


     */
    @Test
    public void testDevHandle()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        final DeviceHandle handle = new DeviceHandle();
        this.setPointer(handle, 1);
        final DeviceHandle handle2 = new DeviceHandle();
        this.setPointer(handle2, 2);
        assertNull(transfer.devHandle());
        transfer.setDevHandle(handle);
        assertNotNull(transfer.devHandle());
        assertNotSame(handle, transfer.devHandle());
        assertNotEquals(handle2, transfer.devHandle());
        assertEquals(handle, transfer.devHandle());
        transfer.setDevHandle(null);
        assertNull(transfer.devHandle());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test
    public void testFlags()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertEquals(0, transfer.flags());
        transfer.setFlags((byte) 1);
        assertEquals(1, transfer.flags());
        transfer.setFlags((byte) 0);
        assertEquals(0, transfer.flags());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test
    public void testEndpoint()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertEquals(0, transfer.endpoint());
        transfer.setEndpoint((byte) 1);
        assertEquals(1, transfer.endpoint());
        transfer.setEndpoint((byte) 0);
        assertEquals(0, transfer.endpoint());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test
    public void testType()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertEquals(0, transfer.type());
        transfer.setType((byte) 1);
        assertEquals(1, transfer.type());
        transfer.setType((byte) 0);
        assertEquals(0, transfer.type());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test
    public void testTimeout()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertEquals(0, transfer.timeout());
        transfer.setTimeout(1);
        assertEquals(1, transfer.timeout());
        transfer.setTimeout(0);
        assertEquals(0, transfer.timeout());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test
    public void testGetStatus()
    {
        assumeUsbTestsEnabled();
        final Transfer transfer = LibUsb.allocTransfer(0);
        assertEquals(0, transfer.status());
        LibUsb.freeTransfer(transfer);
    }
View Full Code Here

     */
    @Test(expected = IllegalStateException.class)
    public void testFreeTransferWithUninitializedTransfer()
    {
        assumeUsbTestsEnabled();
        LibUsb.freeTransfer(new Transfer());
    }
View Full Code Here

TOP

Related Classes of org.usb4java.Transfer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.