From 0d1c4ae69f38ffaea46cf9482f88b0ad1760c689 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 19 Sep 2023 15:59:52 +0100 Subject: [PATCH] Make tests use .NET Core 3.1 as Aaru 5 does. --- AaruBenchmark/AaruBenchmark.csproj | 5 +- AaruBenchmark/Benchs.cs | 391 +++++++++++++----- AaruBenchmark/Checksums/Aaru6.cs | 4 +- AaruBenchmark/Checksums/AaruNative.cs | 4 +- AaruBenchmark/Compression/Aaru.cs | 6 +- .../Compression/Aaru6Compressions.cs | 4 +- AaruBenchmark/Compression/AaruNative.cs | 4 +- AaruBenchmark/Compression/SharpCompress.cs | 4 + 8 files changed, 312 insertions(+), 110 deletions(-) diff --git a/AaruBenchmark/AaruBenchmark.csproj b/AaruBenchmark/AaruBenchmark.csproj index 40c7ea2..d77800c 100644 --- a/AaruBenchmark/AaruBenchmark.csproj +++ b/AaruBenchmark/AaruBenchmark.csproj @@ -2,7 +2,8 @@ Exe - net6.0;net7.0 + netcoreapp3.1;net7.0 + latest @@ -61,7 +62,7 @@ - + diff --git a/AaruBenchmark/Benchs.cs b/AaruBenchmark/Benchs.cs index a8e1138..cb5a5c2 100644 --- a/AaruBenchmark/Benchs.cs +++ b/AaruBenchmark/Benchs.cs @@ -1,253 +1,430 @@ +using System; using AaruBenchmark.Checksums; -using AaruBenchmark.Compression; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; +#if NET7_0 +using AaruBenchmark.Compression; +#endif namespace AaruBenchmark; -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class AppleRleBenchs -{ - [Benchmark(Baseline = true)] - public void Aaru() => Compression.Aaru.AppleRle(); - - [Benchmark] - public void Aaru6() => Aaru6Compressions.AppleRle(); - - [Benchmark] - public void AaruNative() => Compression.AaruNative.AppleRle(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class TeleDiskLzhBenchs -{ - [Benchmark(Baseline = true)] - public void Aaru() => Compression.Aaru.TeleDiskLzh(); - - [Benchmark] - public void Aaru6() => Aaru6Compressions.TeleDiskLzh(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class ADCBenchs { - [Benchmark(Baseline = true)] - public void Aaru() => Compression.SharpCompress.ADC(); - +#if NET7_0 [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Aaru6Compressions.ADC(); [Benchmark] public void AaruNative() => Compression.AaruNative.ADC(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Compression.SharpCompress.ADC(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class GzipBenchs +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class AppleRleBenchs { +#if NET7_0 [Benchmark] - public void SharpCompress() => Compression.SharpCompress.Gzip(); + public void Aaru() => throw new NotImplementedException(); [Benchmark(Baseline = true)] - public void DotNetRuntime() => NetRuntime.Gzip(); + public void Aaru6() => Aaru6Compressions.AppleRle(); + + [Benchmark] + public void AaruNative() => Compression.AaruNative.AppleRle(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Compression.Aaru.AppleRle(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class TeleDiskLzhBenchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] + public void Aaru6() => Aaru6Compressions.TeleDiskLzh(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Compression.Aaru.TeleDiskLzh(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class GzipBenchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] + public void Aaru6() => NetRuntime.Gzip(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Compression.SharpCompress.Gzip(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); +#endif [Benchmark] public void DotNetZip() => Compression.DotNetZip.Gzip(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class CompressGzipBenchs { +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] + public void Aaru6() => NetRuntime.CompressGzip(); +#else [Benchmark(Baseline = true)] public void Aaru() => Compression.SharpCompress.CompressGzip(); [Benchmark] - public void Aaru6() => NetRuntime.CompressGzip(); + public void Aaru6() => throw new NotImplementedException(); +#endif [Benchmark] public void DotNetZip() => Compression.DotNetZip.CompressGzip(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Bzip2Benchs { - [Benchmark(Baseline = true)] - public void SharpCompress() => Compression.SharpCompress.Bzip2(); - +#if NET7_0 [Benchmark] - public void DotNetZip() => Compression.DotNetZip.Bzip2(); + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] + public void Aaru6() => DotNetZip.Bzip2(); [Benchmark] public void AaruNative() => Compression.AaruNative.Bzip2(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class CompressBzip2Benchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Compression.SharpCompress.CompressBzip2(); + public void Aaru() => Compression.SharpCompress.Bzip2(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class CompressBzip2Benchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => DotNetZip.CompressBzip2(); [Benchmark] public void AaruNative() => Compression.AaruNative.CompressBzip2(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Compression.SharpCompress.CompressBzip2(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class LzipBenchs { [Benchmark(Baseline = true)] - public void SharpCompress() => Compression.SharpCompress.Lzip(); + public void Aaru() => Compression.SharpCompress.Lzip(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.Lzip(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class CompressLzipBenchs { [Benchmark(Baseline = true)] - public void SharpCompress() => Compression.SharpCompress.CompressLzip(); + public void Aaru() => Compression.SharpCompress.CompressLzip(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.CompressLzip(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class LzmaBenchs { [Benchmark(Baseline = true)] - public void SharpCompress() => Compression.SharpCompress.Lzma(); - + public void Aaru() => Compression.SharpCompress.Lzma(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.Lzma(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class CompressLzmaBenchs { [Benchmark(Baseline = true)] - public void SharpCompress() => Compression.SharpCompress.CompressLzma(); + public void Aaru() => Compression.SharpCompress.CompressLzma(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.CompressLzma(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class FlacBenchs { [Benchmark(Baseline = true)] public void Aaru() => Compression.Aaru.Flac(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.Flac(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class CompressFlacBenchs { [Benchmark(Baseline = true)] public void Aaru() => Compression.Aaru.CompressFlac(); +#if NET7_0 [Benchmark] public void AaruNative() => Compression.AaruNative.CompressFlac(); +#else + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Adler32Benchs { - [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Adler32(); - +#if NET7_0 [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Adler32(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Adler32(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class Fletcher16Benchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Fletcher16(); + public void Aaru() => Checksums.Aaru.Adler32(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class Fletcher16Benchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Fletcher16(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Fletcher16(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class Fletcher32Benchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Fletcher32(); + public void Aaru() => Checksums.Aaru.Fletcher16(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class Fletcher32Benchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Fletcher32(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Fletcher32(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class Crc16CcittBenchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Crc16Ccitt(); + public void Aaru() => Checksums.Aaru.Fletcher32(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class Crc16CcittBenchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Crc16Ccitt(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Crc16Ccitt(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class Crc16Benchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Crc16(); + public void Aaru() => Checksums.Aaru.Crc16Ccitt(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class Crc16Benchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Crc16(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Crc16(); -} - -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] -public class Crc32Benchs -{ +#else [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Crc32(); + public void Aaru() => Checksums.Aaru.Crc16(); [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif +} + +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +public class Crc32Benchs +{ +#if NET7_0 + [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Crc32(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Crc32(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Checksums.Aaru.Crc32(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif [Benchmark] public void rhash() => RHash.Crc32(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Crc64Benchs { - [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.Crc64(); - +#if NET7_0 [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.Crc64(); [Benchmark] public void AaruNative() => Checksums.AaruNative.Crc64(); +#else + [Benchmark(Baseline = true)] + public void Aaru() => Checksums.Aaru.Crc64(); + + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Md5Benchs { [Benchmark(Baseline = true)] @@ -260,7 +437,7 @@ public class Md5Benchs public void rhash() => RHash.Md5(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Sha1Benchs { [Benchmark(Baseline = true)] @@ -273,7 +450,7 @@ public class Sha1Benchs public void rhash() => RHash.Sha1(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Sha256Benchs { [Benchmark(Baseline = true)] @@ -286,7 +463,7 @@ public class Sha256Benchs public void rhash() => RHash.Sha256(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Sha384Benchs { [Benchmark(Baseline = true)] @@ -299,7 +476,7 @@ public class Sha384Benchs public void rhash() => RHash.Sha384(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class Sha512Benchs { [Benchmark(Baseline = true)] @@ -312,17 +489,25 @@ public class Sha512Benchs public void rhash() => RHash.Sha512(); } -[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] +[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] public class SpamSumBenchs { - [Benchmark(Baseline = true)] - public void Aaru() => Checksums.Aaru.SpamSum(); - +#if NET7_0 [Benchmark] + public void Aaru() => throw new NotImplementedException(); + + [Benchmark(Baseline = true)] public void Aaru6() => Checksums.Aaru6.SpamSum(); [Benchmark] public void AaruNative() => Checksums.AaruNative.SpamSum(); +#else + [Benchmark] + public void Aaru6() => throw new NotImplementedException(); + + [Benchmark] + public void AaruNative() => throw new NotImplementedException(); +#endif [Benchmark] public void ssdeep() => Checksums.Aaru.CliSpamSum(); diff --git a/AaruBenchmark/Checksums/Aaru6.cs b/AaruBenchmark/Checksums/Aaru6.cs index c7df10d..6f69385 100644 --- a/AaruBenchmark/Checksums/Aaru6.cs +++ b/AaruBenchmark/Checksums/Aaru6.cs @@ -1,3 +1,4 @@ +#if NET7_0 using System; using System.IO; using System.Linq; @@ -242,4 +243,5 @@ public class Aaru6 ctx.Update(data); string result = ctx.End(); } -} \ No newline at end of file +} +#endif diff --git a/AaruBenchmark/Checksums/AaruNative.cs b/AaruBenchmark/Checksums/AaruNative.cs index 1846194..3d61415 100644 --- a/AaruBenchmark/Checksums/AaruNative.cs +++ b/AaruBenchmark/Checksums/AaruNative.cs @@ -1,3 +1,4 @@ +#if NET7_0 using System; using System.IO; using System.Linq; @@ -270,4 +271,5 @@ public class AaruNative spamsum_free(ctx); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/AaruBenchmark/Compression/Aaru.cs b/AaruBenchmark/Compression/Aaru.cs index 7b79621..722bf8f 100644 --- a/AaruBenchmark/Compression/Aaru.cs +++ b/AaruBenchmark/Compression/Aaru.cs @@ -1,6 +1,10 @@ using System.IO; -using Aaru.Compression; +#if NET7_0 using Aaru6.Checksums; +#else +using Aaru.Checksums; +#endif +using Aaru.Compression; using CUETools.Codecs; using CUETools.Codecs.Flake; diff --git a/AaruBenchmark/Compression/Aaru6Compressions.cs b/AaruBenchmark/Compression/Aaru6Compressions.cs index 809dbb0..87f2133 100644 --- a/AaruBenchmark/Compression/Aaru6Compressions.cs +++ b/AaruBenchmark/Compression/Aaru6Compressions.cs @@ -1,3 +1,4 @@ +#if NET7_0 using System.IO; using Aaru6.Checksums; using Aaru6.Compression; @@ -92,4 +93,5 @@ public class Aaru6Compressions if(crc != "5a5a7388") throw new InvalidDataException("Incorrect decompressed checksum"); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/AaruBenchmark/Compression/AaruNative.cs b/AaruBenchmark/Compression/AaruNative.cs index 87bf498..b30966f 100644 --- a/AaruBenchmark/Compression/AaruNative.cs +++ b/AaruBenchmark/Compression/AaruNative.cs @@ -1,3 +1,4 @@ +#if NET7_0 using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; @@ -305,4 +306,5 @@ public class AaruNative "hamming", 12, 15, 1, 0, 0, 8, "Aaru.Compression.Native.Tests", (uint)"Aaru.Compression.Native.Tests".Length); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/AaruBenchmark/Compression/SharpCompress.cs b/AaruBenchmark/Compression/SharpCompress.cs index 897868e..5d19a09 100644 --- a/AaruBenchmark/Compression/SharpCompress.cs +++ b/AaruBenchmark/Compression/SharpCompress.cs @@ -1,5 +1,9 @@ using System.IO; +#if NET7_0 using Aaru6.Checksums; +#else +using Aaru.Checksums; +#endif using SharpCompress.Compressors; using SharpCompress.Compressors.ADC; using SharpCompress.Compressors.BZip2;