-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.0 - optimizations & breaking changes
- Loading branch information
1 parent
abb5d18
commit b7de39a
Showing
19 changed files
with
460 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: NuGet Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ./src | ||
|
||
- name: Build | ||
run: dotnet build ./src --no-restore --configuration Release | ||
|
||
- name: Pack NuGet Package(s) | ||
run: dotnet pack ./src --no-restore --no-build --configuration Release --output ./nuget-packages | ||
|
||
- name: Upload Build Artifact(s) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nuget-packages | ||
path: ./nuget-packages | ||
|
||
- name: Push NuGet Package(s) | ||
run: dotnet nuget push ./nuget-packages/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
using System; | ||
using System.IO; | ||
|
||
using OodleDotNet; | ||
|
||
using Xunit; | ||
|
||
namespace UsmapDotNet.Tests; | ||
|
||
public class Tests | ||
{ | ||
private static readonly Oodle OodleInstance = new(Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), | ||
@"Libraries\oo2core_9_win64.dll")); | ||
|
||
/*private const int ExpectedSchemas = 13890; | ||
private const int ExpectedEnums = 2367; | ||
private const int ExpectedNames = 74908;*/ | ||
private const int ExpectedSchemas = 28697; | ||
private const int ExpectedEnums = 4391; | ||
private const int ExpectedNames = 141495; | ||
|
||
private readonly string _uncompressedUsmapPath; | ||
private readonly string _brotliCompressedUsmapPath; | ||
private readonly string _oodleCompressedUsmapPath; | ||
|
||
public Tests() | ||
{ | ||
var currentDir = Directory.GetCurrentDirectory(); | ||
var testFilesDir = Path.Combine(currentDir, "TestFiles"); | ||
|
||
_uncompressedUsmapPath = Path.Combine(testFilesDir, "xx1.usmap"); | ||
_brotliCompressedUsmapPath = Path.Combine(testFilesDir, "br1.usmap"); | ||
_oodleCompressedUsmapPath = Path.Combine(testFilesDir, "oo1.usmap"); | ||
} | ||
|
||
[Fact] | ||
public void ParseUncompressedUsmapFromFile() | ||
{ | ||
var usmap = new Usmap(_uncompressedUsmapPath); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseUncompressedUsmapFromStream() | ||
{ | ||
var usmap = new Usmap(File.OpenRead(_uncompressedUsmapPath)); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseUncompressedUsmapFromBuffer() | ||
{ | ||
var buffer = File.ReadAllBytes(_uncompressedUsmapPath); | ||
var usmap = new Usmap(buffer); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseBrotliCompressedFromFile() | ||
{ | ||
var usmap = new Usmap(_brotliCompressedUsmapPath); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseBrotliCompressedFromStream() | ||
{ | ||
var usmap = new Usmap(File.OpenRead(_brotliCompressedUsmapPath)); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseBrotliCompressedFromBuffer() | ||
{ | ||
var buffer = File.ReadAllBytes(_brotliCompressedUsmapPath); | ||
var usmap = new Usmap(buffer); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseOodleCompressedFromFile() | ||
{ | ||
var options = new UsmapOptions | ||
{ | ||
Oodle = OodleInstance | ||
}; | ||
var usmap = new Usmap(_oodleCompressedUsmapPath, options); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseOodleCompressedFromStream() | ||
{ | ||
var options = new UsmapOptions | ||
{ | ||
Oodle = OodleInstance | ||
}; | ||
var usmap = new Usmap(File.OpenRead(_oodleCompressedUsmapPath), options); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
|
||
[Fact] | ||
public void ParseOodleCompressedFromBuffer() | ||
{ | ||
var buffer = File.ReadAllBytes(_oodleCompressedUsmapPath); | ||
var options = new UsmapOptions | ||
{ | ||
Oodle = OodleInstance | ||
}; | ||
var usmap = new Usmap(buffer, options); | ||
Assert.Equal(ExpectedSchemas, usmap.Schemas.Length); | ||
Assert.Equal(ExpectedEnums, usmap.Enums.Length); | ||
Assert.Equal(ExpectedNames, usmap.Names.Length); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
namespace Usmap.NET | ||
namespace UsmapDotNet; | ||
|
||
public enum EUsmapCompressionMethod : byte | ||
{ | ||
public enum EUsmapCompressionMethod : byte | ||
{ | ||
None, | ||
Oodle, | ||
Brotli, | ||
Unknown = byte.MaxValue | ||
} | ||
} | ||
None, | ||
Oodle, | ||
Brotli, | ||
|
||
MaxPlusOne, | ||
Max = MaxPlusOne - 1, | ||
Unknown = byte.MaxValue | ||
} |
Oops, something went wrong.