Browse Source

Fixed DCT tests

pull/1632/head
Dmitry Pentin 5 years ago
parent
commit
8a61048a5c
  1. 17
      tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs

17
tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs

@ -2,7 +2,9 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
#if SUPPORTS_RUNTIME_INTRINSICS
using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.X86;
#endif
using SixLabors.ImageSharp.Formats.Jpeg.Components; using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils; using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
@ -118,7 +120,13 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
[InlineData(2)] [InlineData(2)]
public void IDCT8x8_Avx(int seed) public void IDCT8x8_Avx(int seed)
{ {
if (!Avx.IsSupported) #if SUPPORTS_RUNTIME_INTRINSICS
var skip = !Avx.IsSupported;
#else
var skip = true;
#endif
if (skip)
{ {
this.Output.WriteLine("No AVX present, skipping test!"); this.Output.WriteLine("No AVX present, skipping test!");
return; return;
@ -231,7 +239,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
[InlineData(2)] [InlineData(2)]
public void FDCT8x8_Avx(int seed) public void FDCT8x8_Avx(int seed)
{ {
if (!Avx.IsSupported) #if SUPPORTS_RUNTIME_INTRINSICS
var skip = !Avx.IsSupported;
#else
var skip = true;
#endif
if (skip)
{ {
this.Output.WriteLine("No AVX present, skipping test!"); this.Output.WriteLine("No AVX present, skipping test!");
return; return;

Loading…
Cancel
Save