Skip to content

Commit

Permalink
fix test + PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Aug 13, 2020
1 parent 3f712e7 commit 1fb018d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/CascadiaSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ std::string CascadiaSettings::_ApplyFirstRunChangesToSettingsTemplate(std::strin
// - profileGuid: the GUID of the profile to find the scheme for.
// Return Value:
// - a non-owning pointer to the scheme.
const ColorScheme* CascadiaSettings::GetColorSchemeForProfile(const GUID profileGuid) const
const ColorScheme CascadiaSettings::GetColorSchemeForProfile(const GUID profileGuid) const
{
auto* profile = FindProfile(profileGuid);
if (!profile)
Expand All @@ -745,7 +745,7 @@ const ColorScheme* CascadiaSettings::GetColorSchemeForProfile(const GUID profile
auto scheme = _globals.GetColorSchemes().find(schemeName);
if (scheme != _globals.GetColorSchemes().end())
{
return &scheme->second;
return scheme->second;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/CascadiaSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TerminalApp::CascadiaSettings final
static std::filesystem::path GetDefaultSettingsPath();

const Profile* FindProfile(GUID profileGuid) const noexcept;
const winrt::TerminalApp::ColorScheme* GetColorSchemeForProfile(const GUID profileGuid) const;
const winrt::TerminalApp::ColorScheme GetColorSchemeForProfile(const GUID profileGuid) const;

std::vector<TerminalApp::SettingsLoadWarnings>& GetWarnings();

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ namespace winrt::TerminalApp::implementation
newTerminalArgs.Profile().empty());

// Lookup the name of the color scheme used by this profile.
const auto* scheme = _settings->GetColorSchemeForProfile(profileGuid);
const auto scheme = _settings->GetColorSchemeForProfile(profileGuid);
// If they explicitly specified `null` as the scheme (indicating _no_ scheme), log
// that as the empty string.
const auto schemeName = scheme ? scheme->Name() : L"\0";
const auto schemeName = scheme ? scheme.Name() : L"\0";

TraceLoggingWrite(
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
Expand Down
8 changes: 4 additions & 4 deletions src/cascadia/ut_app/JsonTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ namespace TerminalAppUnitTests
const auto schemeObject = VerifyParseSucceeded(campbellScheme);
auto scheme = implementation::ColorScheme::FromJson(schemeObject);
VERIFY_ARE_EQUAL(L"Campbell", scheme->Name());
VERIFY_ARE_EQUAL(til::color(0xf2, 0xf2, 0xf2, 0), scheme->Foreground());
VERIFY_ARE_EQUAL(til::color(0x0c, 0x0c, 0x0c, 0), scheme->Background());
VERIFY_ARE_EQUAL(til::color(0x13, 0x13, 0x13, 0), scheme->SelectionBackground());
VERIFY_ARE_EQUAL(til::color(0xFF, 0xFF, 0xFF, 0), scheme->CursorColor());
VERIFY_ARE_EQUAL(til::color(0xf2, 0xf2, 0xf2, 255), scheme->Foreground());
VERIFY_ARE_EQUAL(til::color(0x0c, 0x0c, 0x0c, 255), scheme->Background());
VERIFY_ARE_EQUAL(til::color(0x13, 0x13, 0x13, 255), scheme->SelectionBackground());
VERIFY_ARE_EQUAL(til::color(0xFF, 0xFF, 0xFF, 255), scheme->CursorColor());

std::array<COLORREF, COLOR_TABLE_SIZE> expectedCampbellTable;
auto campbellSpan = gsl::span<COLORREF>(&expectedCampbellTable[0], COLOR_TABLE_SIZE);
Expand Down

0 comments on commit 1fb018d

Please sign in to comment.