Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
  • Loading branch information
zadjii-msft and carlos-zamora authored Jan 29, 2021
1 parent faf4544 commit 19765b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cascadia/Remoting/Monarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
try
{
auto peasantSearch = _peasants.find(peasantID);
const auto peasantSearch = _peasants.find(peasantID);
auto maybeThePeasant = peasantSearch == _peasants.end() ? nullptr : peasantSearch->second;
// Ask the peasant for their PID. This will validate that they're
// actually still alive.
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ namespace winrt::TerminalApp::implementation
// Method Description:
// - Parse the given commandline args in an attempt to find the specified
// window. The rest of the args are ignored for now (they'll be handled
// whenever the commandline fets to the window it was intended for).
// whenever the commandline gets to the window it was intended for).
// - Note that this function will only ever be called by the monarch. A
// return value of `0` in this case does not mean "run the commandline in
// _this_ process", rather it means "run the commandline in the current
Expand All @@ -1198,7 +1198,7 @@ namespace winrt::TerminalApp::implementation
int32_t AppLogic::FindTargetWindow(array_view<const winrt::hstring> args)
{
::TerminalApp::AppCommandlineArgs appArgs;
auto result = appArgs.ParseArgs(args);
const auto result = appArgs.ParseArgs(args);
if (result == 0)
{
return appArgs.GetTargetWindow();
Expand Down
9 changes: 6 additions & 3 deletions src/cascadia/UnitTests_Remoting/RemotingTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using namespace winrt::Microsoft::Terminal;
namespace RemotingUnitTests
{
// This is a silly helper struct.
// It will always throw an hresult_error on any of it's methods.
// It will always throw an hresult_error on any of its methods.
//
// In the tests, it's hard to emulate a peasant process being totally dead
// once the Monarch has captured a reference to it. Since everything's
Expand Down Expand Up @@ -112,10 +112,10 @@ namespace RemotingUnitTests
void RemotingTests::_findTargetWindowHelper(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs& args)
{
auto arguments = args.Args().Args();
const auto arguments = args.Args().Args();
if (arguments.size() > 0)
{
auto index = std::stoi(arguments.at(0).c_str());
const auto index = std::stoi(arguments.at(0).c_str());
args.ResultTargetWindow(index);
}
}
Expand Down Expand Up @@ -424,6 +424,7 @@ namespace RemotingUnitTests
VERIFY_ARE_EQUAL(false, (bool)result.Id());
}
}

void RemotingTests::ProposeCommandlineCurrentWindow()
{
Log::Comment(L"Test proposing a commandline for the current window (ID=0)");
Expand Down Expand Up @@ -504,6 +505,7 @@ namespace RemotingUnitTests
VERIFY_ARE_EQUAL(false, (bool)result.Id());
}
}

void RemotingTests::ProposeCommandlineNonExistentWindow()
{
Log::Comment(L"Test proposing a commandline for an ID that doesn't have a current peasant");
Expand Down Expand Up @@ -540,6 +542,7 @@ namespace RemotingUnitTests
VERIFY_ARE_EQUAL(10u, result.Id().Value());
}
}

void RemotingTests::ProposeCommandlineDeadWindow()
{
Log::Comment(L"Test proposing a commandline for a peasant that previously died");
Expand Down

1 comment on commit 19765b1

@github-actions

This comment was marked as outdated.

Please sign in to comment.