other pr nits, test comments

This commit is contained in:
Mike Griese 2021-10-28 08:29:45 -05:00
parent 7597114f5a
commit fdd283d7d6
3 changed files with 19 additions and 10 deletions

View file

@ -1323,6 +1323,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(9u, keymap.Size()); VERIFY_ARE_EQUAL(9u, keymap.Size());
{ {
Log::Comment(L"profile.elevate=omitted, action.elevate=nullopt: don't auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('A') }; KeyChord kc{ true, false, false, static_cast<int32_t>('A') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1343,6 +1345,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(false, termSettings.Elevate()); VERIFY_ARE_EQUAL(false, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=true, action.elevate=nullopt: DO auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('B') }; KeyChord kc{ true, false, false, static_cast<int32_t>('B') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1363,6 +1367,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(true, termSettings.Elevate()); VERIFY_ARE_EQUAL(true, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=false, action.elevate=nullopt: don't auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('C') }; KeyChord kc{ true, false, false, static_cast<int32_t>('C') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1384,6 +1390,8 @@ namespace TerminalAppLocalTests
} }
{ {
Log::Comment(L"profile.elevate=omitted, action.elevate=false: don't auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('D') }; KeyChord kc{ true, false, false, static_cast<int32_t>('D') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1405,6 +1413,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(false, termSettings.Elevate()); VERIFY_ARE_EQUAL(false, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=true, action.elevate=false: don't auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('E') }; KeyChord kc{ true, false, false, static_cast<int32_t>('E') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1426,6 +1436,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(false, termSettings.Elevate()); VERIFY_ARE_EQUAL(false, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=false, action.elevate=false: don't auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('F') }; KeyChord kc{ true, false, false, static_cast<int32_t>('F') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1448,6 +1460,8 @@ namespace TerminalAppLocalTests
} }
{ {
Log::Comment(L"profile.elevate=omitted, action.elevate=true: DO auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('G') }; KeyChord kc{ true, false, false, static_cast<int32_t>('G') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1469,6 +1483,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(true, termSettings.Elevate()); VERIFY_ARE_EQUAL(true, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=true, action.elevate=true: DO auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('H') }; KeyChord kc{ true, false, false, static_cast<int32_t>('H') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
@ -1490,6 +1505,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(true, termSettings.Elevate()); VERIFY_ARE_EQUAL(true, termSettings.Elevate());
} }
{ {
Log::Comment(L"profile.elevate=false, action.elevate=true: DO auto elevate");
KeyChord kc{ true, false, false, static_cast<int32_t>('I') }; KeyChord kc{ true, false, false, static_cast<int32_t>('I') };
auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc); auto actionAndArgs = TestUtils::GetActionAndArgs(keymap, kc);
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action()); VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());

View file

@ -135,7 +135,6 @@ namespace Microsoft.Terminal.Settings.Model
Boolean Equals(NewTerminalArgs other); Boolean Equals(NewTerminalArgs other);
String GenerateName(); String GenerateName();
String ToCommandline(); String ToCommandline();
UInt64 Hash(); UInt64 Hash();
}; };

View file

@ -103,15 +103,8 @@ AppHost::~AppHost()
{ {
// destruction order is important for proper teardown here // destruction order is important for proper teardown here
_window = nullptr; _window = nullptr;
try _app.Close();
{ _app = nullptr;
if (_app)
{
_app.Close();
_app = nullptr;
}
}
CATCH_LOG();
} }
bool AppHost::OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down) bool AppHost::OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down)