Exemple #1
0
 /** Test find all devs null ptr handling. */
 public void testFindAllDevsNullPtrHandling() {
   try {
     Pcap.findAllDevs(null, null);
     fail("Expected a NULL pointer exception.");
   } catch (NullPointerException e) {
     // OK
   }
 }
Exemple #2
0
  /** Test find all devs. */
  public void testFindAllDevs() {
    List<PcapIf> devs = new ArrayList<PcapIf>(); // List filled in by
    // findAllDevs

    int r = Pcap.findAllDevs(devs, errbuf);
    assertEquals(errbuf.toString(), 0, r);
    assertFalse(devs.isEmpty());

    // System.out.println(devs);
  }