Skip to content

Commit

Permalink
Fix the TilWinRT tests (#15820)
Browse files Browse the repository at this point in the history
It's unknown how this ever worked, or why it stopped working recently.

We removed our desire to directly compare property against T at some point.

(cherry picked from commit 256d46a)
Service-Card-Id: 90625813
Service-Version: 1.18
  • Loading branch information
zadjii-msft authored and DHowett committed Sep 22, 2023
1 parent e71c78e commit 9206575
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/cascadia/UnitTests_TerminalCore/TilWinRtHelpersTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ void TilWinRtHelpersTests::TestTruthiness()
til::property<winrt::hstring> FullString{ L"Full" };

VERIFY_IS_FALSE(Foo());
VERIFY_IS_FALSE(Foo);
VERIFY_IS_FALSE((bool)Foo);

VERIFY_IS_FALSE(Bar());
VERIFY_IS_FALSE(Bar);
VERIFY_IS_FALSE((bool)Bar);

VERIFY_IS_FALSE(EmptyString);
VERIFY_IS_FALSE((bool)EmptyString);
VERIFY_IS_FALSE(!EmptyString().empty());

Foo(true);
VERIFY_IS_TRUE(Foo());
VERIFY_IS_TRUE(Foo);
VERIFY_IS_TRUE((bool)Foo);

Bar(11);
VERIFY_IS_TRUE(Bar());
VERIFY_IS_TRUE(Bar);
VERIFY_IS_TRUE((bool)Bar);

VERIFY_IS_TRUE(FullString);
VERIFY_IS_TRUE((bool)FullString);
VERIFY_IS_TRUE(!FullString().empty());
}

Expand Down Expand Up @@ -177,13 +177,13 @@ void TilWinRtHelpersTests::TestComposedConstProperties()
const struct Helper noTouching;

VERIFY_ARE_EQUAL(0, changeMe.Foo());
VERIFY_ARE_EQUAL(3, changeMe.Composed().first);
VERIFY_ARE_EQUAL(2, changeMe.Composed().second);
VERIFY_ARE_EQUAL(3, changeMe.Composed().first());
VERIFY_ARE_EQUAL(2, changeMe.Composed().second());
VERIFY_ARE_EQUAL(L"", changeMe.MyString());

VERIFY_ARE_EQUAL(0, noTouching.Foo());
VERIFY_ARE_EQUAL(3, noTouching.Composed().first);
VERIFY_ARE_EQUAL(2, noTouching.Composed().second);
VERIFY_ARE_EQUAL(3, noTouching.Composed().first());
VERIFY_ARE_EQUAL(2, noTouching.Composed().second());
VERIFY_ARE_EQUAL(L"", noTouching.MyString());

changeMe.Foo(42);
Expand Down
2 changes: 1 addition & 1 deletion src/inc/til/winrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
{
_value = std::forward<decltype(arg)>(arg);
}
operator bool() const noexcept
explicit operator bool() const noexcept
{
if constexpr (std::is_same_v<T, winrt::hstring>)
{
Expand Down

0 comments on commit 9206575

Please sign in to comment.