summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/lancelot/paintcommands.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-30 01:00:58 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-30 01:00:58 +0100
commit4c89005ebed79bb6ba871c407e6b8c2f8d982abf (patch)
treeec03d80933a2a3d60b129344c244d19fec24fb5b /tests/auto/other/lancelot/paintcommands.cpp
parent3de89e57c9640ef9d476130abc4cca9120d3ef8c (diff)
parent4e9e9c2c17afa472fb8ae04fc36d9605863f8b83 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'tests/auto/other/lancelot/paintcommands.cpp')
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 215a4c2a29..7430c93a8e 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -230,9 +230,9 @@ void PaintCommands::staticInit()
"begin_block <blockName>",
"begin_block blockName");
DECL_PAINTCOMMAND("end_block", command_end_block,
- "^end_block$",
- "end_block",
- "end_block");
+ "^end_block\\s*(\\w*)$",
+ "end_block [blockName]",
+ "end_block blockName");
DECL_PAINTCOMMAND("repeat_block", command_repeat_block,
"^repeat_block\\s+(\\w*)$",
"repeat_block <blockName>",
@@ -744,6 +744,13 @@ void PaintCommands::runCommands()
if (height <= 0)
height = 800;
+ m_pathMap.clear();
+ m_imageMap.clear();
+ m_pixmapMap.clear();
+ m_regionMap.clear();
+ m_gradientStops.clear();
+ m_blockMap.clear();
+
// paint background
if (m_checkers_background) {
QPixmap pm(20, 20);
@@ -901,6 +908,8 @@ void PaintCommands::command_begin_block(QRegularExpressionMatch re)
const QString &blockName = re.captured(1);
if (m_verboseMode)
printf(" -(lance) begin_block (%s)\n", qPrintable(blockName));
+ if (m_blockMap.contains(blockName))
+ qFatal("Two blocks named (%s)", qPrintable(blockName));
m_commands[m_currentCommandIndex] = QLatin1String("# begin block (") + blockName + QLatin1Char(')');
QStringList newBlock;