dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0016-Fix-failing-unittest-caused-by-the-revert-of-new-mod.patch

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