Skip to content

Commit

Permalink
Rewrite COOKED_READ_DATA
Browse files Browse the repository at this point in the history
  • Loading branch information
lhecker committed Jul 31, 2023
1 parent f75cfe5 commit dfc0896
Show file tree
Hide file tree
Showing 57 changed files with 1,198 additions and 6,980 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect/alphabet.txt
Expand Up @@ -21,6 +21,7 @@ BBBBCCCCC
BBGGRR
efg
EFG
efgh
EFGh
KLMNOQQQQQQQQQQ
QQQQQQQQQQABCDEFGHIJ
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/spelling/expect/expect.txt
Expand Up @@ -690,7 +690,7 @@ FSINFOCLASS
fte
Ftm
Fullscreens
fullwidth
Fullwidth
FUNCTIONCALL
fuzzer
fuzzmain
Expand Down Expand Up @@ -1117,6 +1117,7 @@ MDs
MEASUREITEM
megamix
memallocator
meme
MENUCHAR
MENUCONTROL
MENUDROPALIGNMENT
Expand Down
24 changes: 2 additions & 22 deletions src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
Expand Up @@ -21,7 +21,6 @@
#include "../host/readDataCooked.hpp"
#include "../host/output.h"
#include "../host/_stream.h" // For WriteCharsLegacy
#include "../host/cmdline.h" // For WC_INTERACTIVE
#include "test/CommonState.hpp"

#include "../cascadia/TerminalCore/Terminal.hpp"
Expand Down Expand Up @@ -3166,20 +3165,6 @@ void ConptyRoundtripTests::NewLinesAtBottomWithBackground()
verifyBuffer(*termTb, term->_mutableViewport.ToExclusive());
}

void doWriteCharsLegacy(SCREEN_INFORMATION& screenInfo, const std::wstring_view string, DWORD flags = 0)
{
auto dwNumBytes = string.size() * sizeof(wchar_t);
VERIFY_NT_SUCCESS(WriteCharsLegacy(screenInfo,
string.data(),
string.data(),
string.data(),
&dwNumBytes,
nullptr,
screenInfo.GetTextBuffer().GetCursor().GetPosition().x,
flags,
nullptr));
}

void ConptyRoundtripTests::WrapNewLineAtBottom()
{
// The actual bug case is
Expand Down Expand Up @@ -3221,11 +3206,6 @@ void ConptyRoundtripTests::WrapNewLineAtBottom()
return;
}

// I've tested this with 0x0, 0x4, 0x80, 0x84, and 0-8, and none of these
// flags seem to make a difference. So we're just assuming 0 here, so we
// don't test a bunch of redundant cases.
const auto writeCharsLegacyMode = 0;

// This test was originally written for
// https://github.com/microsoft/terminal/issues/5691
//
Expand Down Expand Up @@ -3264,7 +3244,7 @@ void ConptyRoundtripTests::WrapNewLineAtBottom()
}
else if (writingMethod == PrintWithWriteCharsLegacy)
{
doWriteCharsLegacy(si, str, writeCharsLegacyMode);
WriteCharsLegacy(si, str, false, nullptr));
}
};

Expand Down Expand Up @@ -3422,7 +3402,7 @@ void ConptyRoundtripTests::WrapNewLineAtBottomLikeMSYS()
}
else if (writingMethod == PrintWithWriteCharsLegacy)
{
doWriteCharsLegacy(si, str, WC_INTERACTIVE);
WriteCharsLegacy(si, str, true, nullptr));
}
};

Expand Down

0 comments on commit dfc0896

Please sign in to comment.