-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROW: clean up in preparation to hide CharRow & AttrRow #8446
Conversation
@msftbot make sure @miniksa signs off on this |
Hello @zadjii-msft! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
src/buffer/out/Row.hpp
Outdated
@@ -36,6 +36,12 @@ class ROW final | |||
|
|||
size_t size() const noexcept; | |||
|
|||
void SetWrapForced(const bool wrap) noexcept; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just move the getters/setters up here per the other PR and chat recently about inline potential.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason not to
This reverts commit d226521.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems straightforward
This is by no means comprehensive. It will be unmarked as draft when it is more comprehensive. This pull request adds some tests for resizing a TextBuffer and reflowing its contents. Each test takes the form of an initial state and a number of buffers of different sizes. The initial state is used to seed the first TextBuffer, and the subsequent buffers are only used to compare. I manually reimplemented some of the DBCS logic to ensure that the buffers contain _exactly_ what they're supposed to. I know this is non-ideal. After some of the CharRow changes in #8446 land, this will need to be updated. There's a cool bit of TAEF gore in here: the IDataSource. An IDataSource allows us to programmatically return test cases. It's a code-only version of its support for parameterized tests of the form `Data:x = {0, 1, 2}` . The only downsides are... 1. It looks like COM (it is not using COM under the hood, just the COM ABI) 2. Property values must be returned as strings. To best support rich test types, I used IDataSource to produce _a lit of array indices_ and nothing more. The test is run once for array member, and it is the test's responsibility to look up the object to which that index refers. Works great though! Each reflow test is its own unit, and a failure in an earlier reflow test will not tank a later one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookin' good. Can't wait until the next step!
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This is by no means comprehensive. It will be unmarked as draft when it is more comprehensive. This pull request adds some tests for resizing a TextBuffer and reflowing its contents. Each test takes the form of an initial state and a number of buffers of different sizes. The initial state is used to seed the first TextBuffer, and the subsequent buffers are only used to compare. I manually reimplemented some of the DBCS logic to ensure that the buffers contain _exactly_ what they're supposed to. I know this is non-ideal. After some of the CharRow changes in microsoft#8446 land, this will need to be updated. There's a cool bit of TAEF gore in here: the IDataSource. An IDataSource allows us to programmatically return test cases. It's a code-only version of its support for parameterized tests of the form `Data:x = {0, 1, 2}` . The only downsides are... 1. It looks like COM (it is not using COM under the hood, just the COM ABI) 2. Property values must be returned as strings. To best support rich test types, I used IDataSource to produce _a lit of array indices_ and nothing more. The test is run once for array member, and it is the test's responsibility to look up the object to which that index refers. Works great though! Each reflow test is its own unit, and a failure in an earlier reflow test will not tank a later one.
Moving things out of CharRow into ROW helps us hide it as an implementation detail. This is part one of many. ### CharRow: Hide ClearCell, use ROW::ClearColumn ### CharRow: Hide GetText, use ROW::GetText ### CharRowBaseTests: remove dead file (never used!) ### CharRow: Move DoubleBytePadded into ROW ### CharRow: Move WrapForced into ROW ### Char/AttrRow: Hide Reset, use ROW::Reset ### Remove RowCellIterator (dead code) RCI was unused; it was replaced by TextBufferCellIterator shortly after its creation ### Move AttrRowTests to ut_textbuffer from ut_host It had no reliance on the host.
Moving things out of CharRow into ROW helps us hide it as an implementation detail.
This is part one of many.
CharRow: Hide ClearCell, use ROW::ClearColumn
CharRow: Hide GetText, use ROW::GetText
CharRowBaseTests: remove dead file (never used!)
CharRow: Move DoubleBytePadded into ROW
CharRow: Move WrapForced into ROW
Char/AttrRow: Hide Reset, use ROW::Reset
Remove RowCellIterator (dead code)
RCI was unused; it was replaced by TextBufferCellIterator shortly after its creation
Move AttrRowTests to ut_textbuffer from ut_host
It had no reliance on the host.