Skip to content

Commit

Permalink
all together, these tests can pollute each other now
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Apr 13, 2022
1 parent f2677bd commit 098f6e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3865,6 +3865,8 @@ void ConptyRoundtripTests::SimpleAltBufferTest()
gci.LockConsole(); // Lock must be taken to manipulate alt/main buffer state.
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
sm.ProcessString(L"\x1b[?1049h");
// Don't leave ourselves in the alt buffer - that'll pollute other tests.
auto leaveAltBuffer = wil::scope_exit([&] { sm.ProcessString(L"\x1b[?1049l"); });

Log::Comment(L"Painting the frame");
VERIFY_SUCCEEDED(renderer.PaintFrame());
Expand Down Expand Up @@ -4024,6 +4026,8 @@ void ConptyRoundtripTests::AltBufferToAltBufferTest()
gci.LockConsole(); // Lock must be taken to manipulate alt/main buffer state.
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
sm.ProcessString(L"\x1b[?1049h");
// Don't leave ourselves in the alt buffer - that'll pollute other tests.
auto leaveAltBuffer = wil::scope_exit([&] { sm.ProcessString(L"\x1b[?1049l"); });

Log::Comment(L"Painting the frame");
VERIFY_SUCCEEDED(renderer.PaintFrame());
Expand Down Expand Up @@ -4090,6 +4094,9 @@ void ConptyRoundtripTests::AltBufferResizeCrash()

_checkConptyOutput = false;

// Don't leave ourselves in the alt buffer - that'll pollute other tests.
auto leaveAltBuffer = wil::scope_exit([&] { sm.ProcessString(L"\x1b[?1049l"); });

// Note: we really don't care about the output in this test. We could, but
// mostly we care to ensure we don't crash. If we make it through this test,
// then it's a success.
Expand Down

0 comments on commit 098f6e3

Please sign in to comment.