mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
Fixed: Avoid zero-length array memory allocations
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
@@ -11,7 +12,7 @@ namespace NzbDrone.Common.Test.EnvironmentTests
|
||||
[Test]
|
||||
public void empty_array_should_return_empty_flags()
|
||||
{
|
||||
var args = new StartupContext(new string[0]);
|
||||
var args = new StartupContext(Array.Empty<string>());
|
||||
args.Flags.Should().BeEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace NzbDrone.Common.Test.Http
|
||||
Mocker.SetConstant<ICacheManager>(Mocker.Resolve<CacheManager>());
|
||||
Mocker.SetConstant<ICreateManagedWebProxy>(Mocker.Resolve<ManagedWebProxyFactory>());
|
||||
Mocker.SetConstant<IRateLimitService>(Mocker.Resolve<RateLimitService>());
|
||||
Mocker.SetConstant<IEnumerable<IHttpRequestInterceptor>>(new IHttpRequestInterceptor[0]);
|
||||
Mocker.SetConstant<IEnumerable<IHttpRequestInterceptor>>(Array.Empty<IHttpRequestInterceptor>());
|
||||
Mocker.SetConstant<IHttpDispatcher>(Mocker.Resolve<TDispatcher>());
|
||||
|
||||
// Used for manual testing of socks proxies.
|
||||
@@ -352,7 +352,7 @@ namespace NzbDrone.Common.Test.Http
|
||||
var oldRequest = new HttpRequest($"https://{_httpBinHost2}/get");
|
||||
oldRequest.Cookies["my"] = "cookie";
|
||||
|
||||
var oldClient = new HttpClient(new IHttpRequestInterceptor[0], Mocker.Resolve<ICacheManager>(), Mocker.Resolve<IRateLimitService>(), Mocker.Resolve<IHttpDispatcher>(), Mocker.Resolve<Logger>());
|
||||
var oldClient = new HttpClient(Array.Empty<IHttpRequestInterceptor>(), Mocker.Resolve<ICacheManager>(), Mocker.Resolve<IRateLimitService>(), Mocker.Resolve<IHttpDispatcher>(), Mocker.Resolve<Logger>());
|
||||
|
||||
oldClient.Should().NotBeSameAs(Subject);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user