Commit 647277c1 authored by Brickner_cp's avatar Brickner_cp

Fixed tests.

parent 71506133
...@@ -340,11 +340,12 @@ namespace PcapDotNet.Core.Test ...@@ -340,11 +340,12 @@ namespace PcapDotNet.Core.Test
using (PacketCommunicator communicator = OpenLiveDevice()) using (PacketCommunicator communicator = OpenLiveDevice())
{ {
communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac); communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac);
communicator.SetKernelBufferSize(50); communicator.SetKernelBufferSize(10);
Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac); Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac);
communicator.SendPacket(packet); communicator.SendPacket(packet);
communicator.ReceivePacket(out packet); communicator.ReceivePacket(out packet);
} }
Assert.Fail();
} }
[TestMethod] [TestMethod]
...@@ -357,12 +358,13 @@ namespace PcapDotNet.Core.Test ...@@ -357,12 +358,13 @@ namespace PcapDotNet.Core.Test
using (PacketCommunicator communicator = OpenLiveDevice()) using (PacketCommunicator communicator = OpenLiveDevice())
{ {
communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac); communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac);
communicator.SetKernelBufferSize(50); communicator.SetKernelBufferSize(10);
Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac); Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac);
communicator.SendPacket(packet); communicator.SendPacket(packet);
int numPacketsGot; int numPacketsGot;
communicator.ReceiveSomePackets(out numPacketsGot, 1, delegate { }); communicator.ReceiveSomePackets(out numPacketsGot, 1, delegate { });
} }
Assert.Fail();
} }
[TestMethod] [TestMethod]
...@@ -375,7 +377,7 @@ namespace PcapDotNet.Core.Test ...@@ -375,7 +377,7 @@ namespace PcapDotNet.Core.Test
using (PacketCommunicator communicator = OpenLiveDevice()) using (PacketCommunicator communicator = OpenLiveDevice())
{ {
communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac); communicator.SetFilter("ether src " + SourceMac + " and ether dst " + DestinationMac);
communicator.SetKernelBufferSize(50); communicator.SetKernelBufferSize(10);
Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac); Packet packet = _random.NextEthernetPacket(100, SourceMac, DestinationMac);
communicator.SendPacket(packet); communicator.SendPacket(packet);
Exception exception = null; Exception exception = null;
...@@ -397,6 +399,8 @@ namespace PcapDotNet.Core.Test ...@@ -397,6 +399,8 @@ namespace PcapDotNet.Core.Test
if (exception != null) if (exception != null)
throw exception; throw exception;
} }
Assert.Fail();
} }
[TestMethod] [TestMethod]
...@@ -406,10 +410,12 @@ namespace PcapDotNet.Core.Test ...@@ -406,10 +410,12 @@ namespace PcapDotNet.Core.Test
using (PacketCommunicator communicator = OpenLiveDevice()) using (PacketCommunicator communicator = OpenLiveDevice())
{ {
communicator.Mode = PacketCommunicatorMode.Statistics; communicator.Mode = PacketCommunicatorMode.Statistics;
communicator.SetKernelBufferSize(50); communicator.SetKernelBufferSize(10);
PacketSampleStatistics statistics; PacketSampleStatistics statistics;
communicator.ReceiveStatistics(out statistics); communicator.ReceiveStatistics(out statistics);
} }
Assert.Fail();
} }
[TestMethod] [TestMethod]
...@@ -419,9 +425,10 @@ namespace PcapDotNet.Core.Test ...@@ -419,9 +425,10 @@ namespace PcapDotNet.Core.Test
using (PacketCommunicator communicator = OpenLiveDevice()) using (PacketCommunicator communicator = OpenLiveDevice())
{ {
communicator.Mode = PacketCommunicatorMode.Statistics; communicator.Mode = PacketCommunicatorMode.Statistics;
communicator.SetKernelBufferSize(50); communicator.SetKernelBufferSize(10);
communicator.ReceiveStatistics(1, delegate { }); communicator.ReceiveStatistics(1, delegate { Assert.Fail(); });
} }
Assert.Fail();
} }
[TestMethod] [TestMethod]
......
...@@ -76,7 +76,7 @@ namespace PcapDotNet.Core.Test ...@@ -76,7 +76,7 @@ namespace PcapDotNet.Core.Test
[TestMethod] [TestMethod]
public void ComparePacketsToWiresharkTest() public void ComparePacketsToWiresharkTest()
{ {
for (int i = 0; i != 100; ++i) for (int i = 0; i != 10; ++i)
{ {
// Create packets // Create packets
List<Packet> packets = new List<Packet>(CreateRandomPackets(100)); List<Packet> packets = new List<Packet>(CreateRandomPackets(100));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment