/** Test set and get nonblock. */ public void testSetAndGetNonblock() { Pcap pcap = Pcap.openLive(device, 10000, 1, 60 * 1000, errbuf); assertNotNull(errbuf.toString(), pcap); assertEquals(OK, pcap.getNonBlock(errbuf)); pcap.close(); }
/** Test get non block null ptr handling. */ public void testGetNonBlockNullPtrHandling() { Pcap pcap = Pcap.openOffline(fname, errbuf); try { pcap.getNonBlock(null); fail("Expected a NULL pointer exception."); } catch (NullPointerException e) { // OK } finally { pcap.close(); } }