Commit 7512f620 authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

add gdb line test for thread start and current thread markers

these tests do not presently pass because they regressed in the
qregularexpression port 8d8062fe

as for exmaple observed in https://bugs.kde.org/show_bug.cgi?id=423222
which lacks the marker lines

at a glance exactMatch->hasMatch wasn't a good port and so the line
falls into the CRAP regex' `0x[0-9a-f]+.*|` which would match line
containing a hex number
parent 12d1ff57
......@@ -121,6 +121,24 @@ private Q_SLOTS:
QCOMPARE(line.type(), BacktraceLine::Unknown);
QCOMPARE(line.rating(), BacktraceLine::InvalidRating);
}
void testThreadStart()
{
const QString input = QStringLiteral("Thread 35 (Thread 0x7f77f57fa700 (LWP 8133)):\n");
BacktraceLineGdb line(input);
QCOMPARE(line.type(), BacktraceLineGdb::ThreadStart);
QCOMPARE(line.rating(), BacktraceLine::InvalidRating);
QCOMPARE(line.toString(), input);
}
void testThreadIndicator()
{
const QString input = QStringLiteral("[Current thread is 1 (Thread 0x7f78847c7c80 (LWP 7806))]\n");
BacktraceLineGdb line(input);
QCOMPARE(line.type(), BacktraceLineGdb::ThreadIndicator);
QCOMPARE(line.rating(), BacktraceLine::InvalidRating);
QCOMPARE(line.toString(), input);
}
};
QTEST_GUILESS_MAIN(GdbBacktraceLineTest)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment