mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[FancyZones] Fix blank layout error (#26828)
This commit is contained in:
@@ -112,15 +112,15 @@ namespace FancyZonesUnitTests
|
||||
TEST_METHOD (ZoneSetLayoutTypeToString)
|
||||
{
|
||||
std::map<int, std::wstring> expectedMap = {
|
||||
std::make_pair(-2, L"TypeToString_ERROR"),
|
||||
std::make_pair(-1, L"blank"),
|
||||
std::make_pair(0, L"focus"),
|
||||
std::make_pair(1, L"columns"),
|
||||
std::make_pair(2, L"rows"),
|
||||
std::make_pair(3, L"grid"),
|
||||
std::make_pair(4, L"priority-grid"),
|
||||
std::make_pair(5, L"custom"),
|
||||
std::make_pair(6, L"TypeToString_ERROR"),
|
||||
std::make_pair(-1, L"TypeToString_ERROR"),
|
||||
std::make_pair(0, L"blank"),
|
||||
std::make_pair(1, L"focus"),
|
||||
std::make_pair(2, L"columns"),
|
||||
std::make_pair(3, L"rows"),
|
||||
std::make_pair(4, L"grid"),
|
||||
std::make_pair(5, L"priority-grid"),
|
||||
std::make_pair(6, L"custom"),
|
||||
std::make_pair(7, L"TypeToString_ERROR"),
|
||||
};
|
||||
|
||||
for (const auto& expected : expectedMap)
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace FancyZonesUnitTests
|
||||
|
||||
TEST_METHOD (ZeroZoneCount)
|
||||
{
|
||||
for (int type = static_cast<int>(ZoneSetLayoutType::Focus); type < static_cast<int>(ZoneSetLayoutType::Custom); type++)
|
||||
for (int type = static_cast<int>(ZoneSetLayoutType::Columns); type < static_cast<int>(ZoneSetLayoutType::Custom); type++)
|
||||
{
|
||||
LayoutData data = m_data;
|
||||
data.type = static_cast<ZoneSetLayoutType>(type);
|
||||
@@ -395,6 +395,32 @@ namespace FancyZonesUnitTests
|
||||
Assert::IsFalse(result);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
LayoutData data = m_data;
|
||||
data.type = static_cast<ZoneSetLayoutType>(ZoneSetLayoutType::Blank);
|
||||
data.zoneCount = 0;
|
||||
auto layout = std::make_unique<Layout>(data);
|
||||
|
||||
for (const auto& rect : m_workAreaRects)
|
||||
{
|
||||
auto result = layout->Init(rect, Mocks::Monitor());
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
LayoutData data = m_data;
|
||||
data.type = static_cast<ZoneSetLayoutType>(ZoneSetLayoutType::Focus);
|
||||
data.zoneCount = 0;
|
||||
auto layout = std::make_unique<Layout>(data);
|
||||
|
||||
for (const auto& rect : m_workAreaRects)
|
||||
{
|
||||
auto result = layout->Init(rect, Mocks::Monitor());
|
||||
Assert::IsTrue(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_METHOD (BigZoneCount)
|
||||
|
||||
Reference in New Issue
Block a user