From fdcedca68620a5df23b2cca1a1d48366ee9628ef Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Thu, 4 Jan 2018 06:47:23 +1100 Subject: [PATCH] Fix compile error (spurious include of plusmemo), improve tests slightly --- .../developer/TIKE/child/UfrmTestKeyboard.pas | 2 +- .../Keyman.Test.Console.KeymanAPIHost.pas | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/windows/src/developer/TIKE/child/UfrmTestKeyboard.pas b/windows/src/developer/TIKE/child/UfrmTestKeyboard.pas index c5d5ab9983..e4ed741208 100644 --- a/windows/src/developer/TIKE/child/UfrmTestKeyboard.pas +++ b/windows/src/developer/TIKE/child/UfrmTestKeyboard.pas @@ -29,7 +29,7 @@ interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls, Buttons, int_kmdebug, Menus, ErrorControlledRegistry, - RegistryKeys, UfrmMDIChild, KeymanDeveloperDebuggerMemo, PlusMemo, + RegistryKeys, UfrmMDIChild, KeymanDeveloperDebuggerMemo, KeymanDeveloperMemo; type diff --git a/windows/src/test/test-kmcomapi-win64/Keyman.Test.Console.KeymanAPIHost.pas b/windows/src/test/test-kmcomapi-win64/Keyman.Test.Console.KeymanAPIHost.pas index 9bc18e2f44..d0879e4a86 100644 --- a/windows/src/test/test-kmcomapi-win64/Keyman.Test.Console.KeymanAPIHost.pas +++ b/windows/src/test/test-kmcomapi-win64/Keyman.Test.Console.KeymanAPIHost.pas @@ -379,8 +379,7 @@ begin k.Hotkeys[0].Modifiers; k.Hotkeys[0].VirtualKey; k.Hotkeys[0].RawValue; - Assert.IsTrue({(k.Hotkeys[0].Target >= kh__Low) and <-- always true} - (k.Hotkeys[0].Target <= kh__High)); + Assert.IsTrue(k.Hotkeys[0].Target <= kh__High); end; // @@ -632,16 +631,18 @@ begin //kbd.Loaded; //kbd.Options Assert.IsNull(kbd.OwnerPackage); -// Assert.IsNotNull(kbd.VisualKeyboard); todo +// Assert.IsNull(kbd.VisualKeyboard); -// kbd.InstallVisualKeyboard(const Filename: WideString); todo +// kbd.InstallVisualKeyboard(const Filename: WideString); //todo kbd.Uninstall; k.Keyboards.Refresh; + k.Keyboards.Apply; end; procedure TKeymanAPITest_Elevated.Test_IKeymanPackageInstalled; var pkg: IKeymanPackageInstalled; + kbd: IKeymanKeyboardInstalled; begin k.Packages.Install(FTestPath + 'test.kmp', True); k.Packages.Refresh; @@ -650,9 +651,18 @@ begin Assert.IsNotNull(pkg); Assert.AreEqual('kmp.inf', ExtractFileName(pkg.Filename)); CheckPackageProperties(pkg); + + kbd := k.Keyboards['test']; + Assert.IsNotNull(kbd); + CheckKeyboardProperties(kbd); + Assert.IsNotNull(kbd.OwnerPackage); + Assert.AreEqual('test', kbd.OwnerPackage.ID); + Assert.IsNotNull(kbd.VisualKeyboard); + pkg.Uninstall(True); k.Packages.Refresh; k.Keyboards.Refresh; + k.Keyboards.Apply; end;