support RESULT_UNNEEDED in testcases
authorMichael Schroeder <mls@suse.de>
Wed, 29 Feb 2012 14:24:00 +0000 (15:24 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 29 Feb 2012 14:24:00 +0000 (15:24 +0100)
ext/testcase.c

index fda56f1..8bb132f 100644 (file)
@@ -1398,6 +1398,20 @@ testcase_solverresult(Solver *solv, int resultflags)
       queue_free(&qs);
     }
 
+  if ((resultflags & TESTCASE_RESULT_UNNEEDED) != 0)
+    {
+      Queue q;
+
+      queue_init(&q);
+      solver_get_unneeded(solv, &q, 0);
+      for (i = 0; i < q.count; i++)
+       {
+         s = pool_tmpjoin(pool, "unneeded ", testcase_solvid2str(pool, q.elements[i]), 0);
+         strqueue_push(&sq, s);
+       }
+      queue_free(&q);
+    }
+
   strqueue_sort(&sq);
   result = strqueue_join(&sq);
   strqueue_free(&sq);