Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancheung committed Apr 14, 2024
1 parent 48eb33f commit cd4b4a8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions FreeTypeSharp.Android.Test/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
using Android.Runtime;
using Android.Widget;
using System;
using FreeTypeSharp;
using static FreeTypeSharp.Native.FT;
using static FreeTypeSharp.FT;

namespace FreeTypeSharp.Android.Test
{
[Activity(Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
protected unsafe override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);

var textView1 = FindViewById<TextView>(Resource.Id.textView1);
var textView1 = FindViewById<TextView>(Resource.Id.textView1);

var library = new FreeTypeLibrary();
FT_Library_Version(library.Native, out var major, out var minor, out var patch);
int major, minor, patch;
FT_Library_Version(library.Native, &major, &minor, &patch);
textView1.Text = $"FreeType version: {major}.{minor}.{patch}";
}
}
Expand Down
1 change: 1 addition & 0 deletions FreeTypeSharp.Core.Test/FreeTypeSharp.Core.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions FreeTypeSharp.Core.Test/Program.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System;
using static FreeTypeSharp.Native.FT;
using static FreeTypeSharp.FT;

namespace FreeTypeSharp.Core.Test
{
class Program
{
static void Main(string[] args)
unsafe static void Main(string[] args)
{
var library = new FreeTypeLibrary();
FT_Library_Version(library.Native, out var major, out var minor, out var patch);
int major, minor, patch;
FT_Library_Version(library.Native, &major, &minor, &patch);
Console.WriteLine($"FreeType version: {major}.{minor}.{patch}");
}
}
Expand Down
7 changes: 4 additions & 3 deletions FreeTypeSharp.iOS.Test/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Foundation;
using UIKit;
using static FreeTypeSharp.Native.FT;
using static FreeTypeSharp.FT;

namespace FreeTypeSharp.iOS.Test {
[Register ("AppDelegate")]
Expand All @@ -10,13 +10,14 @@ public override UIWindow Window {
set;
}

public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
public unsafe override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// create a new window instance based on the screen size
Window = new UIWindow (UIScreen.MainScreen.Bounds);

var library = new FreeTypeLibrary();
FT_Library_Version(library.Native, out var major, out var minor, out var patch);
int major, minor, patch;
FT_Library_Version(library.Native, &major, &minor, &patch);

// create a UIViewController with a single UILabel
var vc = new UIViewController ();
Expand Down
1 change: 1 addition & 0 deletions FreeTypeSharp.iOS.Test/FreeTypeSharp.iOS.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<OutputType>Exe</OutputType>
<MtouchLink>SdkOnly</MtouchLink>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
<MtouchExtraArgs>-gcc_flags "-dlsym:false"</MtouchExtraArgs>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion FreeTypeSharp/FreeTypeLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void Dispose()
}

/// <inheritdoc/>
void Dispose(Boolean disposing)
void Dispose(bool disposing)
{
if (Native != default)
{
Expand Down

0 comments on commit cd4b4a8

Please sign in to comment.