Review fixes in progress, unverified: stopped by the user before the tests ran

This commit is contained in:
ZacharyZhang-NY committed 2026-10-01 23:01:53 -04:00
1 parent 81894f744a
commit 2190a1b67e
4 files changed
+87 -4

No files matched your search

+28
View File
@@ -8,6 +8,7 @@ private slots:
void eachRefusalSaysWhy();
void theGradientAndTheSmearSayWhyToo();
void aBusyEditorOrAnotherToolSaysNothing();
void theEarlierReasonWinsAtEverySeam();
};
namespace {
@@ -144,5 +145,32 @@ void PaintRefusalTests::aBusyEditorOrAnotherToolSaysNothing()
QCOMPARE(session->brushError(), std::optional<QString>("Earlier"));
}
void PaintRefusalTests::theEarlierReasonWinsAtEverySeam()
{
const auto session = makeSession();
const QUuid layer = session->activeLayerID().value();
// A hidden folder's pixels: the folder, not the hiding.
session->addGroup();
const QUuid folder = session->activeLayerID().value();
session->toggleLayerVisibility(folder);
QCOMPARE(pressed(*session), std::optional<QString>("“Folder 1” is a folder, which has no pixels of its own. Paint on a layer inside it, or on the "
"folder’s mask."));
session->toggleLayerVisibility(folder);
// A hidden layer's mask turned off: the hiding.
session->selectLayer(layer);
session->addLayerMask();
session->toggleLayerMask();
session->toggleLayerVisibility(layer);
QCOMPARE(pressed(*session), std::optional<QString>("“Layer 1” is hidden, or inside a hidden folder. Show it to paint on it."));
session->toggleLayerVisibility(layer);
session->toggleLayerMask();
// An adjustment's pixels in an empty selection: the adjustment.
session->addAdjustment(AdjustmentKind::levels);
session->setAdjustmentEditingID(std::nullopt);
session->selectLayerTarget(session->activeLayerID().value(), false);
emptySelection(*session);
QCOMPARE(pressed(*session), std::optional<QString>("“Levels” is an adjustment layer, with no pixels to paint. Paint on its mask instead."));
}
QTEST_GUILESS_MAIN(PaintRefusalTests)
#include "PaintRefusalTests.moc"