Skip to content

Commit

Permalink
Fixed casting. Disabled performance test cases in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Feb 22, 2019
1 parent f18ab00 commit e51a2dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SharpPcap/LibPcap/PcapStatistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ internal PcapStatistics(IntPtr pcap_t)
typeof(PcapUnmanagedStructures.pcap_stat_unix));

// copy the values
this.ReceivedPackets = (uint)managedStat.ps_recv;
this.DroppedPackets = (uint)managedStat.ps_drop;
this.ReceivedPackets = (uint)managedStat.ps_recv.ToInt64();
this.DroppedPackets = (uint)managedStat.ps_drop.ToInt64();
// this.InterfaceDroppedPackets = (uint)managedStat.ps_ifdrop;
} else
{
Expand Down
3 changes: 3 additions & 0 deletions Test/Performance/PacketParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class PacketParsing
{
private int packetsToRead = 50000000;

[Category("Performance")]
[Test]
public void Benchmark()
{
Expand Down Expand Up @@ -46,6 +47,7 @@ public void Benchmark()
/// <summary>
/// Test the performance of a device used via the ICaptureDevice interface
/// </summary>
[Category("Performance")]
[Test]
public void BenchmarkICaptureDevice()
{
Expand Down Expand Up @@ -82,6 +84,7 @@ public void BenchmarkICaptureDevice()
/// <summary>
/// Test the performance of a device used via the ICaptureDevice interface
/// </summary>
[Category("Performance")]
[Test]
public unsafe void BenchmarkICaptureDeviceUnsafe()
{
Expand Down
3 changes: 3 additions & 0 deletions Test/Performance/PacketReading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class PacketReading
{
private int packetsToRead = 50000000;

[Category("Performance")]
[Test]
public void Benchmark()
{
Expand Down Expand Up @@ -37,6 +38,7 @@ public void Benchmark()
Console.WriteLine("{0}", rate.ToString());
}

[Category("Performance")]
[Test]
public void BenchmarkICaptureDevice()
{
Expand Down Expand Up @@ -65,6 +67,7 @@ public void BenchmarkICaptureDevice()
Console.WriteLine("{0}", rate.ToString());
}

[Category("Performance")]
[Test]
public unsafe void BenchmarkICaptureDeviceUnsafe()
{
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sudo apt-get install -y libpcap-dev
- script: |
set -e
sudo dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx
sudo dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx --filter TestCategory!=Performance
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand All @@ -42,7 +42,7 @@ jobs:
- script: |
sudo sysctl -w net.inet.udp.maxdgram=65535
set -e
sudo dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx
sudo dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx --filter TestCategory!=Performance
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand All @@ -63,7 +63,7 @@ jobs:
- script: choco install -y winpcap
displayName: 'Install WinPcap'
- script: |
dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx --collect "Code coverage"
dotnet test Test/Test.csproj --configuration $(buildConfiguration) --logger trx --collect "Code coverage" --filter TestCategory!=Performance
displayName: 'Build and test'
- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down

0 comments on commit e51a2dc

Please sign in to comment.