Skip to content

Commit

Permalink
Minor changes in inspection and unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoozaki committed Mar 5, 2018
1 parent 6e2d95e commit 7168ea6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions UsbInfo/UsbInfo.Tests/UsbInfoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public void TestRootHub()
Assert.NotEmpty(usbDevices);
}

[Fact]
public void TestDeviceFromVid()
{
var usbDevices = UsbInfo.Devices(0x8087);
Assert.NotEmpty(usbDevices);
}

[Fact]
public void TestDeviceFromVidPid()
{
Expand Down
6 changes: 5 additions & 1 deletion UsbInfo/UsbInfo/Interfaces/UsbSupportSpeed.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
namespace UsbInfo.Interfaces
using JetBrains.Annotations;

namespace UsbInfo.Interfaces
{
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public enum UsbSupportSpeed

{
LowSpeed = 0,
FullSpeed,
Expand Down
3 changes: 2 additions & 1 deletion UsbInfo/UsbInfo/Natives/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
using JetBrains.Annotations;
using Microsoft.Win32.SafeHandles;
using UsbInfo.Natives.Types;

Expand Down Expand Up @@ -164,7 +165,7 @@ ref int RequiredSize
[DllImport("setupapi.dll")]
internal static extern PnpConfigrationResult CM_Get_Device_ID_Size(out int pulLen, uint dnDevInst, int uflags = 0);


[AssertionMethod]
internal static void ThrowIfSetLastError(bool result)
{
if (!result)
Expand Down

0 comments on commit 7168ea6

Please sign in to comment.