Fix incorrect usage of the fail_unless macro

Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit 7389d8c020f08d5bed3ee416dab393d34c15c369)
This commit is contained in:
cherry530 2022-02-08 16:01:26 +08:00 committed by openeuler-sync-bot
parent ab5fef8892
commit 1bd2c378d3
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 4f3f747cdf3e5d7ab0dadc4f25bca56fb16ce923 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= <lhrazky@redhat.com>
Date: Thu, 6 Aug 2020 10:59:59 +0200
Subject: [PATCH] tests: Fix incorrect usage of the fail_unless macro
---
libdnf/tests/hawkey/test_query.cpp | 2 +-
libdnf/tests/hawkey/test_sack.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdnf/tests/hawkey/test_query.cpp b/libdnf/tests/hawkey/test_query.cpp
index bf9626a..4235681 100644
--- a/libdnf/tests/hawkey/test_query.cpp
+++ b/libdnf/tests/hawkey/test_query.cpp
@@ -303,7 +303,7 @@ START_TEST(test_query_pkg)
hy_query_filter(q, HY_PKG_NAME, HY_EQ, "jay");
pset = hy_query_run_set(q);
hy_query_free(q);
- fail_unless(dnf_packageset_count(pset), 2);
+ fail_unless(dnf_packageset_count(pset) == 2);
// use hy_query_filter_package_in():
q = hy_query_create(test_globals.sack);
diff --git a/libdnf/tests/hawkey/test_sack.cpp b/libdnf/tests/hawkey/test_sack.cpp
index 2bb67f4..e5ed31b 100644
--- a/libdnf/tests/hawkey/test_sack.cpp
+++ b/libdnf/tests/hawkey/test_sack.cpp
@@ -84,7 +84,7 @@ START_TEST(test_list_arches)
const char ** arches = dnf_sack_list_arches(sack);
/* noarch, x86_64, athlon, i686, i586, i486, i386 */
- fail_unless(g_strv_length((gchar**)arches), 7);
+ fail_unless(g_strv_length((gchar**)arches) == 7);
ck_assert_str_eq(arches[3], "i686");
g_free(arches);

View File

@ -4,13 +4,14 @@
Name: rpm-ostree
Version: 2018.8
Release: 4
Release: 5
Summary: Hybrid image/package system
License: LGPLv2+
URL: https://github.com/projectatomic/rpm-ostree
Source0: https://github.com/coreos/rpm-ostree/archive/v%{version}.tar.xz#/%{name}-%{version}.tar.xz
Patch0: eliminate-rpmostree-differences.patch
Patch1: Fix-incorrect-usage-of-the-fail_unless-macro.patch
%if %{with rust}
@ -110,6 +111,12 @@ echo "%{_libdir}/%{name}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%{_mandir}/man*/*
%changelog
* Tue Feb 08 2022 xu_ping <xuping33@huawei.com> - 2018.8-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Fix incorrect usage of the fail_unless macro
* Fri Sep 10 2021 gaihuiying <gaihuiying1@huawei.com> - 2018.8-4
- Type:bugfix
- ID:NA