Fix tests to react correctly to NULL passed to free() functions.
This commit is contained in:
parent
c8d6f4ce49
commit
0851eb7a32
@ -917,7 +917,7 @@ public class LibUSBDeviceTest
|
||||
* Tests the {@link LibUsb#freeConfigDescriptor(ConfigDescriptor)} method
|
||||
* without a descriptor.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test
|
||||
public void testFreeConfigDescriptorWithoutDescriptor()
|
||||
{
|
||||
assumeUsbTestsEnabled();
|
||||
|
||||
@ -273,7 +273,7 @@ public class LibUSBTest
|
||||
* Tests {@link LibUsb#freeDeviceList(DeviceList, boolean)} method without
|
||||
* list.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test
|
||||
public void testFreeDeviceListWithoutList()
|
||||
{
|
||||
assumeUsbTestsEnabled();
|
||||
@ -638,6 +638,17 @@ public class LibUSBTest
|
||||
LibUsb.freeConfigDescriptor(new ConfigDescriptor());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the {@link LibUsb#freeConfigDescriptor(ConfigDescriptor)} method
|
||||
* with null parameter. Must do nothing.
|
||||
*/
|
||||
@Test
|
||||
public void testFreeConfigDescriptorWithNull()
|
||||
{
|
||||
assumeUsbTestsEnabled();
|
||||
LibUsb.freeConfigDescriptor(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the
|
||||
* {@link LibUsb#getSsEndpointCompanionDescriptor(Context, EndpointDescriptor, SsEndpointCompanionDescriptor)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user