Fix VtIoTests for debug builds (#14358)

1774cfd added a debug assertion in `CreateIoHandlers` which broke this test.
This commit is contained in:
Leonard Hecker 2022-11-10 16:58:10 +01:00 committed by GitHub
parent 88c3ef68a5
commit c12dc2aa4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -6,11 +6,11 @@
#include "../../inc/consoletaeftemplates.hpp"
#include "../../types/inc/Viewport.hpp"
#include "../VtIo.hpp"
#include "../../interactivity/inc/ServiceLocator.hpp"
#include "../../renderer/base/Renderer.hpp"
#include "../../renderer/vt/Xterm256Engine.hpp"
#include "../../renderer/vt/XtermEngine.hpp"
#include "../../renderer/base/Renderer.hpp"
#include "../Settings.hpp"
#include "../VtIo.hpp"
#if TIL_FEATURE_CONHOSTDXENGINE_ENABLED
#include "../../renderer/dx/DxRenderer.hpp"
@ -19,7 +19,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace std;
using namespace Microsoft::Console::Interactivity;
class Microsoft::Console::VirtualTerminal::VtIoTests
{
@ -473,6 +473,13 @@ void VtIoTests::BasicAnonymousPipeOpeningWithSignalChannelTest()
Log::Comment(L"\tinitializing vtio");
// CreateIoHandlers() assert()s on IsConsoleLocked() to guard against a race condition.
auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.LockConsole();
const auto cleanup = wil::scope_exit([&]() {
gci.UnlockConsole();
});
VtIo vtio;
VERIFY_IS_FALSE(vtio.IsUsingVt());
VERIFY_ARE_EQUAL(nullptr, vtio._pPtySignalInputThread);