Skip to content

Commit

Permalink
add test for Symbol::canDisassemble
Browse files Browse the repository at this point in the history
  • Loading branch information
lievenhey committed Jan 12, 2024
1 parent bdd450b commit 1fbc29b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/modeltests/tst_disassemblyoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,32 @@ private slots:
}
}

void testCanDisassemble_data()
{
QTest::addColumn<Data::Symbol>("symbol");
QTest::addColumn<bool>("canDisassemble");

QTest::newRow("normal symbol") << Data::Symbol(QStringLiteral("main"), 0x1159, 0x32805, {},
QStringLiteral("/some/path"), {}, false, false)
<< true;
QTest::newRow("relocated symbol")
<< Data::Symbol(QStringLiteral("printf"), 0, 0, {}, QStringLiteral("/some/path"), {}, false, false)
<< false;
QTest::newRow("inlined symbol") << Data::Symbol(QStringLiteral("main::memcpy"), 0x1159, 0x32805, {},
QStringLiteral("/some/path"), {}, false, true)
<< false;
QTest::newRow("unkown binary") << Data::Symbol(QStringLiteral("main"), 0x1159, 0x32805, {}, {}, {}, false,
false)
<< false;
}

void testCanDisassemble()
{
QFETCH(Data::Symbol, symbol);
QFETCH(bool, canDisassemble);
QCOMPARE(symbol.canDisassemble(), canDisassemble);
}

private:
struct FunctionData
{
Expand Down

0 comments on commit 1fbc29b

Please sign in to comment.