usb 2.12.1 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/index.js +6 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/usb/bindings.js +1 -1
  6. package/dist/usb/bindings.js.map +1 -1
  7. package/dist/usb/capability.js.map +1 -1
  8. package/dist/usb/device.js.map +1 -1
  9. package/dist/usb/endpoint.d.ts +1 -0
  10. package/dist/usb/endpoint.js +2 -2
  11. package/dist/usb/endpoint.js.map +1 -1
  12. package/dist/usb/index.js.map +1 -1
  13. package/dist/usb/interface.js +2 -2
  14. package/dist/usb/interface.js.map +1 -1
  15. package/dist/webusb/index.d.ts +2 -2
  16. package/dist/webusb/index.js.map +1 -1
  17. package/dist/webusb/webusb-device.js +10 -10
  18. package/dist/webusb/webusb-device.js.map +1 -1
  19. package/libusb/.codespellrc +3 -0
  20. package/libusb/.private/appveyor_build.sh +5 -1
  21. package/libusb/.private/ci-build.sh +26 -1
  22. package/libusb/.private/ci-container-build.sh +2 -5
  23. package/libusb/.private/wbs.txt +5 -8
  24. package/libusb/AUTHORS +22 -0
  25. package/libusb/ChangeLog +19 -2
  26. package/libusb/HACKING +25 -0
  27. package/libusb/INSTALL_WIN.txt +11 -10
  28. package/libusb/NEWS +2 -2
  29. package/libusb/README +3 -2
  30. package/libusb/README.git +1 -1
  31. package/libusb/Xcode/common.xcconfig +8 -1
  32. package/libusb/Xcode/config.h +0 -6
  33. package/libusb/Xcode/debug.xcconfig +4 -1
  34. package/libusb/Xcode/libusb.xcconfig +1 -1
  35. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +60 -30
  36. package/libusb/Xcode/libusb_debug.xcconfig +1 -1
  37. package/libusb/Xcode/libusb_release.xcconfig +1 -1
  38. package/libusb/Xcode/release.xcconfig +1 -1
  39. package/libusb/appveyor.yml +33 -9
  40. package/libusb/configure.ac +68 -37
  41. package/libusb/examples/dpfp.c +2 -2
  42. package/libusb/examples/fxload.c +2 -2
  43. package/libusb/examples/hotplugtest.c +28 -13
  44. package/libusb/examples/listdevs.c +1 -1
  45. package/libusb/examples/sam3u_benchmark.c +1 -1
  46. package/libusb/examples/testlibusb.c +1 -1
  47. package/libusb/examples/xusb.c +74 -19
  48. package/libusb/libusb/Makefile.am +11 -1
  49. package/libusb/libusb/core.c +364 -186
  50. package/libusb/libusb/descriptor.c +276 -16
  51. package/libusb/libusb/hotplug.c +5 -4
  52. package/libusb/libusb/io.c +72 -61
  53. package/libusb/libusb/libusb-1.0.def +14 -1
  54. package/libusb/libusb/libusb.h +245 -76
  55. package/libusb/libusb/libusbi.h +35 -13
  56. package/libusb/libusb/os/darwin_usb.c +542 -279
  57. package/libusb/libusb/os/darwin_usb.h +44 -115
  58. package/libusb/libusb/os/emscripten_webusb.cpp +870 -0
  59. package/libusb/libusb/os/events_posix.c +40 -0
  60. package/libusb/libusb/os/events_posix.h +3 -0
  61. package/libusb/libusb/os/linux_usbfs.c +27 -16
  62. package/libusb/libusb/os/netbsd_usb.c +36 -36
  63. package/libusb/libusb/os/openbsd_usb.c +34 -34
  64. package/libusb/libusb/os/sunos_usb.c +25 -15
  65. package/libusb/libusb/os/threads_posix.c +1 -5
  66. package/libusb/libusb/os/windows_common.c +13 -5
  67. package/libusb/libusb/os/windows_common.h +8 -0
  68. package/libusb/libusb/os/windows_winusb.c +366 -174
  69. package/libusb/libusb/os/windows_winusb.h +13 -9
  70. package/libusb/libusb/strerror.c +5 -5
  71. package/libusb/libusb/sync.c +24 -19
  72. package/libusb/libusb/version.h +1 -1
  73. package/libusb/libusb/version_nano.h +1 -1
  74. package/libusb/msvc/Base.props +60 -0
  75. package/libusb/msvc/Configuration.Application.props +7 -0
  76. package/libusb/msvc/Configuration.Base.props +47 -0
  77. package/libusb/msvc/Configuration.DynamicLibrary.props +21 -0
  78. package/libusb/msvc/Configuration.StaticLibrary.props +7 -0
  79. package/libusb/msvc/ProjectConfigurations.Base.props +69 -0
  80. package/libusb/msvc/build_all.ps1 +17 -0
  81. package/libusb/msvc/config.h +2 -2
  82. package/libusb/msvc/dpfp.vcxproj +33 -0
  83. package/libusb/msvc/dpfp_threaded.vcxproj +38 -0
  84. package/libusb/msvc/fxload.vcxproj +46 -0
  85. package/libusb/msvc/getopt.vcxproj +33 -0
  86. package/libusb/msvc/hotplugtest.vcxproj +32 -0
  87. package/libusb/msvc/init_context.vcxproj +35 -0
  88. package/libusb/msvc/libusb.sln +542 -0
  89. package/libusb/msvc/libusb_dll.vcxproj +61 -0
  90. package/libusb/msvc/libusb_static.vcxproj +49 -0
  91. package/libusb/msvc/listdevs.vcxproj +32 -0
  92. package/libusb/msvc/sam3u_benchmark.vcxproj +33 -0
  93. package/libusb/msvc/set_option.vcxproj +35 -0
  94. package/libusb/msvc/stress.vcxproj +35 -0
  95. package/libusb/msvc/stress_mt.vcxproj +33 -0
  96. package/libusb/msvc/testlibusb.vcxproj +32 -0
  97. package/libusb/msvc/xusb.vcxproj +38 -0
  98. package/libusb/tests/Makefile.am +25 -3
  99. package/libusb/tests/init_context.c +153 -0
  100. package/libusb/tests/macos.c +130 -0
  101. package/libusb/tests/set_option.c +253 -0
  102. package/libusb/tests/stress.c +17 -14
  103. package/libusb/tests/stress_mt.c +265 -0
  104. package/libusb/tests/testlib.c +1 -1
  105. package/libusb/tests/umockdev.c +9 -9
  106. package/libusb/tests/webusb-test-shim/index.js +12 -0
  107. package/libusb/tests/webusb-test-shim/package-lock.json +50 -0
  108. package/libusb/tests/webusb-test-shim/package.json +10 -0
  109. package/package.json +7 -7
  110. package/prebuilds/android-arm/node.napi.armv7.node +0 -0
  111. package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
  112. package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
  113. package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
  114. package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
  115. package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
  116. package/prebuilds/linux-ia32/node.napi.node +0 -0
  117. package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  118. package/prebuilds/linux-x64/node.napi.musl.node +0 -0
  119. package/prebuilds/win32-arm64/node.napi.node +0 -0
  120. package/prebuilds/win32-ia32/node.napi.node +0 -0
  121. package/prebuilds/win32-x64/node.napi.node +0 -0
  122. package/src/device.cc +15 -5
  123. package/libusb/msvc/dpfp_2013.vcxproj +0 -87
  124. package/libusb/msvc/dpfp_2013.vcxproj.filters +0 -26
  125. package/libusb/msvc/dpfp_2015.vcxproj +0 -87
  126. package/libusb/msvc/dpfp_2015.vcxproj.filters +0 -26
  127. package/libusb/msvc/dpfp_2017.vcxproj +0 -106
  128. package/libusb/msvc/dpfp_2017.vcxproj.filters +0 -26
  129. package/libusb/msvc/dpfp_2019.vcxproj +0 -106
  130. package/libusb/msvc/dpfp_2019.vcxproj.filters +0 -26
  131. package/libusb/msvc/dpfp_threaded_2013.vcxproj +0 -87
  132. package/libusb/msvc/dpfp_threaded_2013.vcxproj.filters +0 -26
  133. package/libusb/msvc/dpfp_threaded_2015.vcxproj +0 -87
  134. package/libusb/msvc/dpfp_threaded_2015.vcxproj.filters +0 -26
  135. package/libusb/msvc/dpfp_threaded_2017.vcxproj +0 -106
  136. package/libusb/msvc/dpfp_threaded_2017.vcxproj.filters +0 -26
  137. package/libusb/msvc/dpfp_threaded_2019.vcxproj +0 -106
  138. package/libusb/msvc/dpfp_threaded_2019.vcxproj.filters +0 -26
  139. package/libusb/msvc/fxload_2013.vcxproj +0 -94
  140. package/libusb/msvc/fxload_2013.vcxproj.filters +0 -35
  141. package/libusb/msvc/fxload_2015.vcxproj +0 -94
  142. package/libusb/msvc/fxload_2015.vcxproj.filters +0 -35
  143. package/libusb/msvc/fxload_2017.vcxproj +0 -113
  144. package/libusb/msvc/fxload_2017.vcxproj.filters +0 -35
  145. package/libusb/msvc/fxload_2019.vcxproj +0 -113
  146. package/libusb/msvc/fxload_2019.vcxproj.filters +0 -35
  147. package/libusb/msvc/getopt_2013.vcxproj +0 -72
  148. package/libusb/msvc/getopt_2013.vcxproj.filters +0 -26
  149. package/libusb/msvc/getopt_2015.vcxproj +0 -73
  150. package/libusb/msvc/getopt_2015.vcxproj.filters +0 -26
  151. package/libusb/msvc/getopt_2017.vcxproj +0 -92
  152. package/libusb/msvc/getopt_2017.vcxproj.filters +0 -26
  153. package/libusb/msvc/getopt_2019.vcxproj +0 -92
  154. package/libusb/msvc/getopt_2019.vcxproj.filters +0 -26
  155. package/libusb/msvc/hotplugtest_2013.vcxproj +0 -86
  156. package/libusb/msvc/hotplugtest_2013.vcxproj.filters +0 -23
  157. package/libusb/msvc/hotplugtest_2015.vcxproj +0 -86
  158. package/libusb/msvc/hotplugtest_2015.vcxproj.filters +0 -23
  159. package/libusb/msvc/hotplugtest_2017.vcxproj +0 -105
  160. package/libusb/msvc/hotplugtest_2017.vcxproj.filters +0 -23
  161. package/libusb/msvc/hotplugtest_2019.vcxproj +0 -105
  162. package/libusb/msvc/hotplugtest_2019.vcxproj.filters +0 -23
  163. package/libusb/msvc/libusb_2013.sln +0 -137
  164. package/libusb/msvc/libusb_2015.sln +0 -137
  165. package/libusb/msvc/libusb_2017.sln +0 -240
  166. package/libusb/msvc/libusb_2019.sln +0 -240
  167. package/libusb/msvc/libusb_dll_2013.vcxproj +0 -104
  168. package/libusb/msvc/libusb_dll_2013.vcxproj.filters +0 -94
  169. package/libusb/msvc/libusb_dll_2015.vcxproj +0 -105
  170. package/libusb/msvc/libusb_dll_2015.vcxproj.filters +0 -94
  171. package/libusb/msvc/libusb_dll_2017.vcxproj +0 -124
  172. package/libusb/msvc/libusb_dll_2017.vcxproj.filters +0 -94
  173. package/libusb/msvc/libusb_dll_2019.vcxproj +0 -124
  174. package/libusb/msvc/libusb_dll_2019.vcxproj.filters +0 -94
  175. package/libusb/msvc/libusb_static_2013.vcxproj +0 -94
  176. package/libusb/msvc/libusb_static_2013.vcxproj.filters +0 -80
  177. package/libusb/msvc/libusb_static_2015.vcxproj +0 -95
  178. package/libusb/msvc/libusb_static_2015.vcxproj.filters +0 -80
  179. package/libusb/msvc/libusb_static_2017.vcxproj +0 -114
  180. package/libusb/msvc/libusb_static_2017.vcxproj.filters +0 -80
  181. package/libusb/msvc/libusb_static_2019.vcxproj +0 -114
  182. package/libusb/msvc/libusb_static_2019.vcxproj.filters +0 -80
  183. package/libusb/msvc/listdevs_2013.vcxproj +0 -86
  184. package/libusb/msvc/listdevs_2013.vcxproj.filters +0 -23
  185. package/libusb/msvc/listdevs_2015.vcxproj +0 -86
  186. package/libusb/msvc/listdevs_2015.vcxproj.filters +0 -23
  187. package/libusb/msvc/listdevs_2017.vcxproj +0 -105
  188. package/libusb/msvc/listdevs_2017.vcxproj.filters +0 -23
  189. package/libusb/msvc/listdevs_2019.vcxproj +0 -105
  190. package/libusb/msvc/listdevs_2019.vcxproj.filters +0 -23
  191. package/libusb/msvc/sam3u_benchmark_2013.vcxproj +0 -87
  192. package/libusb/msvc/sam3u_benchmark_2013.vcxproj.filters +0 -26
  193. package/libusb/msvc/sam3u_benchmark_2015.vcxproj +0 -87
  194. package/libusb/msvc/sam3u_benchmark_2015.vcxproj.filters +0 -26
  195. package/libusb/msvc/sam3u_benchmark_2017.vcxproj +0 -106
  196. package/libusb/msvc/sam3u_benchmark_2017.vcxproj.filters +0 -26
  197. package/libusb/msvc/sam3u_benchmark_2019.vcxproj +0 -106
  198. package/libusb/msvc/sam3u_benchmark_2019.vcxproj.filters +0 -26
  199. package/libusb/msvc/stress_2013.vcxproj +0 -89
  200. package/libusb/msvc/stress_2013.vcxproj.filters +0 -32
  201. package/libusb/msvc/stress_2015.vcxproj +0 -89
  202. package/libusb/msvc/stress_2015.vcxproj.filters +0 -32
  203. package/libusb/msvc/stress_2017.vcxproj +0 -108
  204. package/libusb/msvc/stress_2017.vcxproj.filters +0 -32
  205. package/libusb/msvc/stress_2019.vcxproj +0 -108
  206. package/libusb/msvc/stress_2019.vcxproj.filters +0 -32
  207. package/libusb/msvc/testlibusb_2013.vcxproj +0 -86
  208. package/libusb/msvc/testlibusb_2013.vcxproj.filters +0 -23
  209. package/libusb/msvc/testlibusb_2015.vcxproj +0 -86
  210. package/libusb/msvc/testlibusb_2015.vcxproj.filters +0 -23
  211. package/libusb/msvc/testlibusb_2017.vcxproj +0 -105
  212. package/libusb/msvc/testlibusb_2017.vcxproj.filters +0 -23
  213. package/libusb/msvc/testlibusb_2019.vcxproj +0 -105
  214. package/libusb/msvc/testlibusb_2019.vcxproj.filters +0 -23
  215. package/libusb/msvc/xusb_2013.vcxproj +0 -86
  216. package/libusb/msvc/xusb_2013.vcxproj.filters +0 -23
  217. package/libusb/msvc/xusb_2015.vcxproj +0 -86
  218. package/libusb/msvc/xusb_2015.vcxproj.filters +0 -23
  219. package/libusb/msvc/xusb_2017.vcxproj +0 -105
  220. package/libusb/msvc/xusb_2017.vcxproj.filters +0 -23
  221. package/libusb/msvc/xusb_2019.vcxproj +0 -105
  222. package/libusb/msvc/xusb_2019.vcxproj.filters +0 -23
@@ -0,0 +1,49 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{349EE8F9-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.StaticLibrary.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <PropertyGroup>
18
+ <OutDir>$(IntDir)..\lib\</OutDir>
19
+ <TargetName>libusb-1.0</TargetName>
20
+ </PropertyGroup>
21
+ <ItemGroup>
22
+ <ClCompile Include="..\libusb\core.c" />
23
+ <ClCompile Include="..\libusb\descriptor.c" />
24
+ <ClCompile Include="..\libusb\os\events_windows.c" />
25
+ <ClCompile Include="..\libusb\hotplug.c" />
26
+ <ClCompile Include="..\libusb\io.c" />
27
+ <ClCompile Include="..\libusb\strerror.c" />
28
+ <ClCompile Include="..\libusb\sync.c" />
29
+ <ClCompile Include="..\libusb\os\threads_windows.c" />
30
+ <ClCompile Include="..\libusb\os\windows_common.c" />
31
+ <ClCompile Include="..\libusb\os\windows_usbdk.c" />
32
+ <ClCompile Include="..\libusb\os\windows_winusb.c" />
33
+ </ItemGroup>
34
+ <ItemGroup>
35
+ <ClInclude Include=".\config.h" />
36
+ <ClInclude Include="..\libusb\os\events_windows.h" />
37
+ <ClInclude Include="..\libusb\libusb.h" />
38
+ <ClInclude Include="..\libusb\libusbi.h" />
39
+ <ClInclude Include="..\libusb\os\threads_windows.h" />
40
+ <ClInclude Include="..\libusb\version.h" />
41
+ <ClInclude Include="..\libusb\version_nano.h" />
42
+ <ClInclude Include="..\libusb\os\windows_common.h" />
43
+ <ClInclude Include="..\libusb\os\windows_usbdk.h" />
44
+ <ClInclude Include="..\libusb\os\windows_winusb.h" />
45
+ </ItemGroup>
46
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
47
+ <ImportGroup Label="ExtensionTargets">
48
+ </ImportGroup>
49
+ </Project>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\examples\listdevs.c" />
19
+ </ItemGroup>
20
+ <ItemGroup>
21
+ <ClInclude Include="..\libusb\libusb.h" />
22
+ </ItemGroup>
23
+ <ItemGroup>
24
+ <ProjectReference Include=".\libusb_static.vcxproj">
25
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
26
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
27
+ </ProjectReference>
28
+ </ItemGroup>
29
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
30
+ <ImportGroup Label="ExtensionTargets">
31
+ </ImportGroup>
32
+ </Project>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{861cdd5f-59a2-4f34-957e-5c1af98be0a4}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\examples\sam3u_benchmark.c" />
19
+ </ItemGroup>
20
+ <ItemGroup>
21
+ <ClInclude Include=".\config.h" />
22
+ <ClInclude Include="..\libusb\libusb.h" />
23
+ </ItemGroup>
24
+ <ItemGroup>
25
+ <ProjectReference Include=".\libusb_static.vcxproj">
26
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
27
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
28
+ </ProjectReference>
29
+ </ItemGroup>
30
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
31
+ <ImportGroup Label="ExtensionTargets">
32
+ </ImportGroup>
33
+ </Project>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{35BD5D4B-5102-4A08-81C0-AAF3285FCB01}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\tests\set_option.c" />
19
+ <ClCompile Include="..\tests\testlib.c" />
20
+ </ItemGroup>
21
+ <ItemGroup>
22
+ <ClInclude Include=".\config.h" />
23
+ <ClInclude Include="..\libusb\libusb.h" />
24
+ <ClInclude Include="..\tests\libusb_testlib.h" />
25
+ </ItemGroup>
26
+ <ItemGroup>
27
+ <ProjectReference Include=".\libusb_static.vcxproj">
28
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
29
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
30
+ </ProjectReference>
31
+ </ItemGroup>
32
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
33
+ <ImportGroup Label="ExtensionTargets">
34
+ </ImportGroup>
35
+ </Project>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{53942EFF-C810-458D-B3CB-EE5CE9F1E781}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\tests\stress.c" />
19
+ <ClCompile Include="..\tests\testlib.c" />
20
+ </ItemGroup>
21
+ <ItemGroup>
22
+ <ClInclude Include=".\config.h" />
23
+ <ClInclude Include="..\libusb\libusb.h" />
24
+ <ClInclude Include="..\tests\libusb_testlib.h" />
25
+ </ItemGroup>
26
+ <ItemGroup>
27
+ <ProjectReference Include=".\libusb_static.vcxproj">
28
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
29
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
30
+ </ProjectReference>
31
+ </ItemGroup>
32
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
33
+ <ImportGroup Label="ExtensionTargets">
34
+ </ImportGroup>
35
+ </Project>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{9EAF1311-2BBB-4177-882B-DA7FA0AD7912}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\tests\stress_mt.c" />
19
+ </ItemGroup>
20
+ <ItemGroup>
21
+ <ClInclude Include=".\config.h" />
22
+ <ClInclude Include="..\libusb\libusb.h" />
23
+ </ItemGroup>
24
+ <ItemGroup>
25
+ <ProjectReference Include=".\libusb_static.vcxproj">
26
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
27
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
28
+ </ProjectReference>
29
+ </ItemGroup>
30
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
31
+ <ImportGroup Label="ExtensionTargets">
32
+ </ImportGroup>
33
+ </Project>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{70828935-325B-4749-B381-0E55EF31AEE8}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemGroup>
18
+ <ClCompile Include="..\examples\testlibusb.c" />
19
+ </ItemGroup>
20
+ <ItemGroup>
21
+ <ClInclude Include="..\libusb\libusb.h" />
22
+ </ItemGroup>
23
+ <ItemGroup>
24
+ <ProjectReference Include=".\libusb_static.vcxproj">
25
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
26
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
27
+ </ProjectReference>
28
+ </ItemGroup>
29
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
30
+ <ImportGroup Label="ExtensionTargets">
31
+ </ImportGroup>
32
+ </Project>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="ProjectConfigurations.Base.props" />
4
+ <PropertyGroup Label="Globals">
5
+ <ProjectGuid>{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}</ProjectGuid>
6
+ </PropertyGroup>
7
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
8
+ <Import Project="Configuration.Application.props" />
9
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
10
+ <ImportGroup Label="ExtensionSettings">
11
+ </ImportGroup>
12
+ <ImportGroup Label="PropertySheets">
13
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
14
+ <Import Project="Base.props" />
15
+ </ImportGroup>
16
+ <PropertyGroup Label="UserMacros" />
17
+ <ItemDefinitionGroup>
18
+ <ClCompile>
19
+ <!--VS2013 complains about while(0)-->
20
+ <DisableSpecificWarnings Condition="'$(PlatformToolsetVersion)'&lt;='120'">4127;%(DisableSpecificWarnings)</DisableSpecificWarnings>
21
+ </ClCompile>
22
+ </ItemDefinitionGroup>
23
+ <ItemGroup>
24
+ <ClCompile Include="..\examples\xusb.c" />
25
+ </ItemGroup>
26
+ <ItemGroup>
27
+ <ClInclude Include="..\libusb\libusb.h" />
28
+ </ItemGroup>
29
+ <ItemGroup>
30
+ <ProjectReference Include=".\libusb_static.vcxproj">
31
+ <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>
32
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
33
+ </ProjectReference>
34
+ </ItemGroup>
35
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
36
+ <ImportGroup Label="ExtensionTargets">
37
+ </ImportGroup>
38
+ </Project>
@@ -1,10 +1,30 @@
1
1
  AM_CPPFLAGS = -I$(top_srcdir)/libusb
2
2
  LDADD = ../libusb/libusb-1.0.la
3
- LIBS =
3
+ AM_LDFLAGS = -static
4
4
 
5
- stress_SOURCES = stress.c libusb_testlib.h testlib.c
5
+ stress_SOURCES = stress.c testlib.c
6
+ stress_mt_SOURCES = stress_mt.c
7
+ set_option_SOURCES = set_option.c testlib.c
8
+ init_context_SOURCES = init_context.c testlib.c
9
+ macos_SOURCES = macos.c testlib.c
6
10
 
7
- noinst_PROGRAMS = stress
11
+ stress_mt_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
12
+ stress_mt_LDADD = $(LDADD) $(THREAD_LIBS)
13
+ stress_mt_LDFLAGS = $(AM_LDFLAGS)
14
+
15
+ if OS_EMSCRIPTEN
16
+ # On the Web you can't block the main thread as this blocks the event loop itself,
17
+ # causing deadlocks when trying to use async APIs like WebUSB.
18
+ # We use the PROXY_TO_PTHREAD Emscripten's feature to move the main app to a separate thread
19
+ # where it can block safely.
20
+ stress_mt_LDFLAGS += ${AM_LDFLAGS} -s PROXY_TO_PTHREAD -s EXIT_RUNTIME
21
+ endif
22
+
23
+ noinst_HEADERS = libusb_testlib.h
24
+ noinst_PROGRAMS = stress stress_mt set_option init_context
25
+ if OS_DARWIN
26
+ noinst_PROGRAMS += macos
27
+ endif
8
28
 
9
29
  if BUILD_UMOCKDEV_TEST
10
30
  # NOTE: We add libumockdev-preload.so so that we can run tests in-process
@@ -16,3 +36,5 @@ umockdev_SOURCES = umockdev.c
16
36
 
17
37
  noinst_PROGRAMS += umockdev
18
38
  endif
39
+
40
+ TESTS=$(noinst_PROGRAMS)
@@ -0,0 +1,153 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil -*- */
2
+ /*
3
+ * Unit tests for libusb_set_option
4
+ * Copyright © 2023 Nathan Hjelm <hjelmn@cs.unm.edu>
5
+ * Copyright © 2023 Google, LLC. All rights reserved.
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+ #include "config.h"
23
+
24
+ #include <stdlib.h>
25
+ #include <stdio.h>
26
+ #include <inttypes.h>
27
+ #include "libusbi.h"
28
+ #include "libusb_testlib.h"
29
+
30
+ #if defined(_WIN32) && !defined(__CYGWIN__)
31
+ #include <winbase.h>
32
+
33
+ static int unsetenv(const char *env) {
34
+ return _putenv_s(env, "");
35
+ }
36
+ #endif
37
+
38
+ #define LIBUSB_TEST_CLEAN_EXIT(code) \
39
+ do { \
40
+ if (test_ctx != NULL) { \
41
+ libusb_exit(test_ctx); \
42
+ } \
43
+ unsetenv("LIBUSB_DEBUG"); \
44
+ return (code); \
45
+ } while (0)
46
+
47
+ /**
48
+ * Fail the test if the expression does not evaluate to LIBUSB_SUCCESS.
49
+ */
50
+ #define LIBUSB_TEST_RETURN_ON_ERROR(expr) \
51
+ do { \
52
+ int _result = (expr); \
53
+ if (LIBUSB_SUCCESS != _result) { \
54
+ libusb_testlib_logf("Not success (%s) at %s:%d", #expr, \
55
+ __FILE__, __LINE__); \
56
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_FAILURE); \
57
+ } \
58
+ } while (0)
59
+
60
+ /**
61
+ * Use relational operator to compare two values and fail the test if the
62
+ * comparison is false. Intended to compare integer or pointer types.
63
+ *
64
+ * Example: LIBUSB_EXPECT(==, 0, 1) -> fail, LIBUSB_EXPECT(==, 0, 0) -> ok.
65
+ */
66
+ #define LIBUSB_EXPECT(operator, lhs, rhs) \
67
+ do { \
68
+ int64_t _lhs = (int64_t)(intptr_t)(lhs), _rhs = (int64_t)(intptr_t)(rhs); \
69
+ if (!(_lhs operator _rhs)) { \
70
+ libusb_testlib_logf("Expected %s (%" PRId64 ") " #operator \
71
+ " %s (%" PRId64 ") at %s:%d", #lhs, \
72
+ (int64_t)(intptr_t)_lhs, #rhs, \
73
+ (int64_t)(intptr_t)_rhs, __FILE__, \
74
+ __LINE__); \
75
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_FAILURE); \
76
+ } \
77
+ } while (0)
78
+
79
+
80
+ static libusb_testlib_result test_init_context_basic(void) {
81
+ libusb_context *test_ctx = NULL;
82
+
83
+ /* test basic functionality */
84
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, /*options=*/NULL,
85
+ /*num_options=*/0));
86
+
87
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_SUCCESS);
88
+ }
89
+
90
+ static libusb_testlib_result test_init_context_log_level(void) {
91
+ libusb_context *test_ctx = NULL;
92
+
93
+ struct libusb_init_option options[] = {
94
+ {
95
+ .option = LIBUSB_OPTION_LOG_LEVEL,
96
+ .value = {
97
+ .ival = LIBUSB_LOG_LEVEL_ERROR,
98
+ },
99
+ }
100
+ };
101
+
102
+ /* test basic functionality */
103
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, options,
104
+ /*num_options=*/1));
105
+
106
+ #if defined(ENABLE_LOGGING) && !defined(ENABLE_DEBUG_LOGGING)
107
+ LIBUSB_EXPECT(==, test_ctx->debug, LIBUSB_LOG_LEVEL_ERROR);
108
+ #endif
109
+
110
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_SUCCESS);
111
+ }
112
+
113
+ static void LIBUSB_CALL test_log_cb(libusb_context *ctx, enum libusb_log_level level,
114
+ const char *str) {
115
+ UNUSED(ctx);
116
+ UNUSED(level);
117
+ UNUSED(str);
118
+ }
119
+
120
+ static libusb_testlib_result test_init_context_log_cb(void) {
121
+ libusb_context *test_ctx = NULL;
122
+
123
+ struct libusb_init_option options[] = {
124
+ {
125
+ .option = LIBUSB_OPTION_LOG_CB,
126
+ .value = {
127
+ .log_cbval = (libusb_log_cb) &test_log_cb,
128
+ },
129
+ }
130
+ };
131
+
132
+ /* test basic functionality */
133
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, options,
134
+ /*num_options=*/1));
135
+
136
+ #if defined(ENABLE_LOGGING) && !defined(ENABLE_DEBUG_LOGGING)
137
+ LIBUSB_EXPECT(==, test_ctx->log_handler, test_log_cb);
138
+ #endif
139
+
140
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_SUCCESS);
141
+ }
142
+
143
+ static const libusb_testlib_test tests[] = {
144
+ { "test_init_context_basic", &test_init_context_basic },
145
+ { "test_init_context_log_level", &test_init_context_log_level },
146
+ { "test_init_context_log_cb", &test_init_context_log_cb },
147
+ LIBUSB_NULL_TEST
148
+ };
149
+
150
+ int main(int argc, char *argv[])
151
+ {
152
+ return libusb_testlib_run_tests(argc, argv, tests);
153
+ }
@@ -0,0 +1,130 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil -*- */
2
+ /*
3
+ * Unit tests for libusb_set_option
4
+ * Copyright © 2023 Nathan Hjelm <hjelmn@cs.unm.edu>
5
+ * Copyright © 2023 Google, LLC. All rights reserved.
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+ #include "config.h"
23
+
24
+ #include <stdbool.h>
25
+ #include <stdlib.h>
26
+ #include <stdio.h>
27
+ #include <inttypes.h>
28
+ #include "libusbi.h"
29
+ #include "libusb_testlib.h"
30
+
31
+ #define LIBUSB_TEST_CLEAN_EXIT(code) \
32
+ do { \
33
+ if (test_ctx != NULL) { \
34
+ libusb_exit(test_ctx); \
35
+ } \
36
+ unsetenv("LIBUSB_DEBUG"); \
37
+ return (code); \
38
+ } while (0)
39
+
40
+ /**
41
+ * Fail the test if the expression does not evaluate to LIBUSB_SUCCESS.
42
+ */
43
+ #define LIBUSB_TEST_RETURN_ON_ERROR(expr) \
44
+ do { \
45
+ int _result = (expr); \
46
+ if (LIBUSB_SUCCESS != _result) { \
47
+ libusb_testlib_logf("Not success (%s) at %s:%d", #expr, \
48
+ __FILE__, __LINE__); \
49
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_FAILURE); \
50
+ } \
51
+ } while (0)
52
+
53
+ /**
54
+ * Use relational operator to compare two values and fail the test if the
55
+ * comparison is false. Intended to compare integer or pointer types.
56
+ *
57
+ * Example: LIBUSB_EXPECT(==, 0, 1) -> fail, LIBUSB_EXPECT(==, 0, 0) -> ok.
58
+ */
59
+ #define LIBUSB_EXPECT(operator, lhs, rhs) \
60
+ do { \
61
+ int64_t _lhs = (lhs), _rhs = (rhs); \
62
+ if (!(_lhs operator _rhs)) { \
63
+ libusb_testlib_logf("Expected %s (%" PRId64 ") " #operator \
64
+ " %s (%" PRId64 ") at %s:%d", #lhs, \
65
+ (int64_t)(intptr_t)_lhs, #rhs, \
66
+ (int64_t)(intptr_t)_rhs, __FILE__, \
67
+ __LINE__); \
68
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_FAILURE); \
69
+ } \
70
+ } while (0)
71
+
72
+
73
+ extern uint32_t libusb_testonly_fake_running_version;
74
+ extern int libusb_testonly_using_running_interface_version;
75
+ extern int libusb_testonly_using_running_device_version;
76
+ extern bool libusb_testonly_clear_running_version_cache;
77
+
78
+ static libusb_testlib_result test_macos_version_fallback(void) {
79
+ libusb_context *test_ctx = NULL;
80
+ libusb_testonly_fake_running_version = 100001;
81
+ libusb_testonly_clear_running_version_cache = true;
82
+
83
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, /*options=*/NULL,
84
+ /*num_options=*/0));
85
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_interface_version, 220);
86
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_device_version, 197);
87
+
88
+ libusb_exit(test_ctx);
89
+ test_ctx = NULL;
90
+
91
+ libusb_testonly_fake_running_version = 100900;
92
+
93
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, /*options=*/NULL,
94
+ /*num_options=*/0));
95
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_interface_version, 650);
96
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_device_version, 650);
97
+
98
+ libusb_exit(test_ctx);
99
+ test_ctx = NULL;
100
+
101
+ libusb_testonly_fake_running_version = 101200;
102
+
103
+ LIBUSB_TEST_RETURN_ON_ERROR(libusb_init_context(&test_ctx, /*options=*/NULL,
104
+ /*num_options=*/0));
105
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_interface_version, 800);
106
+ LIBUSB_EXPECT(==, libusb_testonly_using_running_device_version, 650);
107
+
108
+ libusb_exit(test_ctx);
109
+ test_ctx = NULL;
110
+
111
+ // Test a version smaller than 10.0. Initialization should fail.
112
+ libusb_testonly_fake_running_version = 99999;
113
+
114
+ int error = libusb_init_context(&test_ctx, /*options=*/NULL,
115
+ /*num_options=*/0);
116
+ LIBUSB_EXPECT(!=, error, LIBUSB_SUCCESS);
117
+
118
+
119
+ LIBUSB_TEST_CLEAN_EXIT(TEST_STATUS_SUCCESS);
120
+ }
121
+
122
+ static const libusb_testlib_test tests[] = {
123
+ { "test_macos_version_fallback", &test_macos_version_fallback },
124
+ LIBUSB_NULL_TEST
125
+ };
126
+
127
+ int main(int argc, char *argv[])
128
+ {
129
+ return libusb_testlib_run_tests(argc, argv, tests);
130
+ }