Skip to content

Commit

Permalink
Remove the HardReset adapter test, which is better handled by the Har…
Browse files Browse the repository at this point in the history
…dResetBuffer test.
  • Loading branch information
j4james committed Nov 19, 2019
1 parent 7407ee8 commit e2e138d
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions src/terminal/adapter/ut_adapter/adapterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2580,75 +2580,6 @@ class AdapterTest
VERIFY_IS_TRUE(_pDispatch->SetGraphicsRendition(rgOptions, cOptions));
}

TEST_METHOD(HardReset)
{
Log::Comment(L"Starting test...");

_testGetSet->PrepData();

///////////////// Components of a EraseScrollback //////////////////////
_testGetSet->_fExpectedWindowAbsolute = true;
SMALL_RECT srRegion = { 0 };
srRegion.Bottom = _testGetSet->_srViewport.Bottom - _testGetSet->_srViewport.Top - 1;
srRegion.Right = _testGetSet->_srViewport.Right - _testGetSet->_srViewport.Left - 1;
_testGetSet->_srExpectedConsoleWindow = srRegion;
// The cursor will be moved to the same relative location in the new viewport with origin @ 0, 0
const COORD coordRelativeCursor = { _testGetSet->_coordCursorPos.X - _testGetSet->_srViewport.Left,
_testGetSet->_coordCursorPos.Y - _testGetSet->_srViewport.Top };
const COORD coordExpectedCursorPos = { 0, 0 };

auto prepExpectedParameters = [&]() {
// Cursor to 1,1
_testGetSet->_coordExpectedCursorPos = { 0, 0 };
_testGetSet->_fSetConsoleCursorPositionResult = true;
_testGetSet->_fPrivateSetLegacyAttributesResult = true;
_testGetSet->_fPrivateSetDefaultAttributesResult = true;
_testGetSet->_fPrivateBoldTextResult = true;
_testGetSet->_fExpectedForeground = true;
_testGetSet->_fExpectedBackground = true;
_testGetSet->_fExpectedMeta = true;
_testGetSet->_fExpectedIsBold = false;
_testGetSet->_expectedShowCursor = true;
_testGetSet->_privateShowCursorResult = true;

// We're expecting _SetDefaultColorHelper to call
// PrivateSetLegacyAttributes with 0 as the wAttr param.
_testGetSet->_wExpectedAttribute = 0;

// Prepare the results of SoftReset api calls
_testGetSet->_fPrivateSetCursorKeysModeResult = true;
_testGetSet->_fPrivateSetKeypadModeResult = true;
_testGetSet->_fGetConsoleScreenBufferInfoExResult = true;
_testGetSet->_fPrivateSetScrollingRegionResult = true;
};
prepExpectedParameters();

VERIFY_IS_TRUE(_pDispatch->HardReset());
VERIFY_ARE_EQUAL(_testGetSet->_coordCursorPos, coordExpectedCursorPos);
VERIFY_ARE_EQUAL(_testGetSet->_fUsingRgbColor, false);

Log::Comment(L"Test 2: Gracefully fail when getting console information fails.");
_testGetSet->PrepData();
prepExpectedParameters();
_testGetSet->_fGetConsoleScreenBufferInfoExResult = false;

VERIFY_IS_FALSE(_pDispatch->HardReset());

Log::Comment(L"Test 3: Gracefully fail when filling the rectangle fails.");
_testGetSet->PrepData();
prepExpectedParameters();
_testGetSet->_fFillConsoleOutputCharacterWResult = false;

VERIFY_IS_FALSE(_pDispatch->HardReset());

Log::Comment(L"Test 4: Gracefully fail when setting the window fails.");
_testGetSet->PrepData();
prepExpectedParameters();
_testGetSet->_fSetConsoleWindowInfoResult = false;

VERIFY_IS_FALSE(_pDispatch->HardReset());
}

TEST_METHOD(SetColorTableValue)
{
_testGetSet->PrepData();
Expand Down

0 comments on commit e2e138d

Please sign in to comment.