Add & Run WASM Unit Tests (#1361)

This commit is contained in:
Matthew Leibowitz 2020-06-29 19:28:12 +02:00 committed by GitHub
commit b647079f7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 583 additions and 25 deletions

View file

@ -15,7 +15,9 @@ namespace NativeLibraryMiniTest {
Console.WriteLine("Starting test...");
Console.WriteLine("Version test...");
Console.WriteLine($"sk_version_get_string() = {sk_version_get_string()}");
Console.WriteLine($"sk_version_get_milestone() = {sk_version_get_milestone()}");
var str = Marshal.PtrToStringAnsi((IntPtr)sk_version_get_string());
Console.WriteLine($"sk_version_get_string() = {str}");
Console.WriteLine("Color type test...");
Console.WriteLine($"sk_colortype_get_default_8888() = {sk_colortype_get_default_8888()}");
@ -48,7 +50,10 @@ namespace NativeLibraryMiniTest {
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.LPStr)]
static extern string sk_version_get_string();
static extern void* sk_version_get_string();
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
static extern int sk_version_get_milestone();
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
static extern sk_colortype_t sk_colortype_get_default_8888();