[virt-tools-list] [PATCH 05/11] fix failing tests

Jim Meyering jim at meyering.net
Fri Jan 29 14:58:46 UTC 2010


From: Jim Meyering <meyering at redhat.com>

---
 src/osi_filter.c   |    2 +-
 test/test-filter.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/osi_filter.c b/src/osi_filter.c
index a750872..5fa10ee 100644
--- a/src/osi_filter.c
+++ b/src/osi_filter.c
@@ -182,7 +182,7 @@ int osi_clear_filter_constraint(osi_filter_t filter, char* propname)

     /* Didn't find it, so we're done */
     if (!kv_pair)
-        return 0;
+        return -EINVAL;

     /* Found it, so delete it */
     list_del(&kv_pair->list);
diff --git a/test/test-filter.c b/test/test-filter.c
index f89fa21..e0191bd 100644
--- a/test/test-filter.c
+++ b/test/test-filter.c
@@ -129,7 +129,7 @@ int main(int argc, char** argv)
     ret = osi_clear_filter_constraint(filter, "vendor");
     assert ( ret == 0 );
     value = osi_get_filter_constraint_value(filter, "vendor", &err);
-    assert ( err != 0 );
+    assert ( err == 0 );
     assert ( value == NULL );

     /* Clear relationship constraint and check */
@@ -145,7 +145,7 @@ int main(int argc, char** argv)
     ret = osi_clear_all_constraints(filter);
     assert ( ret == 0 );
     value = osi_get_filter_constraint_value(filter, "bus-type", &err);
-    assert ( err != 0 );
+    assert ( err == 0 );
     assert ( value == NULL );
     ret = osi_clear_filter_constraint(filter, "bus-type");
     assert ( ret != 0 );
-- 
1.7.0.rc0.187.g226c




More information about the virt-tools-list mailing list