aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2021-07-18 19:01:20 +0200
committerRenaud G <renaud@rolisteam.org>2021-12-11 18:31:23 +0100
commit7be8941fc9d5b819860d80c37a7401bee60432cc (patch)
tree7324c9174541f88d1a6df8e68c67097d35e50c42 /tests
parent31de5347732e16864cadfe9774c7e9b479b99f93 (diff)
downloadOneRoll-7be8941fc9d5b819860d80c37a7401bee60432cc.tar.gz
OneRoll-7be8941fc9d5b819860d80c37a7401bee60432cc.zip
Fix switch/case operator.
Diffstat (limited to 'tests')
-rw-r--r--tests/dice/tst_dice.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/dice/tst_dice.cpp b/tests/dice/tst_dice.cpp
index a3f0980..150dddb 100644
--- a/tests/dice/tst_dice.cpp
+++ b/tests/dice/tst_dice.cpp
@@ -44,6 +44,7 @@
#include "node/stringnode.h"
#include "node/switchcasenode.h"
#include "node/uniquenode.h"
+#include "node/valueslistnode.h"
#include "operationcondition.h"
#include "parsingtoolbox.h"
#include "result/stringresult.h"
@@ -1233,8 +1234,10 @@ void TestDice::switchCaseTest()
QFETCH(QString, expected);
QFETCH(bool, stopatfirt);
- NumberNode* node1= new NumberNode();
- node1->setNumber(value);
+ NumberNode* valNode= new NumberNode();
+ ValuesListNode* node1= new ValuesListNode();
+ valNode->setNumber(value);
+ node1->insertValue(valNode);
SwitchCaseNode* node2= new SwitchCaseNode();
node2->setStopAtFirt(stopatfirt);
@@ -1297,7 +1300,7 @@ void TestDice::switchCaseTest_data()
<< QList<int>{1, 2, 3, 4} << QStringList{"a", "b", "c", "d"} << QStringLiteral("a,b,c")
<< false;
- QTest::addRow("cmd6") << 3
+ QTest::addRow("cmd7") << 3
<< QList<BC::LogicOperator>{BC::LesserOrEqual, BC::LesserOrEqual, BC::LesserOrEqual,
BC::LesserOrEqual}
<< QList<int>{1, 2, 3, 4} << QStringList{"a", "b", "c", "d"} << QStringLiteral("c") << true;