summaryrefslogtreecommitdiff
path: root/msvc
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@google.com>2023-02-13 11:04:11 -0700
committerTormod Volden <debian.tormod@gmail.com>2023-03-12 12:47:08 +0100
commit71dd672abe52d7c3a9c61373888a32984f0792a7 (patch)
tree20e40e1ca313ed052ccca7a663360aef4b03b937 /msvc
parentd2da7f9b1d52e55142775497ca170d9001e72c16 (diff)
downloadlibusb-71dd672abe52d7c3a9c61373888a32984f0792a7.tar.gz
tests: Add unit test for libusb_set_option
The behavior of libusb_set_option was not matching the documentation when the log level was set in the environment. This has been fixed but a regression test is needed to ensure the behavior does not deviate. This commit adds a set of unit tests to cover some of the functionality of libusb_set_option. Closes #1245 Signed-off-by: Nathan Hjelm <hjelmn@google.com> [Xiaofan: Add Windows setenv/unsetenv wrappers] Signed-off-by: Xiaofan Chen <xiaofanc@gmail.com> [Tormod: Fix test_no_discovery() build on Linux, add msvc build] Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Diffstat (limited to 'msvc')
-rw-r--r--msvc/libusb.sln34
-rw-r--r--msvc/set_option.vcxproj35
2 files changed, 69 insertions, 0 deletions
diff --git a/msvc/libusb.sln b/msvc/libusb.sln
index f117efb..b76246c 100644
--- a/msvc/libusb.sln
+++ b/msvc/libusb.sln
@@ -26,6 +26,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testlibusb", "testlibusb.vc
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb.vcxproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "set_option", "set_option.vcxproj", "{35BD5D4B-5102-4A08-81C0-AAF3285FCB01}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
@@ -430,6 +432,38 @@ Global
{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release-MT|Win32.Build.0 = Release|Win32
{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release-MT|x64.ActiveCfg = Release|x64
{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release-MT|x64.Build.0 = Release|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|ARM.ActiveCfg = Debug|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|ARM.Build.0 = Debug|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|ARM64.Build.0 = Debug|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|Win32.ActiveCfg = Debug|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|Win32.Build.0 = Debug|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|x64.ActiveCfg = Debug|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug|x64.Build.0 = Debug|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|ARM.ActiveCfg = Debug|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|ARM.Build.0 = Debug|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|ARM64.ActiveCfg = Debug|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|ARM64.Build.0 = Debug|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|Win32.ActiveCfg = Debug|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|Win32.Build.0 = Debug|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|x64.ActiveCfg = Debug|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Debug-MT|x64.Build.0 = Debug|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|ARM.ActiveCfg = Release|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|ARM.Build.0 = Release|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|ARM64.ActiveCfg = Release|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|ARM64.Build.0 = Release|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|Win32.ActiveCfg = Release|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|Win32.Build.0 = Release|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|x64.ActiveCfg = Release|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release|x64.Build.0 = Release|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|ARM.ActiveCfg = Release|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|ARM.Build.0 = Release|ARM
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|ARM64.ActiveCfg = Release|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|ARM64.Build.0 = Release|ARM64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|Win32.ActiveCfg = Release|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|Win32.Build.0 = Release|Win32
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|x64.ActiveCfg = Release|x64
+ {35BD5D4B-5102-4A08-81C0-AAF3285FCB01}.Release-MT|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/msvc/set_option.vcxproj b/msvc/set_option.vcxproj
new file mode 100644
index 0000000..ecb86bb
--- /dev/null
+++ b/msvc/set_option.vcxproj
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="ProjectConfigurations.Base.props" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{35BD5D4B-5102-4A08-81C0-AAF3285FCB01}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <Import Project="Configuration.Application.props" />
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="Base.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <ItemGroup>
+ <ClCompile Include="..\tests\set_option.c" />
+ <ClCompile Include="..\tests\testlib.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include=".\config.h" />
+ <ClInclude Include="..\libusb\libusb.h" />
+ <ClInclude Include="..\tests\libusb_testlib.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include=".\libusb_static.vcxproj">
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file