Пример #1
0
  /** 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();
  }
Пример #2
0
 /** 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();
   }
 }