Skip to content

Commit

Permalink
extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
aloneguid committed Sep 30, 2024
1 parent 25c4405 commit 9cb8f92
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ And following architectures:
| | | |||| x64 |
| | | |||| ARM64 |
| **Gzip** | ✅<br /><sup>*part of .NET*</sup> | |||| x32 |
| | | | | | | x64 |
| | | || | | ARM64 |
| | | | | | | x64 |
| | | || | | ARM64 |
| **Brotli** | ✅<br /><sup>*except on .NET Standard 2.0*</sup> | |||| x32 |
| | | |||| x64 |
| | | |||| ARM64 |
Expand Down
5 changes: 5 additions & 0 deletions managed/IronCompress.Test/IronTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ public void EncodeDecodeManaged(Codec codec) {
public void CheckNativeLibAvailable() {
Assert.True(Iron.IsNativeLibraryAvailable);
}

[Fact]
public void CheckNoNativeGzip() {
Assert.False(Iron.SupportsNative(Codec.Gzip));
}
}
4 changes: 2 additions & 2 deletions managed/IronCompress/Codec.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace IronCompress {
public enum Codec {
/// <summary>
/// Google Snappy. Has managed and native implementations.
/// Google Snappy.
/// </summary>
Snappy = 1,

/// <summary>
/// Facebook Zstandard. Native only.
/// Facebook Zstandard.
/// </summary>
Zstd = 2,

Expand Down
4 changes: 2 additions & 2 deletions managed/IronCompress/Iron.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public static bool IsNativeLibraryAvailable {
}
}

static bool SupportsManaged(Codec c) {
public static bool SupportsManaged(Codec c) {
#if NETSTANDARD2_0
return c == Codec.Snappy || c == Codec.Gzip;
#else
return c == Codec.Snappy || c == Codec.Gzip || c == Codec.Brotli || c == Codec.Zstd;
#endif
}

static bool SupportsNative(Codec c) {
public static bool SupportsNative(Codec c) {
return Native.iron_is_supported((int)c);
}

Expand Down

0 comments on commit 9cb8f92

Please sign in to comment.