Move to block based namespaces so it can compile with .NET Core 3.1.

This commit is contained in:
2023-09-21 14:03:21 +01:00
parent 2bd046ef06
commit 362aea152c
9 changed files with 1840 additions and 1813 deletions

View File

@@ -8,10 +8,12 @@ using BenchmarkDotNet.Toolchains.CsProj;
using BenchmarkDotNet.Toolchains.DotNetCli;
#if NET8_0_OR_GREATER
using AaruBenchmark.Compression;
// ReSharper disable ArrangeNamespaceBody
#endif
namespace AaruBenchmark;
namespace AaruBenchmark
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
public class Core31RosettaJobAttribute : Attribute, IConfigSource
{
@@ -558,3 +560,4 @@ public class SpamSumBenchs
[Benchmark]
public void ssdeep() => Checksums.Aaru.CliSpamSum();
}
}

View File

@@ -5,8 +5,10 @@ using System.Linq;
using Aaru.Checksums;
using Aaru.CommonTypes.Interfaces;
namespace AaruBenchmark.Checksums;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Checksums
{
public class Aaru
{
static readonly byte[] _expectedRandomAdler32 =
@@ -343,3 +345,4 @@ public class Aaru
throw new Exception("Invalid hash value");
}
}
}

View File

@@ -3,8 +3,10 @@ using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace AaruBenchmark.Checksums;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Checksums
{
public class OpenSsl
{
static readonly byte[] _expectedRandomMd5 =
@@ -244,3 +246,4 @@ public class OpenSsl
throw new Exception("Invalid hash value");
}
}
}

View File

@@ -3,8 +3,10 @@ using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace AaruBenchmark.Checksums;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Checksums
{
public class RHash
{
const uint RHASH_CRC32 = 0x01;
@@ -263,3 +265,4 @@ public class RHash
throw new Exception("Invalid hash value");
}
}
}

View File

@@ -1,15 +1,17 @@
using System.IO;
#if NET8_0_OR_GREATER
using Aaru6.Checksums;
#else
using Aaru.Checksums;
#endif
using System.IO;
using Aaru.Compression;
using CUETools.Codecs;
using CUETools.Codecs.Flake;
namespace AaruBenchmark.Compression;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Compression
{
public class Aaru
{
public static void AppleRle()
@@ -132,3 +134,4 @@ public class Aaru
flakeWriter.Write(audioBuffer);
}
}
}

View File

@@ -2,8 +2,10 @@ using System.IO;
using Ionic.BZip2;
using Ionic.Zlib;
namespace AaruBenchmark.Compression;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Compression
{
public static class DotNetZip
{
public static void Gzip()
@@ -158,3 +160,4 @@ public static class DotNetZip
*/
}
}
}

View File

@@ -1,8 +1,10 @@
using System.IO;
using System.IO.Compression;
namespace AaruBenchmark.Compression;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Compression
{
public static class NetRuntime
{
public static void Gzip()
@@ -81,3 +83,4 @@ public static class NetRuntime
*/
}
}
}

View File

@@ -1,17 +1,19 @@
using System.IO;
#if NET8_0_OR_GREATER
using Aaru6.Checksums;
#else
using Aaru.Checksums;
#endif
using SharpCompress.Compressors;
using SharpCompress.Compressors.ADC;
using SharpCompress.Compressors.BZip2;
using SharpCompress.Compressors.Deflate;
using SharpCompress.Compressors.LZMA;
#if NET8_0_OR_GREATER
using Aaru6.Checksums;
#else
using Aaru.Checksums;
#endif
namespace AaruBenchmark.Compression;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark.Compression
{
public static class SharpCompress
{
public static void Gzip()
@@ -354,3 +356,4 @@ public static class SharpCompress
*/
}
}
}

View File

@@ -4,8 +4,10 @@ using System.IO;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
namespace AaruBenchmark;
// ReSharper disable ArrangeNamespaceBody
namespace AaruBenchmark
{
static class Program
{
internal static string Folder => Path.Combine(Environment.CurrentDirectory, "data");
@@ -43,3 +45,4 @@ static class Program
BenchmarkRunner.Run<SpamSumBenchs>(config);
}
}
}