From: konrad Date: Fri, 10 Dec 2010 21:32:48 +0000 (+0000) Subject: regression tests for fixed crash X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=cb4bad937cc0d023b49ed3850644b5428df550d0;p=web%2Fkonrad%2Ftaurus.git regression tests for fixed crash git-svn-id: https://silmor.de/svn/softmagic/elam/trunk@654 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/tests/eval/eval.cpp b/tests/eval/eval.cpp index abf866c..da3adaf 100644 --- a/tests/eval/eval.cpp +++ b/tests/eval/eval.cpp @@ -9,6 +9,12 @@ using namespace ELAM; +void ElamTest::emptytest() +{ + QVariant v=Engine().evaluate(""); + QCOMPARE(v.userType(),Exception::metaTypeId()); +} + void ElamTest::evaltest() { IntEngine ie; diff --git a/tests/eval/eval.h b/tests/eval/eval.h index 11986f6..ef4409c 100644 --- a/tests/eval/eval.h +++ b/tests/eval/eval.h @@ -4,6 +4,7 @@ class ElamTest:public QObject { Q_OBJECT private slots: + void emptytest(); void evaltest(); void excepttest(); void counttest(); diff --git a/tests/parser/parser.cpp b/tests/parser/parser.cpp index fef435b..449b31b 100644 --- a/tests/parser/parser.cpp +++ b/tests/parser/parser.cpp @@ -114,5 +114,13 @@ void ElamTest::stringLiteral() QCOMPARE(v2.toString(),QString("abc12")); } +void ElamTest::emptyList() +{ + IntEngine ie; + QListtl=ie.tokenize(""); + QCOMPARE(tl.size(),0); + tl=ie.tokenize(" \t\n"); + QCOMPARE(tl.size(),0); +} QTEST_MAIN(ElamTest) \ No newline at end of file diff --git a/tests/parser/parser.h b/tests/parser/parser.h index ca5571d..215de9d 100644 --- a/tests/parser/parser.h +++ b/tests/parser/parser.h @@ -7,4 +7,5 @@ class ElamTest:public QObject void charClass(); void tokenizer(); void stringLiteral(); + void emptyList(); };