richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone
379fd8
From faaa64a51445b6edffe6f1e65c465dea63f11bf7 Mon Sep 17 00:00:00 2001
379fd8
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
379fd8
Date: Tue, 27 Apr 2021 10:24:53 +0200
379fd8
Subject: [PATCH 16/19] Fix failing unittest, caused by the revert of new
379fd8
 modular implementation
379fd8
379fd8
The problem is not caused by advisory filtering which we are testing
379fd8
here, the `query` is already created with just one package.
379fd8
---
379fd8
 tests/libdnf/sack/QueryTest.cpp | 5 +----
379fd8
 1 file changed, 1 insertion(+), 4 deletions(-)
379fd8
379fd8
diff --git a/tests/libdnf/sack/QueryTest.cpp b/tests/libdnf/sack/QueryTest.cpp
379fd8
index ee9eeaf4..7c3a22af 100644
379fd8
--- a/tests/libdnf/sack/QueryTest.cpp
379fd8
+++ b/tests/libdnf/sack/QueryTest.cpp
379fd8
@@ -139,13 +139,10 @@ void QueryTest::testQueryFilterAdvisory()
379fd8
     dnf_sack_filter_modules_v2(sack, modules, nullptr, tmpdir, nullptr, true, false, false);
379fd8
     query = new libdnf::Query(sack);
379fd8
     query->addFilter(HY_PKG_ADVISORY_TYPE, HY_EQ, "enhancement");
379fd8
-    CPPUNIT_ASSERT(query->size() == 2);
379fd8
+    CPPUNIT_ASSERT(query->size() == 1);
379fd8
     libdnf::PackageSet pset2 = *(query->getResultPset());
379fd8
     pkg = dnf_package_new(sack, pset2[0]);
379fd8
     CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
379fd8
     g_object_unref(pkg);
379fd8
-    pkg = dnf_package_new(sack, pset2[1]);
379fd8
-    CPPUNIT_ASSERT(!g_strcmp0(dnf_package_get_name(pkg), "test-perl-DBI"));
379fd8
-    g_object_unref(pkg);
379fd8
     delete query;
379fd8
 }
379fd8
-- 
379fd8
2.31.1
379fd8