Fix comparisons in 'increases' and 'decreases' functions.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 21 Feb 2012 17:55:47 +0000 (17:55 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 21 Feb 2012 17:57:36 +0000 (17:57 +0000)
The tests were the wrong way round.

lib/whenutils.ml

index e43dcf6..2db4103 100644 (file)
@@ -480,14 +480,14 @@ let rec eval_whenexpr job variables onload = function
 
   | Expr_increases v ->
     let prev_value, curr_value = get_prev_curr_value job variables v in
-    if compare_values prev_value curr_value > 0 then
+    if compare_values prev_value curr_value < 0 then
       T_bool true
     else
       T_bool false
 
   | Expr_decreases v ->
     let prev_value, curr_value = get_prev_curr_value job variables v in
-    if compare_values prev_value curr_value < 0 then
+    if compare_values prev_value curr_value > 0 then
       T_bool true
     else
       T_bool false