[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kalgebra/analitza
From:       Aleix Pol Gonzalez <aleixpol () gmail ! com>
Date:       2010-12-03 20:43:27
Message-ID: 20101203204327.85274AC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1203394 by apol:

Fix crash, don't bypass every minus operator count.

BUG: 258731


 M  +1 -1      expression.cpp  
 M  +1 -1      expression.h  
 M  +2 -0      tests/expressiontest.cpp  


--- trunk/KDE/kdeedu/kalgebra/analitza/expression.cpp #1203393:1203394
@@ -149,7 +149,7 @@
 	Operator::OperatorType opt=op.operatorType();
 	int cnt=c->countValues();
 	
-	if(((op.nparams()<0 && cnt<=1) || (op.nparams()>-1 && cnt!=op.nparams())) && \
opt!=Operator::minus) +	if(((op.nparams()<0 && cnt<=1) || (op.nparams()>-1 && \
cnt!=op.nparams())) && (opt!=Operator::minus || cnt==0))  {
 		if(op.nparams()<0)
 			m_err << i18n("<em>%1</em> needs at least 2 parameters", op.toString());
--- trunk/KDE/kdeedu/kalgebra/analitza/expression.h #1203393:1203394
@@ -109,7 +109,7 @@
 		/**
 		 *	Returns the expression of the lambda body (without resolving the dependencies)
 		 */
-		Expression lambdaBody() const;
+		Expression lambdaBody() const Q_REQUIRED_RESULT;
 		
 		/**
 		 *	Returns whether it is a vector expression.
--- trunk/KDE/kdeedu/kalgebra/analitza/tests/expressiontest.cpp #1203393:1203394
@@ -189,6 +189,8 @@
 	
 	QTest::newRow("same args") << "(x,x)->x";
 	QTest::newRow("same boundings") << "sum(x : (x,x)=1..10)";
+	
+	QTest::newRow("empty minus") << "minus()";
 }
 
 void ExpressionTest::testUncorrection()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic