diff options
| author | 2020-06-28 15:00:39 +0200 | |
|---|---|---|
| committer | 2020-06-28 15:00:39 +0200 | |
| commit | b77995f1c0995ee4455a7c14cd07d8ac513b7d18 (patch) | |
| tree | 8a964eb8e49e7813c4b1cb3ce48e008f16f32bd1 | |
| parent | c5ea6210eedf433ec247e0f6b439a58316f1d11a (diff) | |
| download | OneRoll-b77995f1c0995ee4455a7c14cd07d8ac513b7d18.tar.gz OneRoll-b77995f1c0995ee4455a7c14cd07d8ac513b7d18.zip | |
rename API to get errorMap.
| -rw-r--r-- | include/diceparser.h | 9 | ||||
| -rw-r--r-- | tests/dice/tst_dice.cpp | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/diceparser.h b/include/diceparser.h index 3f642e0..7cc4018 100644 --- a/include/diceparser.h +++ b/include/diceparser.h @@ -24,6 +24,7 @@ #include <QMap> #include <QString> +#include <QVariant> #include <memory> #include <vector> @@ -145,17 +146,17 @@ public: * @brief getErrorList * @return */ - QMap<Dice::ERROR_CODE, QString> getErrorMap(); + QMap<Dice::ERROR_CODE, QString> errorMap() const; /** * @brief setPathToHelp set the path to the documentation, this path must be adatped to the lang of application etc… * @param l the path. */ void setPathToHelp(QString l); /** - * @brief getAllStringResult + * @brief allFirstResultAsString * @return */ - QStringList getAllStringResult(bool& hasAlias); + QStringList allFirstResultAsString(bool& hasAlias); /** * @brief getAllDiceResult * @param hasAlias @@ -187,7 +188,7 @@ private: * @param notthelast * @return */ - bool hasResultOfType(Dice::RESULT_TYPE, ExecutionNode* node, bool notthelast= false); + bool hasResultOfType(Dice::RESULT_TYPE, ExecutionNode* node, QVariant& value, bool notthelast= false); bool readBlocInstruction(QString& str, ExecutionNode*& resultnode); private: diff --git a/tests/dice/tst_dice.cpp b/tests/dice/tst_dice.cpp index 4c39bd4..3c31f12 100644 --- a/tests/dice/tst_dice.cpp +++ b/tests/dice/tst_dice.cpp @@ -428,7 +428,7 @@ void TestDice::wrongCommandsTest() if(a) { m_diceParser->start(); - auto map= m_diceParser->getErrorMap(); + auto map= m_diceParser->errorMap(); a= map.isEmpty(); } QCOMPARE(a, valid); @@ -466,7 +466,7 @@ void TestDice::wrongCommandsExecutionTimeTest() bool test= m_diceParser->parseLine(cmd); m_diceParser->start(); - QVERIFY2(m_diceParser->getErrorMap().isEmpty() == false || !test, cmd.toStdString().c_str()); + QVERIFY2(m_diceParser->errorMap().isEmpty() == false || !test, cmd.toStdString().c_str()); } } void TestDice::scopeDF() |